Skip to content

Commit

Permalink
Merge branch 'main' into RELEASE
Browse files Browse the repository at this point in the history
  • Loading branch information
starseeker committed Aug 24, 2024
2 parents cef79c3 + 485cc71 commit c7be60c
Show file tree
Hide file tree
Showing 85 changed files with 8,613 additions and 120 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ jobs:
- name: Configure
run: |
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
cmake -S . -G Ninja -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Debug
# We're running into disk space issues with the Linux debug build, so turn off GDAL
cmake -S . -G Ninja -B build -DENABLE_ALL=ON -DGIT_SHALLOW_CLONE=ON -DCMAKE_BUILD_TYPE=Debug -DUSE_GDAL=OFF
- name: Build
run: |
Expand Down
8 changes: 8 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -304,3 +304,11 @@
url = https://github.com/BRL-CAD/geogram.git
branch = RELEASE
ignore = dirty
[submodule "gte/GeometricTools"]
path = gte/GeometricTools
url = https://github.com/BRL-CAD/GeometricTools
ignore = dirty
[submodule "mmesh/mmesh"]
path = mmesh/mmesh
url = https://github.com/BRL-CAD/mmesh.git
ignore = dirty
82 changes: 82 additions & 0 deletions CMake/FindGTE.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# F I N D G T E . C M A K E
# BRL-CAD
#
# Copyright (c) 2024 United States Government as represented by
# the U.S. Army Research Laboratory.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
#
# 3. The name of the author may not be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
###
# 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 Mathematics/ConvexHull3.h ${${search}} PATH_SUFFIXES include include/GTE)
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()

# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
94 changes: 94 additions & 0 deletions CMake/FindMMESH.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

#[=======================================================================[.rst:
FindMMESH
--------
Find the native MMESH includes and library.
IMPORTED Targets
^^^^^^^^^^^^^^^^
This module defines :prop_tgt:`IMPORTED` target ``MMESH::MMESH``, if
MMESH has been found.
Result Variables
^^^^^^^^^^^^^^^^
This module defines the following variables:
::
MMESH_INCLUDE_DIRS - where to find mmesh.h, etc.
MMESH_LIBRARIES - List of libraries when using openNURBS.
MMESH_FOUND - True if openNURBS found.
Hints
^^^^^
A user may set ``MMESH_ROOT`` to a openNURBS installation root to tell this
module where to look.
#]=======================================================================]

set(_MMESH_SEARCHES)

# Search MMESH_ROOT first if it is set.
if(MMESH_ROOT)
set(_MMESH_SEARCH_ROOT PATHS ${MMESH_ROOT} NO_DEFAULT_PATH)
list(APPEND _MMESH_SEARCHES _MMESH_SEARCH_ROOT)
endif()

set(MMESH_NAMES mmesh OSMesa)

# Try each search configuration.
foreach(search ${_MMESH_SEARCHES})
find_path(MMESH_INCLUDE_DIR NAMES meshdecimation.h ${${search}} PATH_SUFFIXES include/mmesh mmesh)
endforeach()

# Allow MMESH_LIBRARY to be set manually, as the location of the openNURBS library
if(NOT MMESH_LIBRARY)
foreach(search ${_MMESH_SEARCHES})
find_library(MMESH_LIBRARY NAMES ${MMESH_NAMES} NAMES_PER_DIR ${${search}} PATH_SUFFIXES lib)
endforeach()
endif()

unset(MMESH_NAMES)

mark_as_advanced(MMESH_INCLUDE_DIR)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MMESH REQUIRED_VARS MMESH_LIBRARY MMESH_INCLUDE_DIR)

if(MMESH_FOUND)
set(MMESH_INCLUDE_DIRS ${MMESH_INCLUDE_DIR})

if(NOT MMESH_LIBRARIES)
set(MMESH_LIBRARIES ${MMESH_LIBRARY})
endif()

if(NOT TARGET MMESH::MMESH)
add_library(MMESH::MMESH UNKNOWN IMPORTED)
set_target_properties(MMESH::MMESH PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${MMESH_INCLUDE_DIRS}")

if(MMESH_LIBRARY_RELEASE)
set_property(TARGET MMESH::MMESH APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(MMESH::MMESH PROPERTIES
IMPORTED_LOCATION_RELEASE "${MMESH_LIBRARY_RELEASE}")
endif()

if(MMESH_LIBRARY_DEBUG)
set_property(TARGET MMESH::MMESH APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(MMESH::MMESH PROPERTIES
IMPORTED_LOCATION_DEBUG "${MMESH_LIBRARY_DEBUG}")
endif()

if(NOT MMESH_LIBRARY_RELEASE AND NOT MMESH_LIBRARY_DEBUG)
set_property(TARGET MMESH::MMESH APPEND PROPERTY
IMPORTED_LOCATION "${MMESH_LIBRARY}")
endif()
endif()
endif()
40 changes: 40 additions & 0 deletions CMake/FindPOISSONRECON.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Find Adaptive Multigrid Solver headers for Poisson Surface Reconstruction
#
# Once done this will define
#
# POISSONRECON_FOUND - system has Adaptive Multigrid Solver headers
# POISSONRECON_INCLUDE_DIR - the Adaptive Multigrid Solver include directory
#
# and the following imported target:
#
# POISSONRECON::POISSONRECON- Provides include dir for headers

set(_POISSONRECON_SEARCHES)

# Search POISSONRECON_ROOT first if it is set.
if(POISSONRECON_ROOT)
set(_POISSONRECON_SEARCH_ROOT PATHS ${POISSONRECON_ROOT} NO_DEFAULT_PATH)
list(APPEND _POISSONRECON_SEARCHES _POISSONRECON_SEARCH_ROOT)
endif()

# Try each search configuration.
foreach(search ${_POISSONRECON_SEARCHES})
find_path(POISSONRECON_INCLUDE_DIR NAMES SPSR/Reconstructors.h ${${search}} PATH_SUFFIXES include)
endforeach()

mark_as_advanced(POISSONRECON_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(POISSONRECON REQUIRED_VARS POISSONRECON_INCLUDE_DIR)

if(POISSONRECON_FOUND)
set(POISSONRECON_INCLUDE_DIRS ${POISSONRECON_INCLUDE_DIR})

if(NOT TARGET POISSONRECON::POISSONRECON)
add_library(POISSONRECON::POISSONRECON UNKNOWN IMPORTED)
set_target_properties(POISSONRECON::POISSONRECON PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${POISSONRECON_INCLUDE_DIRS}")
endif()
endif()
40 changes: 32 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ endif(CMAKE_CONFIGURATION_TYPES)
mark_as_advanced(CMAKE_BUILD_TYPE)
mark_as_advanced(CMAKE_CONFIGURATION_TYPES)

#------------------------------------------------------------------------------
# Once we do a run, we want our ENABLE_ALL setting to be consistent in
# subsequent CMake runs
if (ENABLE_ALL)
set(ENABLE_ON "ON" CACHE BOOL "Enable all local versions of packages")
else (ENABLE_ALL)
set(ENABLE_ON "OFF" CACHE BOOL "Prefer system versions of packages")
endif (ENABLE_ALL)

#------------------------------------------------------------------------------
# We do NOT want CMake looking in the User Package Registry - have encountered
# at least one case where stale or incorrect information there has resulted in
Expand Down Expand Up @@ -239,23 +248,29 @@ macro(TargetVars roots)
endforeach(root ${${roots}})
endmacro(TargetVars root)

macro(TargetDeps proot)

###
# Loads dependencies from an in-src file named same as containing
# directory with .deps suffix. Dependencies are added to the
# corresponding ${proot}_DEPENDS variable.
#
# FIXME: Dependencies are also added here to a .dot file dependency
# graph file, but that shouldn't be intertwined here as side effect.
###
macro(RegisterDeps proot)
get_filename_component(dirname ${CMAKE_CURRENT_SOURCE_DIR} NAME)
if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dirname}.deps")
message(FATAL_ERROR "No ${dirname}.deps file found in ${CMAKE_CURRENT_SOURCE_DIR}/")
endif (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dirname}.deps")
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/${dirname}.deps" DEP_LINES)
string(TOLOWER "${proot}" lr)

# Add each dependency to this directory's _DEPENDS list
foreach(dl ${DEP_LINES})
set(${proot}_DEPENDS ${${proot}_DEPENDS} ${dl})
string(TOLOWER "${dl}" ldl)
# Add the dependency to the dot file
if (NOT "${ldl}" STREQUAL "patch")
file(APPEND "${CMAKE_BINARY_DIR}/bext.dot" "\t${lr} -> ${ldl};\n")
endif (NOT "${ldl}" STREQUAL "patch")
endforeach(dl ${DEP_LINES})

# Add these dependencies to the global list
# Add all dependencies to the global ALL_DEPENDENCIES list
get_property(ALL_DEPS GLOBAL PROPERTY ALL_DEPENDENCIES)
set(ALL_DEPS ${ALL_DEPS} ${${proot}_DEPENDS})
list(SORT ALL_DEPS)
Expand All @@ -264,7 +279,16 @@ macro(TargetDeps proot)

# Set the TARGET variables for CMake generator expression "if" tests
TargetVars(${proot}_DEPENDS)
endmacro(TargetDeps)

# Add each dependency to a global .dot file
foreach(dl ${DEP_LINES})
string(TOLOWER "${dl}" ldl)
if (NOT "${ldl}" STREQUAL "patch")
file(APPEND "${CMAKE_BINARY_DIR}/bext.dot" "\t${lr} -> ${ldl};\n")
endif (NOT "${ldl}" STREQUAL "patch")
endforeach(dl ${DEP_LINES})

endmacro(RegisterDeps)

macro(TargetInstallDeps croot roots)
foreach(root ${${roots}})
Expand Down
2 changes: 1 addition & 1 deletion NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ if (ENABLE_GEOGRAM)
git_submodule_init(geogram CMakeLists.txt)
TargetDeps(GEOGRAM)
RegisterDeps(GEOGRAM)
ExternalProject_Add(GEOGRAM_BLD
URL "${CMAKE_CURRENT_SOURCE_DIR}/geogram"
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ A complete ENABLE_ALL build of all components in this repository is a *very* lar
* USE_APPLESEED - Physically-based global illumination rendering engine
* USE_OSPRAY - Intel high performance ray tracing engine

(For BRL-CAD components specifically, a more nuanced enable/disable decision can be made if the BRLCAD_COMPONENTS variable is set. If the parent BRL-CAD build is only building a subset of the BRL-CAD target set, no all dependencies will be needed.)
(For BRL-CAD components specifically, a more nuanced enable/disable decision can be made if the BRLCAD_COMPONENTS variable is set. If the parent BRL-CAD build is only building a subset of the BRL-CAD target set, not all dependencies will be needed.)

# Using the Build Outputs with BRL-CAD

Expand Down Expand Up @@ -87,8 +87,7 @@ In broad, the structure of the source tree is two tiered - the top level directo
* A <dirname>.deps file identifying a project's dependencies on other bext projects
* Any patch files or other supporting resources not part of the upstream tree

Sometimes third party libraries will depend on other third party libraries (for example, libpng's use of zlib) - when a bundled component that is a dependency of other bundled projects is enabled, the expectation is that the other bundled
components will use our copy rather than system copies of those libraries.
Sometimes third party libraries will depend on other third party libraries (for example, libpng's use of zlib) - when a bundled component that is a dependency of other bundled projects is enabled, the expectation is that the other bundled components will use our copy rather than system copies of those libraries.

# Compilation-Only Tools

Expand Down
2 changes: 1 addition & 1 deletion appleseed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if (ENABLE_APPLESEED)

git_submodule_init(appleseed CMakeLists.txt)

TargetDeps(APPLESEED)
RegisterDeps(APPLESEED)
if (TARGET ZLIB_BLD)
set(Z_PREFIX_STR "brl_")
endif (TARGET ZLIB_BLD)
Expand Down
2 changes: 1 addition & 1 deletion assetimport/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if (ENABLE_ASSETIMPORT)

git_submodule_init(assimp CMakeLists.txt)

TargetDeps(ASSETIMPORT)
RegisterDeps(ASSETIMPORT)
if (TARGET ZLIB_BLD)
set(ZLIB_TARGET ZLIB_BLD)
endif (TARGET ZLIB_BLD)
Expand Down
11 changes: 11 additions & 0 deletions assetimport/assetimport.patch
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
diff -Naur assimp/CMakeLists.txt ASSETIMPORT_BLD/CMakeLists.txt
--- assimp/CMakeLists.txt 2024-08-22 16:04:35.540387715 -0400
+++ ASSETIMPORT_BLD/CMakeLists.txt 2024-08-22 16:05:12.765176737 -0400
@@ -37,6 +37,7 @@
SET(CMAKE_POLICY_DEFAULT_CMP0012 NEW)
SET(CMAKE_POLICY_DEFAULT_CMP0074 NEW)
SET(CMAKE_POLICY_DEFAULT_CMP0092 NEW)
+SET(CMAKE_POLICY_DEFAULT_CMP0144 NEW)

CMAKE_MINIMUM_REQUIRED( VERSION 3.22 )

diff -Naur ASSETIMPORT/cmake-modules/FindZLIB.cmake ASSETIMPORT_BLD/cmake-modules/FindZLIB.cmake
--- ASSETIMPORT/cmake-modules/FindZLIB.cmake 2024-06-25 10:10:10.163683303 -0400
+++ ASSETIMPORT_BLD/cmake-modules/FindZLIB.cmake 2024-06-25 10:08:14.147412121 -0400
Expand Down
2 changes: 1 addition & 1 deletion astyle/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if (ENABLE_ASTYLE)

git_submodule_init(astyle CMakeLists.txt)

TargetDeps(ASTYLE)
RegisterDeps(ASTYLE)

ExternalProject_Add(ASTYLE_BLD
URL "${CMAKE_CURRENT_SOURCE_DIR}/astyle"
Expand Down
2 changes: 1 addition & 1 deletion boost/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if (ENABLE_BOOST)

git_submodule_init(boost CMakeLists.txt)

TargetDeps(BOOST)
RegisterDeps(BOOST)

if (TARGET ZLIB_BLD)
set(Z_PREFIX_STR "brl_")
Expand Down
2 changes: 1 addition & 1 deletion deflate/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if (ENABLE_DEFLATE)

git_submodule_init(libdeflate CMakeLists.txt)

TargetDeps(DEFLATE)
RegisterDeps(DEFLATE)

ExternalProject_Add(DEFLATE_BLD
URL "${CMAKE_CURRENT_SOURCE_DIR}/libdeflate"
Expand Down
Loading

0 comments on commit c7be60c

Please sign in to comment.