Files
ResInsight/Fwk/AppFwk/cafProjectDataModel/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

51 lines
1.0 KiB
CMake

project(cafProjectDataModel)
# Unity Build
if(CAF_ENABLE_UNITY_BUILD)
message("Cmake Unity build is enabled on : ${PROJECT_NAME}")
set(CMAKE_UNITY_BUILD true)
endif()
# 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)
endif()
set(PROJECT_FILES
cafFactory.h
cafOmpMutex.h
cafPdmDocument.cpp
cafPdmDocument.h
cafPdmObjectGroup.cpp
cafPdmObjectGroup.h
cafPdmObject.cpp
cafPdmObject.h
)
add_library(${PROJECT_NAME} ${PROJECT_FILES})
target_link_libraries(${PROJECT_NAME} cafPdmUiCore cafPdmXml ${QT_LIBRARIES})
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
if(MSVC)
set_target_properties(
${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/W4 /wd4100 /wd4127 /wd4996"
)
endif()
source_group("" FILES ${PROJECT_FILES})