@@ -29,22 +29,24 @@ else()
2929 get_property (
3030 JRL_CMAKE_MODULES
3131 TARGET jrl-cmakemodules::jrl-cmakemodules
32- PROPERTY INTERFACE_INCLUDE_DIRECTORIES )
32+ PROPERTY INTERFACE_INCLUDE_DIRECTORIES
33+ )
3334 message (STATUS "JRL cmakemodules found on system at ${JRL_CMAKE_MODULES} " )
3435 elseif (${CMAKE_VERSION} VERSION_LESS "3.14.0" )
3536 message (
3637 FATAL_ERROR
37- "\n Can't find jrl-cmakemodules. Please either:\n "
38- " - use git submodule: 'git submodule update --init'\n "
39- " - or install https://github.com/jrl-umi3218/jrl-cmakemodules\n "
40- " - or upgrade your CMake version to >= 3.14 to allow automatic fetching\n "
38+ "\n Can't find jrl-cmakemodules. Please either:\n "
39+ " - use git submodule: 'git submodule update --init'\n "
40+ " - or install https://github.com/jrl-umi3218/jrl-cmakemodules\n "
41+ " - or upgrade your CMake version to >= 3.14 to allow automatic fetching\n "
4142 )
4243 else ()
4344 message (STATUS "JRL cmakemodules not found. Let's fetch it." )
4445 include (FetchContent)
4546 FetchContent_Declare(
4647 "jrl-cmakemodules"
47- GIT_REPOSITORY "https://github.com/jrl-umi3218/jrl-cmakemodules.git" )
48+ GIT_REPOSITORY "https://github.com/jrl-umi3218/jrl-cmakemodules.git"
49+ )
4850 FetchContent_MakeAvailable("jrl-cmakemodules" )
4951 FetchContent_GetProperties("jrl-cmakemodules" SOURCE_DIR JRL_CMAKE_MODULES)
5052 endif ()
@@ -76,51 +78,79 @@ if(POLICY CMP0177)
7678 set (CMAKE_POLICY_DEFAULT_CMP0177 NEW)
7779endif ()
7880include (${JRL_CMAKE_MODULES} /base.cmake)
79- compute_project_args (PROJECT_ARGS LANGUAGES CXX)
81+ COMPUTE_PROJECT_ARGS (PROJECT_ARGS LANGUAGES CXX)
8082project (${PROJECT_NAME} ${PROJECT_ARGS} )
8183
8284include (${JRL_CMAKE_MODULES} /ide.cmake)
8385include (${JRL_CMAKE_MODULES} /apple .cmake)
8486
8587if (NOT ${CMAKE_VERSION} VERSION_GREATER "3.26.0" OR WIN32 )
86- set (CMAKE_MODULE_PATH ${JRL_CMAKE_MODULES} /find -external/OpenMP
87- ${CMAKE_MODULE_PATH} )
88+ set (
89+ CMAKE_MODULE_PATH
90+ ${JRL_CMAKE_MODULES} /find -external/OpenMP
91+ ${CMAKE_MODULE_PATH}
92+ )
8893endif ()
8994include (${JRL_CMAKE_MODULES} /julia.cmake)
9095include (CMakeDependentOption)
9196
9297# If needed, set CMake policy for APPLE systems
93- apply_default_apple_configuration ()
94- set_default_cmake_build_type (Release)
98+ APPLY_DEFAULT_APPLE_CONFIGURATION ()
99+ SET_DEFAULT_CMAKE_BUILD_TYPE (Release)
95100
96101option (BUILD_PYTHON_INTERFACE "Build the Python bindings" OFF )
97102option (INITIALIZE_EIGEN_WITH_NAN "Initialize Eigen objects with NAN values" OFF )
98- option (CHECK_RUNTIME_MALLOC
99- "Check if some memory allocations are performed at runtime" OFF )
103+ option (
104+ CHECK_RUNTIME_MALLOC
105+ "Check if some memory allocations are performed at runtime"
106+ OFF
107+ )
100108option (SUFFIX_SO_VERSION "Suffix library name with its version" ON )
101109
102- option (BUILD_WITH_VECTORIZATION_SUPPORT
103- "Build the library with the support of modern SIMD instructions." ON )
104- option (BUILD_BINDINGS_WITH_AVX2_SUPPORT "Build the bindings with AVX2 support."
105- ON )
106- option (BUILD_BINDINGS_WITH_AVX512_SUPPORT
107- "Build the bindings with AVX512 support." ON )
110+ option (
111+ BUILD_WITH_VECTORIZATION_SUPPORT
112+ "Build the library with the support of modern SIMD instructions."
113+ ON
114+ )
115+ option (
116+ BUILD_BINDINGS_WITH_AVX2_SUPPORT
117+ "Build the bindings with AVX2 support."
118+ ON
119+ )
120+ option (
121+ BUILD_BINDINGS_WITH_AVX512_SUPPORT
122+ "Build the bindings with AVX512 support."
123+ ON
124+ )
108125option (TEST_JULIA_INTERFACE "Run the julia examples as unittest" OFF )
109- option (BUILD_WITH_OPENMP_SUPPORT "Build the library with the OpenMP support"
110- OFF )
126+ option (
127+ BUILD_WITH_OPENMP_SUPPORT
128+ "Build the library with the OpenMP support"
129+ OFF
130+ )
111131cmake_dependent_option(
112- LINK_PYTHON_INTERFACE_TO_OPENMP "Link OpenMP to the Python interface" ON
113- BUILD_WITH_OPENMP_SUPPORT OFF )
132+ LINK_PYTHON_INTERFACE_TO_OPENMP
133+ "Link OpenMP to the Python interface"
134+ ON
135+ BUILD_WITH_OPENMP_SUPPORT
136+ OFF
137+ )
114138
115139if (BUILD_WITH_OPENMP_SUPPORT)
116140 find_package (OpenMP REQUIRED)
117141 separate_arguments (OpenMP_CXX_FLAGS UNIX_COMMAND "${OpenMP_CXX_FLAGS} " )
118142endif (BUILD_WITH_OPENMP_SUPPORT)
119143
120- set (CMAKE_MODULE_PATH "${JRL_CMAKE_MODULES} /find-external/Julia"
121- ${CMAKE_MODULE_PATH} )
122- set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR} /cmake-external"
123- ${CMAKE_MODULE_PATH} )
144+ set (
145+ CMAKE_MODULE_PATH
146+ "${JRL_CMAKE_MODULES} /find-external/Julia"
147+ ${CMAKE_MODULE_PATH}
148+ )
149+ set (
150+ CMAKE_MODULE_PATH
151+ "${CMAKE_CURRENT_LIST_DIR} /cmake-external"
152+ ${CMAKE_MODULE_PATH}
153+ )
124154
125155message (STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR} " )
126156if (INITIALIZE_EIGEN_WITH_NAN)
@@ -134,7 +164,7 @@ endif(CHECK_RUNTIME_MALLOC)
134164
135165# set CXX standard
136166if (DEFINED CMAKE_CXX_STANDARD)
137- check_minimal_cxx_standard (14 ENFORCE)
167+ CHECK_MINIMAL_CXX_STANDARD (14 ENFORCE)
138168else ()
139169 set (CMAKE_CXX_STANDARD 17)
140170endif ()
@@ -147,14 +177,19 @@ if(MSVC)
147177endif ()
148178
149179# Look for dependencies
150- add_project_dependency (Eigen3 REQUIRED PKG_CONFIG_REQUIRES "eigen3 >= 3.0.5" )
180+ ADD_PROJECT_DEPENDENCY (Eigen3 REQUIRED PKG_CONFIG_REQUIRES "eigen3 >= 3.0.5" )
151181
152- set (SIMDE_HINT_FAILURE
153- "Set BUILD_WITH_VECTORIZATION_SUPPORT=OFF or install Simde on your system.\n If Simde is already installed, ensure that the CMake variable CMAKE_MODULE_PATH correctly points toward the location of FindSimde.cmake file."
182+ set (
183+ SIMDE_HINT_FAILURE
184+ "Set BUILD_WITH_VECTORIZATION_SUPPORT=OFF or install Simde on your system.\n If Simde is already installed, ensure that the CMake variable CMAKE_MODULE_PATH correctly points toward the location of FindSimde.cmake file."
154185)
155186if (BUILD_WITH_VECTORIZATION_SUPPORT)
156- add_project_dependency(Simde REQUIRED FIND_EXTERNAL "Simde"
157- PKG_CONFIG_REQUIRES "simde" )
187+ ADD_PROJECT_DEPENDENCY(
188+ Simde
189+ REQUIRED
190+ FIND_EXTERNAL "Simde"
191+ PKG_CONFIG_REQUIRES "simde"
192+ )
158193endif ()
159194
160195# Build the main library
@@ -165,29 +200,25 @@ if(MSVC)
165200 target_compile_options (proxsuite INTERFACE /permissive-)
166201 target_compile_options (proxsuite INTERFACE $<$<COMPILE_LANGUAGE:CXX>:/bigobj>)
167202endif (MSVC )
168- target_link_libraries (
169- proxsuite
170- PUBLIC
171- INTERFACE Eigen3::Eigen)
203+ target_link_libraries (proxsuite PUBLIC INTERFACE Eigen3::Eigen)
172204target_include_directories (
173- proxsuite INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR} /include>"
174- "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR} >" )
205+ proxsuite
206+ INTERFACE
207+ "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR} /include>"
208+ "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR} >"
209+ )
175210target_include_directories (
176- proxsuite INTERFACE "$<BUILD_INTERFACE:${PROJECT_BINARY_DIR} /include>" )
211+ proxsuite
212+ INTERFACE "$<BUILD_INTERFACE:${PROJECT_BINARY_DIR} /include>"
213+ )
177214set (EXPORTED_TARGETS_LIST proxsuite)
178215
179- add_header_group (${PROJECT_NAME} _HEADERS)
216+ ADD_HEADER_GROUP (${PROJECT_NAME} _HEADERS)
180217
181218if (BUILD_WITH_VECTORIZATION_SUPPORT)
182219 add_library (proxsuite-vectorized INTERFACE )
183- target_link_libraries (
184- proxsuite-vectorized
185- PUBLIC
186- INTERFACE proxsuite)
187- target_link_libraries (
188- proxsuite-vectorized
189- PUBLIC
190- INTERFACE simde)
220+ target_link_libraries (proxsuite-vectorized PUBLIC INTERFACE proxsuite)
221+ target_link_libraries (proxsuite-vectorized PUBLIC INTERFACE simde)
191222 target_compile_definitions (proxsuite-vectorized INTERFACE PROXSUITE_VECTORIZE)
192223 list (APPEND EXPORTED_TARGETS_LIST proxsuite-vectorized)
193224endif ()
@@ -202,7 +233,9 @@ if(BUILD_TESTING OR BUILD_PYTHON_INTERFACE)
202233 if (NOT EXISTS ${cereal} )
203234 execute_process (
204235 COMMAND ${GIT_EXECUTABLE} submodule update --init ${cereal_dir}
205- WORKING_DIRECTORY ${cereal_dir} COMMAND_ERROR_IS_FATAL ANY)
236+ WORKING_DIRECTORY ${cereal_dir}
237+ COMMAND_ERROR_IS_FATAL ANY
238+ )
206239 endif ()
207240 endif ()
208241endif ()
@@ -213,7 +246,8 @@ if(NOT PROXSUITE_AS_SUBPROJECT)
213246 EXPORT ${TARGETS_EXPORT_NAME}
214247 LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}
215248 ARCHIVE DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}
216- RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} )
249+ RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}
250+ )
217251endif (NOT PROXSUITE_AS_SUBPROJECT)
218252
219253add_subdirectory (bindings)
@@ -230,26 +264,33 @@ install(FILES package.xml DESTINATION share/${PROJECT_NAME})
230264file (
231265 WRITE
232266 ${CMAKE_CURRENT_BINARY_DIR} /share/ament_index/resource_index/packages/${PROJECT_NAME}
233- "" )
267+ ""
268+ )
234269install (
235270 FILES
236271 ${CMAKE_CURRENT_BINARY_DIR} /share/ament_index/resource_index/packages/${PROJECT_NAME}
237- DESTINATION share/ament_index/resource_index/packages)
272+ DESTINATION share/ament_index/resource_index/packages
273+ )
238274file (
239275 WRITE
240276 ${CMAKE_CURRENT_BINARY_DIR} /share/${PROJECT_NAME} /hook/ament_prefix_path.dsv
241- "prepend-non-duplicate;AMENT_PREFIX_PATH;" )
277+ "prepend-non-duplicate;AMENT_PREFIX_PATH;"
278+ )
242279install (
243280 FILES
244281 ${CMAKE_CURRENT_BINARY_DIR} /share/${PROJECT_NAME} /hook/ament_prefix_path.dsv
245- DESTINATION share/${PROJECT_NAME} /hook)
282+ DESTINATION share/${PROJECT_NAME} /hook
283+ )
246284if (BUILD_PYTHON_INTERFACE)
247- file (WRITE
248- ${CMAKE_CURRENT_BINARY_DIR} /share/${PROJECT_NAME} /hook/python_path.dsv
249- "prepend-non-duplicate;PYTHONPATH;${PYTHON_SITELIB} " )
285+ file (
286+ WRITE
287+ ${CMAKE_CURRENT_BINARY_DIR} /share/${PROJECT_NAME} /hook/python_path.dsv
288+ "prepend-non-duplicate;PYTHONPATH;${PYTHON_SITELIB} "
289+ )
250290 install (
251291 FILES ${CMAKE_CURRENT_BINARY_DIR} /share/${PROJECT_NAME} /hook/python_path.dsv
252- DESTINATION share/${PROJECT_NAME} /hook)
292+ DESTINATION share/${PROJECT_NAME} /hook
293+ )
253294endif (BUILD_PYTHON_INTERFACE)
254295
255- setup_project_finalize ()
296+ SETUP_PROJECT_FINALIZE ()
0 commit comments