# Set C++ standards set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) # Qt: add dependencies to needed components find_package(Qt5 COMPONENTS Core Widgets Sql REQUIRED) # Qt: Automatically handle moc, .rc and .ui files. # Search for includes in source and binary directory, so that CMake cand find # Qt intermediate files set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) # List of C++ sources for current executable set (nicolodi_CXXSRCS EditWindow.cpp Pin.cpp db.cpp fullQuery.cpp main.cpp status.cpp ) # Qt: list of .ui sources for current executable set (nicolodi_UISRCS EditWindow.ui Pin.ui ) # Qt: generate ui_*.h files from *.ui qt5_wrap_ui (nicolodi_GENUISRCS ${nicolodi_UISRCS}) # Dependencies mashup to generate the executable add_executable (nicolodi ${nicolodi_CXXSRCS} ${nicolodi_GENUISRCS} ) # Qt: link needed libraries target_link_libraries(nicolodi Qt5::Widgets Qt5::Sql) # CMake packaging system install(TARGETS nicolodi RUNTIME DESTINATION bin) set(CPACK_PACKAGE_CONTACT "GOLEM ") include (CPack)