3
3
cmake_minimum_required (VERSION 3.1)
4
4
5
5
set (PROJECT_NAME eigenpy_example_custom_numeric_type)
6
- set (PROJECT_DESCRIPTION "An example of using eigenpy with a custom numeric type: Boost.Multiprecision complex numbers" )
7
- set (PROJECT_URL "http://github.com/stack-of-tasks/eigenpy/examples/custom_numeric_type" )
6
+ set (PROJECT_DESCRIPTION
7
+ "An example of using eigenpy with a custom numeric type: Boost.Multiprecision complex numbers"
8
+ )
9
+ set (PROJECT_URL
10
+ "http://github.com/stack-of-tasks/eigenpy/examples/custom_numeric_type" )
8
11
set (PROJECT_USE_CMAKE_EXPORT TRUE )
9
12
set (PROJECT_USE_KEYWORD_LINK_LIBRARIES TRUE )
10
13
set (PROJECT_CUSTOM_HEADER_EXTENSION "hpp" )
11
14
set (PROJECT_COMPATIBILITY_VERSION AnyNewerVersion)
12
15
13
-
14
-
15
16
# Check if the submodule cmake have been initialized
16
17
set (JRL_CMAKE_MODULES "${CMAKE_CURRENT_LIST_DIR} /cmake" )
17
18
if (NOT EXISTS "${CMAKE_SOURCE_DIR} /cmake/base.cmake" )
@@ -31,7 +32,6 @@ if(NOT EXISTS "${CMAKE_SOURCE_DIR}/cmake/base.cmake")
31
32
endif ()
32
33
endif ()
33
34
34
-
35
35
# Disable -Werror on Unix for now.
36
36
set (CXX_DISABLE_WERROR True )
37
37
set (CMAKE_VERBOSE_MAKEFILE True )
@@ -41,29 +41,24 @@ option(SUFFIX_SO_VERSION "Suffix library name with its version" OFF)
41
41
42
42
if (DEFINED BUILD_UNIT_TESTS)
43
43
message (
44
- AUTHOR_WARNING
45
- "BUILD_UNIT_TESTS is deprecated. Use BUILD_TESTING instead." )
44
+ AUTHOR_WARNING "BUILD_UNIT_TESTS is deprecated. Use BUILD_TESTING instead." )
46
45
set (BUILD_TESTING ${BUILD_UNIT_TESTS} )
47
46
endif (DEFINED BUILD_UNIT_TESTS)
48
47
49
-
50
48
include ("${JRL_CMAKE_MODULES} /base.cmake" )
51
49
compute_project_args(PROJECT_ARGS LANGUAGES CXX)
52
50
project (${PROJECT_NAME} ${PROJECT_ARGS} )
53
51
54
-
55
52
include ("${JRL_CMAKE_MODULES} /boost.cmake" )
56
53
include ("${JRL_CMAKE_MODULES} /python.cmake" )
57
54
include ("${JRL_CMAKE_MODULES} /ide.cmake" )
58
55
include ("${JRL_CMAKE_MODULES} /apple.cmake" )
59
56
60
-
61
57
option (GENERATE_PYTHON_STUBS
62
58
"Generate the Python stubs associated to the Python library" OFF )
63
59
64
60
string (REPLACE "-pedantic" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} )
65
61
66
-
67
62
# If needed, fix CMake policy for APPLE systems
68
63
apply_default_apple_configuration()
69
64
check_minimal_cxx_standard(11 ENFORCE)
@@ -82,12 +77,10 @@ endif()
82
77
set (PYTHON_EXPORT_DEPENDENCY ON )
83
78
findpython(REQUIRED)
84
79
85
-
86
80
if (${NUMPY_VERSION} VERSION_LESS "1.16.0" )
87
81
set (NUMPY_WITH_BROKEN_UFUNC_SUPPORT TRUE )
88
82
endif ()
89
83
90
-
91
84
if (WIN32 )
92
85
link_directories (${PYTHON_LIBRARY_DIRS} )
93
86
# # Set default Windows build paths SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY
@@ -97,8 +90,6 @@ if(WIN32)
97
90
# ${PROJECT_BINARY_DIR}/Bin CACHE PATH "Sing$le directory for all archives")
98
91
endif (WIN32 )
99
92
100
-
101
-
102
93
# ----------------------------------------------------
103
94
# --- DEPENDENCIES -----------------------------------
104
95
# ----------------------------------------------------
@@ -110,28 +101,21 @@ export_boost_default_options()
110
101
find_package (Boost REQUIRED)
111
102
search_for_boost_python(REQUIRED)
112
103
113
-
114
104
# ----------------------------------------------------
115
105
# --- INCLUDE ----------------------------------------
116
106
# ----------------------------------------------------
117
- set (${PROJECT_NAME} _HEADERS
118
- include /header.hpp)
119
-
107
+ set (${PROJECT_NAME} _HEADERS include /header.hpp)
120
108
121
109
set (${PROJECT_NAME} _SOURCES src/src.cpp)
122
110
123
-
124
-
125
111
add_library (${PROJECT_NAME} SHARED ${${PROJECT_NAME} _SOURCES}
126
112
${${PROJECT_NAME} _HEADERS})
127
113
128
-
129
114
target_include_directories (
130
115
${PROJECT_NAME} SYSTEM
131
116
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR} /include >
132
117
$<INSTALL_INTERFACE:include >)
133
118
134
-
135
119
modernize_target_link_libraries(
136
120
${PROJECT_NAME}
137
121
SCOPE
@@ -141,7 +125,6 @@ modernize_target_link_libraries(
141
125
INCLUDE_DIRS
142
126
${EIGEN3_INCLUDE_DIR} )
143
127
144
-
145
128
modernize_target_link_libraries(
146
129
${PROJECT_NAME}
147
130
SCOPE
@@ -152,15 +135,10 @@ modernize_target_link_libraries(
152
135
${NUMPY_INCLUDE_DIRS}
153
136
${PYTHON_INCLUDE_DIR} )
154
137
155
-
156
-
157
138
if (SUFFIX_SO_VERSION)
158
139
set_target_properties (${PROJECT_NAME} PROPERTIES SOVERSION ${PROJECT_VERSION} )
159
140
endif (SUFFIX_SO_VERSION)
160
141
161
-
162
-
163
-
164
142
if (NOT WIN32 )
165
143
target_compile_options (
166
144
${PROJECT_NAME} PRIVATE $<$<CXX_COMPILER_ID:MSVC >:-bigobj>
@@ -214,13 +192,9 @@ install(
214
192
# ----------------------------------------------------
215
193
# --- PYTHON LIBRARY ---------------------------------
216
194
# ----------------------------------------------------
217
- #add_subdirectory(python)
195
+ # add_subdirectory(python)
218
196
219
197
pkg_config_append_libs(${PROJECT_NAME} )
220
198
pkg_config_append_cflags("-I${PYTHON_INCLUDE_DIRS} " )
221
199
pkg_config_append_cflags("-I${NUMPY_INCLUDE_DIRS} " )
222
200
pkg_config_append_boost_libs(${BOOST_COMPONENTS} )
223
-
224
-
225
-
226
-
0 commit comments