2018-02-27 17:20:46 +01:00
|
|
|
cmake_minimum_required (VERSION 2.8.12)
|
2015-07-29 14:19:43 +02:00
|
|
|
|
|
|
|
|
project (cafCommand)
|
|
|
|
|
|
2020-01-23 13:37:29 +01:00
|
|
|
# Unity Build
|
|
|
|
|
if (CAF_ENABLE_UNITY_BUILD)
|
|
|
|
|
message("Cmake Unity build is enabled on : ${PROJECT_NAME}")
|
|
|
|
|
set(CMAKE_UNITY_BUILD true)
|
|
|
|
|
endif()
|
2015-07-29 14:19:43 +02:00
|
|
|
|
|
|
|
|
# These headers need to go through Qt's MOC compiler
|
2018-11-27 08:40:24 +01:00
|
|
|
set (MOC_HEADER_FILES
|
2015-07-29 14:19:43 +02:00
|
|
|
cafCmdFeature.h
|
|
|
|
|
cafCmdFeatureManager.h
|
|
|
|
|
)
|
|
|
|
|
|
2019-05-28 10:50:39 +02:00
|
|
|
# Qt
|
2020-04-23 22:59:37 +02:00
|
|
|
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} )
|
2015-07-29 14:19:43 +02:00
|
|
|
|
|
|
|
|
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
|
2017-11-19 01:12:39 +01:00
|
|
|
cafCmdFeatureMenuBuilder.cpp
|
|
|
|
|
cafCmdFeatureMenuBuilder.h
|
2015-07-29 14:19:43 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
add_library( ${PROJECT_NAME}
|
|
|
|
|
${PROJECT_FILES}
|
2018-11-27 08:40:24 +01:00
|
|
|
${MOC_SOURCE_FILES}
|
2015-07-29 14:19:43 +02:00
|
|
|
)
|
|
|
|
|
|
2018-02-25 15:03:45 +01:00
|
|
|
target_include_directories(${PROJECT_NAME}
|
|
|
|
|
PUBLIC
|
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
target_link_libraries ( ${PROJECT_NAME}
|
|
|
|
|
cafProjectDataModel
|
2018-11-27 08:40:24 +01:00
|
|
|
${QT_LIBRARIES}
|
2018-02-25 15:03:45 +01:00
|
|
|
)
|
|
|
|
|
|
2018-09-27 21:27:34 +02:00
|
|
|
if (MSVC)
|
|
|
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/W4 /wd4100 /wd4127")
|
|
|
|
|
endif()
|
|
|
|
|
|
2018-02-27 17:20:46 +01:00
|
|
|
source_group("" FILES ${PROJECT_FILES})
|
2019-02-01 06:56:11 +01:00
|
|
|
|
2019-02-11 07:13:08 +01:00
|
|
|
# cotire
|
|
|
|
|
if (COMMAND caf_apply_cotire)
|
|
|
|
|
caf_apply_cotire("${PROJECT_NAME}")
|
2019-02-01 06:56:11 +01:00
|
|
|
endif()
|