aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2022-03-28 23:23:30 +0200
committerRenaud G <renaud@rolisteam.org>2022-04-16 02:55:55 +0200
commit0c040da59e6aa2df3bd0c22e38b2afe0512d3749 (patch)
tree05493904ce49fc8daf0fc7f82c9b48e96cbe29cb /CMakeLists.txt
parent44bf6ecfdca6b0499b5ae2cf7b380a3ff310f0e9 (diff)
downloadOneRoll-0c040da59e6aa2df3bd0c22e38b2afe0512d3749.tar.gz
OneRoll-0c040da59e6aa2df3bd0c22e38b2afe0512d3749.zip
update to new cmake
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 5 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dd3b026..da59749 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,8 +3,9 @@ cmake_minimum_required(VERSION 3.16)
project(diceparser VERSION 1.9.0 DESCRIPTION "Parser of dice command")
set(QT_REQUIRED_VERSION "6.3.0")
-find_package(Qt6 ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS Core Test Gui Svg)
-find_package(Qt6 ${QT_REQUIRED_VERSION} CONFIG COMPONENTS Qml Concurrent)
+set(QT_VERSION_MAJOR "6")
+find_package(Qt${QT_VERSION_MAJOR} ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS Core Test Gui Svg)
+find_package(Qt${QT_VERSION_MAJOR} ${QT_REQUIRED_VERSION} CONFIG COMPONENTS Qml Concurrent)
enable_testing(true)
include_directories(${CMAKE_CURRENT_SOURCE_DIR} result node)
@@ -80,7 +81,7 @@ target_include_directories(diceparser_shared PRIVATE include ./)
SET_TARGET_PROPERTIES(diceparser_shared PROPERTIES OUTPUT_NAME diceparser CLEAN_DIRECT_OUTPUT 1)
-target_link_libraries(diceparser_shared PUBLIC Qt6::Core Qt6::Gui Qt6::Svg)
+target_link_libraries(diceparser_shared PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Svg)
set_target_properties(diceparser_shared PROPERTIES VERSION ${PROJECT_VERSION})
set_target_properties(diceparser_shared PROPERTIES SOVERSION 1)
@@ -116,7 +117,7 @@ set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_library(diceparser_qobject SHARED ${dice_header_qobject} ${dice_source_qobject})
-target_link_libraries(diceparser_qobject PUBLIC Qt6::Core Qt6::Gui Qt6::Svg Qt6::Qml Qt6::Concurrent PRIVATE diceparser_shared)
+target_link_libraries(diceparser_qobject PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Svg Qt${QT_VERSION_MAJOR}::Qml Qt${QT_VERSION_MAJOR}::Concurrent PRIVATE diceparser_shared)
message("Messages diceparser ${CMAKE_CURRENT_SOURCE_DIR}/include")
target_include_directories(diceparser_qobject PRIVATE include ./ ${CMAKE_CURRENT_SOURCE_DIR}/include)
endif()