cmake_minimum_required(VERSION 3.13) # CMake version check project(lockin) # Create project "simple_example" set(CMAKE_CXX_STANDARD 17) # Enable c++17 standard (20 would not work) add_definitions(-DQT_NO_VERSION_TAGGING) # do not use: -Wstrict-overflow=2 # disaster for Qt include-files SET(CMAKE_CXX_FLAGS "-g2 -fPIC -Wall" ) set(CMAKE_AUTOMOC ON) # hackish module object compiler # All the .cxx source files of the project: file(STRINGS sources.txt SOURCE_FILES) # Add executable target with source files listed in SOURCE_FILES variable add_executable(lockin ${SOURCE_FILES}) target_link_libraries(lockin "-lQt5Gui -lQt5Core -lQt5Widgets -lqwt-qt5") target_link_libraries(lockin "-lasound -lgsl") target_include_directories(lockin PUBLIC /usr/include/x86_64-linux-gnu/qt5/ /usr/include/x86_64-linux-gnu/qt5/QtWidgets /usr/include/x86_64-linux-gnu/qt5/QtGui /usr/include/x86_64-linux-gnu/qt5/QtCore /usr/include/qwt/ ) ############ find_package(ALSA) # not necessary, not helpful AFAICT find_package(Qt5 COMPONENTS Widgets) # necessary include(CMakePrintHelpers) message("files: a b c ${SOURCE_FILES}") cmake_print_variables(SOURCE_FILES)