forked from lirios/fluid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
104 lines (88 loc) · 3.5 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
project(Fluid)
cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
cmake_policy(VERSION 3.4.1)
# Instruct CMake to run moc and rrc automatically when needed
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
# Apple-specific configuration
set(APPLE_SUPPRESS_X11_WARNING ON)
# Set version
set(PROJECT_VERSION "0.10.0")
set(PROJECT_VERSION_MAJOR 0)
set(PROJECT_SOVERSION 0)
# Set up packaging
if(NOT USE_SUPERBUILD)
set(CPACK_PACKAGE_NAME "fluid")
set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
set(CPACK_GENERATOR "TGZ")
set(CPACK_SET_DESTDIR FALSE)
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
set(CPACK_SOURCE_IGNORE_FILES "/build/;/.git;/.tx/;~$;${CPACK_SOURCE_IGNORE_FILES}")
include(CPack)
add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
endif()
# ECM
find_package(ECM 1.7.0 REQUIRED NO_MODULE)
list(APPEND CMAKE_MODULE_PATH
"${ECM_MODULE_PATH}"
"${ECM_KDE_MODULE_DIR}"
)
# Macros
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECompilerSettings)
include(KDECMakeSettings)
# Build flags
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden -Werror -Wall -Wextra -Wformat -Wswitch-default -Wunused-parameter -pedantic -std=c++11")
# Assume release build by default
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "" FORCE)
endif()
# Find Qt5
set(REQUIRED_QT_VERSION "5.8.0")
find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED COMPONENTS
Svg Gui Qml Quick QuickTest QuickControls2)
# Find QT_INSTALL_DOCS
get_target_property(QMAKE_EXECUTABLE Qt5::qmake LOCATION)
if(NOT QT_INSTALL_DOCS)
exec_program(${QMAKE_EXECUTABLE} ARGS "-query QT_INSTALL_DOCS" RETURN_VALUE return_code OUTPUT_VARIABLE QT_INSTALL_DOCS)
endif()
if(NOT QT_HOST_DATA)
exec_program(${QMAKE_EXECUTABLE} ARGS "-query QT_HOST_DATA" RETURN_VALUE return_code OUTPUT_VARIABLE QT_HOST_DATA)
endif()
# Documentation target
find_program(QDOC_EXECUTABLE qdoc-qt5 qdoc)
add_custom_target(docs
COMMAND QT_INSTALL_DOCS=${QT_INSTALL_DOCS} QT_VERSION_TAG=5.7 FLUID_VERSION=${PROJECT_VERSION} FLUID_VERSION_TAG=1.0 FLUID_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR} ${QDOC_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/doc/fluid.qdocconf)
# Subdirectories
add_subdirectory(src)
add_subdirectory(tests)
# Install icons
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/icons")
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/icons"
DESTINATION ${QML_INSTALL_DIR}/Fluid/Controls
PATTERN "icons/icons.qrc" EXCLUDE)
endif()
# Install qmake features
# We do not install features anymore, just rely on submodules
# to avoid a Fluid dependency on modules where it doesn't make sense
#set(features_SOURCES
# features/liri_create_cmake.prf
# features/liri_deployment.prf
# features/liri_qml_module.prf
# features/liri_qml_plugin.prf
# features/liri_qt_app.prf
# features/liri_qt_module.prf
# features/liri_qt_module_pris.prf
# features/liri_qt_plugin.prf
#)
#install(FILES ${features_SOURCES} DESTINATION ${QT_HOST_DATA}/mkspecs/features)
#set(features_cmake_SOURCES
# features/data/cmake/liri_ExtraSourceIncludes.cmake.in
# features/data/cmake/liri_Qt5BasicConfig.cmake.in
# features/data/cmake/liri_Qt5ConfigVersion.cmake.in
# features/data/cmake/liri_Qt5PluginTarget.cmake.in
#)
#install(FILES ${features_cmake_SOURCES} DESTINATION ${QT_HOST_DATA}/mkspecs/features/data/cmake)
# Display feature summary
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)