-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
156 lines (130 loc) · 5.41 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
cmake_minimum_required(VERSION 2.8)
list(APPEND CMAKE_MODULE_PATH
${CMAKE_CURRENT_LIST_DIR}/cmake/Modules
)
set(CMAKE_USER_MAKE_RULES_OVERRIDE ${CMAKE_CURRENT_LIST_DIR}/cmake/cmake-tools/DefaultBuildFlags.cmake)
project(BoostGeometryVector NONE)
# Set project version
include(version.cmake)
#############
# Sources #
#############
set(PROJECT_INCLUDE_DIR
${PROJECT_SOURCE_DIR}/include
)
set(${PROJECT_NAME}_INCLUDE_DIR ${PROJECT_INCLUDE_DIR} CACHE INTERNAL "")
set(PROJECT_FILES
${PROJECT_INCLUDE_DIR}/${PROJECT_NAME}/BoostGeometryVector.hpp
${PROJECT_INCLUDE_DIR}/${PROJECT_NAME}/algorithms/assign.hpp
${PROJECT_INCLUDE_DIR}/${PROJECT_NAME}/algorithms/comparable_length.hpp
${PROJECT_INCLUDE_DIR}/${PROJECT_NAME}/algorithms/convert.hpp
${PROJECT_INCLUDE_DIR}/${PROJECT_NAME}/algorithms/disjoint.hpp
${PROJECT_INCLUDE_DIR}/${PROJECT_NAME}/algorithms/equals.hpp
${PROJECT_INCLUDE_DIR}/${PROJECT_NAME}/algorithms/length.hpp
${PROJECT_INCLUDE_DIR}/${PROJECT_NAME}/algorithms/transform.hpp
${PROJECT_INCLUDE_DIR}/${PROJECT_NAME}/algorithms/detail/assign_values.hpp
${PROJECT_INCLUDE_DIR}/${PROJECT_NAME}/algorithms/detail/convert_vector_to_vector.hpp
${PROJECT_INCLUDE_DIR}/${PROJECT_NAME}/algorithms/detail/disjoint.hpp
${PROJECT_INCLUDE_DIR}/${PROJECT_NAME}/arithmetic/cross_product.hpp
${PROJECT_INCLUDE_DIR}/${PROJECT_NAME}/core/access.hpp
${PROJECT_INCLUDE_DIR}/${PROJECT_NAME}/core/closure.hpp
${PROJECT_INCLUDE_DIR}/${PROJECT_NAME}/core/point_order.hpp
${PROJECT_INCLUDE_DIR}/${PROJECT_NAME}/core/tags.hpp
${PROJECT_INCLUDE_DIR}/${PROJECT_NAME}/core/geometry_id.hpp
${PROJECT_INCLUDE_DIR}/${PROJECT_NAME}/geometries/geometries.hpp
${PROJECT_INCLUDE_DIR}/${PROJECT_NAME}/geometries/vector.hpp
${PROJECT_INCLUDE_DIR}/${PROJECT_NAME}/geometries/concepts/check.hpp
${PROJECT_INCLUDE_DIR}/${PROJECT_NAME}/geometries/concepts/vector_concept.hpp
${PROJECT_INCLUDE_DIR}/${PROJECT_NAME}/geometries/register/vector.hpp
${PROJECT_INCLUDE_DIR}/${PROJECT_NAME}/strategies/strategies.hpp
${PROJECT_INCLUDE_DIR}/${PROJECT_NAME}/strategies/length.hpp
${PROJECT_INCLUDE_DIR}/${PROJECT_NAME}/strategies/tags.hpp
${PROJECT_INCLUDE_DIR}/${PROJECT_NAME}/strategies/cartesian/length_pythagoras.hpp
)
add_custom_target(
${PROJECT_NAME}
COMMAND ""
SOURCES ${PROJECT_FILES}
)
######################
# Global variables #
######################
# Set install path
include(GNUInstallDirs)
set(CMAKE_INSTALL_CMAKEDIR ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake)
set(CMAKE_INSTALL_FULL_CMAKEDIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_CMAKEDIR})
# Build output directories
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(${PROJECT_NAME}_PACKAGING_ENABLED TRUE CACHE INTERNAL "")
else()
set(${PROJECT_NAME}_PACKAGING_ENABLED FALSE CACHE INTERNAL "")
endif()
#############
# Testing #
#############
enable_testing()
####################
# Subdirectories #
####################
add_subdirectory(share)
add_subdirectory(tests)
###############
# Packaging #
###############
# Following code is enabled only if BoostGeometryVector is the top level project
if(${PROJECT_NAME}_PACKAGING_ENABLED)
###############
# Packaging #
###############
# Package include directory
install(DIRECTORY
${PROJECT_INCLUDE_DIR}/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
COMPONENT dev
PATTERN "*~" EXCLUDE
PATTERN ".directory" EXCLUDE
)
###########
# CPack #
###########
find_package(Git)
if(GIT_FOUND)
execute_process(
COMMAND ${GIT_EXECUTABLE} describe --always --dirty
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE ${PROJECT_NAME}_VERSION_STRING
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string(FIND "${${PROJECT_NAME}_VERSION_STRING}" "${${PROJECT_NAME}_VERSION}" substring_found)
if(substring_found EQUAL -1)
message(FATAL_ERROR "Version mismatch: ${${PROJECT_NAME}_VERSION_STRING} != ${${PROJECT_NAME}_VERSION}")
endif()
else()
set(${PROJECT_NAME}_VERSION_STRING "v${${PROJECT_NAME}_VERSION}")
endif()
if(WIN32)
set(CPACK_GENERATOR "ZIP")
set(CPACK_SOURCE_GENERATOR "ZIP")
elseif(UNIX)
set(CPACK_GENERATOR "TGZ")
set(CPACK_SOURCE_GENERATOR "TGZ")
endif()
set(CPACK_COMPONENTS_ALL dev doc test)
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Boost.Geometry extension to support vector concept and algorithms.")
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE_1_0.txt")
set(CPACK_PACKAGE_VERSION_MAJOR ${${PROJECT_NAME}_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${${PROJECT_NAME}_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${${PROJECT_NAME}_PATCH})
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}_${${PROJECT_NAME}_VERSION_STRING}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}_${${PROJECT_NAME}_VERSION_STRING}-src")
set(CPACK_SOURCE_IGNORE_FILES "/build/;/install/;CMakeLists.txt.user;.git;.gitignore;.gitmodules;~$")
include(CPack)
endif()
mark_as_advanced(
CMAKE_CODEBLOCKS_EXECUTABLE
CMAKE_INSTALL_PREFIX
)