-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is preliminary - setting up to replace our copies of "ported" GTE algorithms with calls to the upstream copies directly. The key part of GTE for our use case is header only, so treating it like Eigen and staging it in noinstall.
- Loading branch information
1 parent
f39a5b0
commit b12f5a3
Showing
7 changed files
with
127 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Find GeometricTools Mathematics headers | ||
# | ||
# Once done this will define | ||
# | ||
# GTE_FOUND - system has GTE Mathematics headers | ||
# GTE_INCLUDE_DIR - the GTE include directory | ||
# | ||
# and the following imported target: | ||
# | ||
# GTE::GTE- Provides include dir for GeometricTools Mathematics headers | ||
|
||
set(_GTE_SEARCHES) | ||
|
||
# Search GTE_ROOT first if it is set. | ||
if(GTE_ROOT) | ||
set(_GTE_SEARCH_ROOT PATHS ${GTE_ROOT} NO_DEFAULT_PATH) | ||
list(APPEND _GTE_SEARCHES _GTE_SEARCH_ROOT) | ||
endif() | ||
|
||
# Try each search configuration. | ||
foreach(search ${_GTE_SEARCHES}) | ||
find_path(GTE_INCLUDE_DIR NAMES GTE/Mathematics/ConvexHull3.h ${${search}} PATH_SUFFIXES include) | ||
endforeach() | ||
|
||
mark_as_advanced(GTE_INCLUDE_DIR) | ||
|
||
# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if | ||
# all listed variables are TRUE | ||
include(FindPackageHandleStandardArgs) | ||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GTE REQUIRED_VARS GTE_INCLUDE_DIR) | ||
|
||
if(GTE_FOUND) | ||
set(GTE_INCLUDE_DIRS ${GTE_INCLUDE_DIR}) | ||
|
||
if(NOT TARGET GTE::GTE) | ||
add_library(GTE::GTE UNKNOWN IMPORTED) | ||
set_target_properties(GTE::GTE PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES "${GTE_INCLUDE_DIRS}") | ||
endif() | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Decide if we're using GeometricTools | ||
cad_enable(GTE "libbg") | ||
|
||
unset(ENGEN_BUNDLED CACHE) | ||
|
||
if (NOT ENABLE_GTE AND NOT DISABLE_GTE) | ||
|
||
# https://github.com/davideberly/GeometricTools | ||
find_package(GTE) | ||
|
||
if (NOT TARGET GTE::GTE) | ||
set(ENABLE_GTE "ON" CACHE BOOL "Enable GeometricTools build") | ||
endif (NOT TARGET GTE::GTE) | ||
|
||
endif (NOT ENABLE_GTE AND NOT DISABLE_GTE) | ||
|
||
set(ENABLE_GTE "${ENABLE_GTE}" CACHE BOOL "Enable GeometricTools build") | ||
|
||
# Decision made | ||
|
||
if (ENABLE_GTE) | ||
|
||
git_submodule_init(GeometricTools GTE/CMakeLists.txt) | ||
|
||
TargetDeps(GTE) | ||
|
||
ExternalProject_Add(GTE_BLD | ||
URL "${CMAKE_CURRENT_SOURCE_DIR}/GeometricTools" | ||
BUILD_ALWAYS ${EXT_BUILD_ALWAYS} ${LOG_OPTS} | ||
PATCH_COMMAND ${PATCH_EXECUTABLE};-E;-p1;${PATCH_OPTIONS};-i;${CMAKE_CURRENT_SOURCE_DIR}/gte.patch | ||
CMAKE_ARGS | ||
${BUILD_TYPE_SPECIFIER} | ||
-DCMAKE_INSTALL_PREFIX=${CMAKE_NOBUNDLE_INSTALL_PREFIX} | ||
LOG_CONFIGURE ${EXT_BUILD_QUIET} | ||
LOG_BUILD ${EXT_BUILD_QUIET} | ||
LOG_INSTALL ${EXT_BUILD_QUIET} | ||
LOG_OUTPUT_ON_FAILURE ${EXT_BUILD_QUIET} | ||
STEP_TARGETS install | ||
) | ||
|
||
TargetInstallDeps(GTE GTE_DEPENDS) | ||
|
||
set(GTE_BUNDLED TRUE CACHE BOOL "GeometricTools bundle flag") | ||
|
||
endif (ENABLE_GTE) | ||
|
||
# Local Variables: | ||
# tab-width: 8 | ||
# mode: cmake | ||
# indent-tabs-mode: t | ||
# End: | ||
# ex: shiftwidth=2 tabstop=8 | ||
|
Submodule GeometricTools
added at
435934
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PATCH | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
diff -Naur GeometricTools/CMakeLists.txt GTE_BLD/CMakeLists.txt | ||
--- GeometricTools/CMakeLists.txt 1969-12-31 19:00:00.000000000 -0500 | ||
+++ GTE_BLD/CMakeLists.txt 2024-07-31 16:48:17.163077007 -0400 | ||
@@ -0,0 +1,19 @@ | ||
+cmake_minimum_required(VERSION 3.8) | ||
+ | ||
+project(GTE) | ||
+ | ||
+file(GLOB GTE_MFILES "${CMAKE_SOURCE_DIR}/GTE/Mathematics/*") | ||
+ | ||
+if(NOT DEFINED INCLUDE_DIR) | ||
+ set(INCLUDE_DIR include) | ||
+endif(NOT DEFINED INCLUDE_DIR) | ||
+ | ||
+install(FILES ${GTE_MFILES} DESTINATION ${INCLUDE_DIR}/GTE/Mathematics) | ||
+ | ||
+# Local Variables: | ||
+# tab-width: 8 | ||
+# mode: cmake | ||
+# indent-tabs-mode: t | ||
+# End: | ||
+# ex: shiftwidth=2 tabstop=8 | ||
+ |