# Set Name of project and language project(Ex03 LANGUAGES CXX) # Set cmake version cmake_minimum_required(VERSION 3.10) # set build type to Debug/Release set(CMAKE_BUILD_TYPE "Debug") # add Qt5 find_package(Qt5 COMPONENTS Widgets PrintSupport REQUIRED) # Qt Flags #Instruct Cmake to run moc automatically when needed set(CMAKE_AUTOMOC ON) #Create code from a list of Qt designer ui files set(CMAKE_AUTOUIC ON) #Instruct Cmake to get the ressources set(CMAKE_AUTORCC ON) # find all source files recursively file(GLOB_RECURSE FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp") file(GLOB_RECURSE HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/src/*.h") file(GLOB_RECURSE UI "${CMAKE_CURRENT_SOURCE_DIR}/src/*.ui") list(APPEND FILES ${HEADERS} ${UI}) # Create executable using the specified source files add_executable(${PROJECT_NAME} ${FILES}) # link directories target_link_directories(${PROJECT_NAME} PRIVATE src/ src/ui/ src/ui/qcustomplot-source/ ) # include directories INCLUDE_DIRECTORIES( src/ src/ui/ src/ui/qcustomplot-source/ ) # link libraries target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Widgets Qt5::PrintSupport) # Define required c++ standard to C++11 target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) # Set compile options, enable warnings target_compile_options(${PROJECT_NAME} PRIVATE $<$,$>: -Wall> $<$: /W3> ) # Copy needed files to executable repository file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/ekg.txt DESTINATION ${CMAKE_CURRENT_BINARY_DIR})