forked from copperspice/kitchensink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
105 lines (78 loc) · 3.12 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
105
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
cmake_policy(VERSION 3.8..3.13)
# support using rpath on Mac OS X
cmake_policy(SET CMP0042 NEW)
project(KitchenSink)
set(BUILD_MAJOR "1")
set(BUILD_MINOR "6")
set(BUILD_MICRO "0")
set(BUILD_COMPONENTS "KitchenSink")
include(CheckCXXCompilerFlag)
include(CheckCXXSourceCompiles)
include(CheckIncludeFile)
include(CheckIncludeFiles)
include(CheckTypeSize)
find_package(CopperSpice REQUIRED)
# file locations for installing
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
include(GNUInstallDirs)
set(CMAKE_INSTALL_RPATH "@executable_path")
elseif(CMAKE_SYSTEM_NAME MATCHES "(Linux|OpenBSD|FreeBSD|NetBSD|DragonFly)")
include(GNUInstallDirs)
set(CMAKE_INSTALL_RPATH "\$ORIGIN")
elseif(MSVC)
# use defaults
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION .)
include(${CopperSpice_DIR}/InstallMinGW.cmake)
endif()
set(PACKAGE "kitchensink")
set(PACKAGE_NAME "KitchenSink")
set(PACKAGE_VERSION "${BUILD_MAJOR}.${BUILD_MINOR}.${BUILD_MICRO}")
set(PACKAGE_STRING "KitchenSink ${BUILD_MAJOR}.${BUILD_MINOR}.${BUILD_MICRO}")
set(PACKAGE_TARNAME "kitchensink")
set(PACKAGE_BUGREPORT "[email protected]")
set(PACKAGE_URL "https://www.copperspice.com/")
set(CPACK_PACKAGE_NAME ${PROJECT_NAME} )
set(CPACK_PACKAGE_VENDOR "CopperSpice")
set(CPACK_PACKAGE_VERSION_MAJOR ${BUILD_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${BUILD_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${BUILD_MICRO})
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "GUI application containing multiple examples using the CopperSpice libraries")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md")
set(CPACK_SOURCE_IGNORE_FILES "/build/;/.git;${CPACK_SOURCE_IGNORE_FILES}")
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX})
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF)
include(CPack)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_INCLUDE_DIRECTORIES_BEFORE ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 17)
if("Multimedia" IN_LIST COPPERSPICE_COMPONENTS)
# multimedia found and will be linked with project
else()
add_definitions(-DQT_NO_MULTIMEDIA)
endif()
if("WebKit" IN_LIST COPPERSPICE_COMPONENTS)
# webkit found and will be linked with project
else()
add_definitions(-DQT_NO_WEBKIT)
endif()
if(APPLE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-undefined,error")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined,error")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-undefined,error")
else()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-undefined")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined")
endif()
string(TIMESTAMP BUILD_DATE "%m/%d/%Y")
add_definitions(-DBUILD_DATE="${BUILD_DATE}")
configure_file(
${CMAKE_SOURCE_DIR}/src/ks_build_info.h.in
src/ks_build_info.h
)
# location for building binary files
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
add_subdirectory(src)