@@ -27,14 +27,14 @@ if(NOT EXISTS "${CGAL_SOURCE_DIR}")
2727 ExternalProject_Add(
2828 cgal_download
2929 URL https://github.com/CGAL/cgal/releases/download/v6.0.1/CGAL-6.0.1.zip
30- SOURCE_DIR "${CGAL_SOURCE_DIR} "
30+ SOURCE_DIR "${CGAL_SOURCE_DIR} "
3131 CONFIGURE_COMMAND ""
32- BUILD_COMMAND ""
33- INSTALL_COMMAND ""
32+ BUILD_COMMAND ""
33+ INSTALL_COMMAND ""
3434 LOG_DOWNLOAD ON
35- UPDATE_COMMAND ""
36- PATCH_COMMAND ""
37- TLS_VERIFY ON
35+ UPDATE_COMMAND ""
36+ PATCH_COMMAND ""
37+ TLS_VERIFY ON
3838 )
3939 add_dependencies (external_downloads cgal_download)
4040endif ()
@@ -43,18 +43,18 @@ endif()
4343# BOOST
4444# ========================================================================
4545if (NOT EXISTS "${BOOST_SOURCE_DIR} " )
46- message (STATUS "Configuring Boost..." )
47- ExternalProject_Add(boost_download
48- URL https://archives.boost.io/release/1.82.0/source /boost_1_82_0.tar.gz
49- SOURCE_DIR "${BOOST_SOURCE_DIR} "
50- CONFIGURE_COMMAND ""
51- BUILD_COMMAND ""
52- INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory <SOURCE_DIR>/boost ${BOOST_SOURCE_DIR} /boost
53- LOG_DOWNLOAD
54- ON
55- )
56-
57- add_dependencies (external_downloads boost_download)
46+ message (STATUS "Configuring Boost..." )
47+ ExternalProject_Add(boost_download
48+ URL https://archives.boost.io/release/1.82.0/source /boost_1_82_0.tar.gz
49+ SOURCE_DIR "${BOOST_SOURCE_DIR} "
50+ CONFIGURE_COMMAND ""
51+ BUILD_COMMAND ""
52+ INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory <SOURCE_DIR>/boost ${BOOST_SOURCE_DIR} /boost
53+ LOG_DOWNLOAD
54+ ON
55+ )
56+
57+ add_dependencies (external_downloads boost_download)
5858endif ()
5959
6060# ========================================================================
@@ -65,13 +65,13 @@ if(NOT EXISTS "${EIGEN_SOURCE_DIR}")
6565 ExternalProject_Add(
6666 eigen_download
6767 URL https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz
68- SOURCE_DIR "${EIGEN_SOURCE_DIR} "
68+ SOURCE_DIR "${EIGEN_SOURCE_DIR} "
6969 CONFIGURE_COMMAND ""
70- BUILD_COMMAND ""
71- INSTALL_COMMAND ""
70+ BUILD_COMMAND ""
71+ INSTALL_COMMAND ""
7272 LOG_DOWNLOAD ON
73- UPDATE_COMMAND ""
74- PATCH_COMMAND ""
73+ UPDATE_COMMAND ""
74+ PATCH_COMMAND ""
7575 )
7676 add_dependencies (external_downloads eigen_download)
7777endif ()
@@ -95,12 +95,12 @@ include_directories(
9595)
9696
9797# Incase linking is not working check the includes
98- # add_compile_options(/showIncludes)
98+ # add_compile_options(/showIncludes)
9999
100100# Define libraries as header only
101101add_definitions (
102102 -DCGAL_HEADER_ONLY
103- -DBOOST_ALL_NO_LIB
103+ -DBOOST_ALL_NO_LIB
104104 -DBOOST_ALL_DYN_LINK=0
105105 -DCGAL_DISABLE_GMP
106106 -DCGAL_USE_BOOST_MP
@@ -121,9 +121,8 @@ set(CGAL_NT_USE_BOOST_MP ON CACHE BOOL "Use Boost Multiprecision")
121121# =====================================================================
122122# Binding
123123# =====================================================================
124-
125- if (NOT SKBUILD)
126- message (WARNING "\
124+ if (NOT SKBUILD)
125+ message (WARNING "\
127126 This CMake file is meant to be executed using 'scikit-build'. Running
128127 it directly will almost certainly not produce the desired result. If
129128 you are a user trying to install this package, please use the command
@@ -149,8 +148,8 @@ endif()
149148
150149# Try to import all Python components potentially needed by nanobind
151150find_package (Python 3.8
152- REQUIRED COMPONENTS Interpreter Development.Module
153- OPTIONAL_COMPONENTS Development.SABIModule)
151+ REQUIRED COMPONENTS Interpreter Development.Module
152+ OPTIONAL_COMPONENTS Development.SABIModule)
154153
155154# Import nanobind through CMake's find_package mechanism
156155find_package (nanobind CONFIG REQUIRED)
@@ -167,27 +166,28 @@ find_package(nanobind CONFIG REQUIRED)
167166# See: https://github.com/wjakob/nanobind/tree/master/tests
168167#
169168# Important: If you add a new .cpp file, you must rebuild the project with:
170- # pip install --no-build-isolation -ve . -Ceditable.rebuild=true
171- file (GLOB CPP_SOURCES
169+ # pip install --no-build-isolation -ve . -Ceditable.rebuild=true
170+ file (GLOB CPP_SOURCES
172171 CONFIGURE_DEPENDS
173172 "${CMAKE_CURRENT_SOURCE_DIR} /src/*.cpp"
174173)
175174
176175# Verify we found all expected source files and remind about type handling
177176message (STATUS "Found C++ source files (ensure proper type conversion in each):" )
177+
178178foreach (source ${CPP_SOURCES} )
179179 message (STATUS " ${source} " )
180180endforeach ()
181181
182182nanobind_add_module(
183- compas_cgal_ext
184- STABLE_ABI
185- NB_STATIC
186- ${CPP_SOURCES}
183+ compas_cgal_ext
184+ STABLE_ABI
185+ NB_STATIC
186+ ${CPP_SOURCES}
187187)
188188
189189# Set include directories for the extension
190- target_include_directories (compas_cgal_ext PRIVATE
190+ target_include_directories (compas_cgal_ext PRIVATE
191191 ${CGAL_INCLUDE_DIR}
192192 ${BOOST_INCLUDE_DIR}
193193 ${EIGEN_INCLUDE_DIR}
@@ -197,12 +197,12 @@ target_include_directories(compas_cgal_ext PRIVATE
197197add_dependencies (compas_cgal_ext external_downloads)
198198
199199# Enhanced PCH configuration
200- set (CMAKE_PCH_INSTANTIATE_TEMPLATES ON )
201- set (CMAKE_PCH_WARN_INVALID ON )
200+ set (CMAKE_PCH_INSTANTIATE_TEMPLATES OFF )
201+ set (CMAKE_PCH_WARN_INVALID OFF )
202202
203203# Configure PCH for the extension
204- target_precompile_headers(compas_cgal_ext
205- PRIVATE
204+ target_precompile_headers(compas_cgal_ext
205+ PRIVATE
206206 src/compas.h
207207)
208208
0 commit comments