set project cpp-files to c++17 when qt is included, search and link to a threading library
This commit is contained in:
@@ -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()
|
||||
|
@@ -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
|
||||
)
|
||||
|
Reference in New Issue
Block a user