set project cpp-files to c++17 when qt is included, search and link to a threading library

This commit is contained in:
Joakim L. Gilje
2021-11-28 20:54:32 +01:00
parent 859ee888ce
commit 6aef88c957
2 changed files with 8 additions and 1 deletions

View File

@@ -130,6 +130,9 @@ if(APPLE)
endif()
if(QT)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
find_package(Qt5 COMPONENTS Core Widgets REQUIRED)
endif()
@@ -249,4 +252,4 @@ elseif(WIN32)
add_subdirectory(win)
else()
add_subdirectory(unix)
endif()
endif()

View File

@@ -4,6 +4,8 @@ set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
find_package(Threads REQUIRED)
add_library(plat STATIC qt.c qt_main.cpp qt_platform.cpp qt_midi.cpp cpp11_thread.cpp)
add_library(ui STATIC
qt_ui.cpp
@@ -78,10 +80,12 @@ target_link_libraries(
plat
PRIVATE
Qt5::Widgets
Threads::Threads
)
target_link_libraries(
ui
PRIVATE
Qt5::Widgets
Threads::Threads
)