ResInsight/Fwk/AppFwk/cafCommand/CMakeLists.txt
Magne Sjaastad edf44cb4c0 Prepare CMake to support both Qt5 andf Qt6
CEE_USE_QT6 controls if Qt6 is used.
Improved install and package for Qt6, target version Qt 6.5.3
Added Qt6 to github action for AppFwkUnitTest
2024-01-09 11:02:41 +01:00

64 lines
1.5 KiB
CMake

project(cafCommand)
# Unity Build
if(CAF_ENABLE_UNITY_BUILD)
message("Cmake Unity build is enabled on : ${PROJECT_NAME}")
set(CMAKE_UNITY_BUILD true)
endif()
# These headers need to go through Qt's MOC compiler
set(MOC_HEADER_FILES cafCmdFeature.h cafCmdFeatureManager.h)
# Qt
if(CEE_USE_QT6)
find_package(
Qt6
COMPONENTS
REQUIRED Core Gui Widgets
)
set(QT_LIBRARIES Qt6::Core Qt6::Gui Qt6::Widgets)
qt_standard_project_setup()
else()
find_package(
Qt5
COMPONENTS
REQUIRED Core Gui Widgets
)
set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets)
qt5_wrap_cpp(MOC_SOURCE_FILES ${MOC_HEADER_FILES})
endif()
set(PROJECT_FILES
cafCmdExecCommandManager.cpp
cafCmdExecCommandManager.h
cafCmdExecuteCommand.h
cafCmdUiCommandSystemImpl.h
cafCmdUiCommandSystemImpl.cpp
cafCmdFieldChangeExec.cpp
cafCmdFieldChangeExec.h
cafCmdSelectionHelper.cpp
cafCmdSelectionHelper.h
cafCmdSelectionChangeExec.cpp
cafCmdSelectionChangeExec.h
cafCmdFeature.cpp
cafCmdFeature.h
cafCmdFeatureManager.cpp
cafCmdFeatureManager.h
cafCmdFeatureMenuBuilder.cpp
cafCmdFeatureMenuBuilder.h
)
add_library(${PROJECT_NAME} ${PROJECT_FILES} ${MOC_SOURCE_FILES})
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(${PROJECT_NAME} cafProjectDataModel ${QT_LIBRARIES})
if(MSVC)
set_target_properties(
${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/W4 /wd4100 /wd4127 /wd4996"
)
endif()
source_group("" FILES ${PROJECT_FILES})