Skip to content

Commit

Permalink
Sync with dbfbeaa (v6.8.0) (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdumas authored Feb 8, 2023
1 parent b520676 commit 0f83ddf
Show file tree
Hide file tree
Showing 218 changed files with 11,628 additions and 3,417 deletions.
27 changes: 22 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ else()
endif()

# Check required CMake version
set(REQUIRED_CMAKE_VERSION "3.20.0")
set(REQUIRED_CMAKE_VERSION "3.24.0")
if(LAGRANGE_TOPLEVEL_PROJECT)
cmake_minimum_required(VERSION ${REQUIRED_CMAKE_VERSION})
else()
Expand All @@ -32,6 +32,7 @@ endif()
cmake_policy(SET CMP0054 NEW) # Only interpret if() arguments as variables or keywords when unquoted.
cmake_policy(SET CMP0076 NEW) # target_sources() command converts relative paths to absolute.
set(CMAKE_POLICY_DEFAULT_CMP0091 NEW) # MSVC runtime library flags are selected by an abstraction.
set(CMAKE_POLICY_DEFAULT_CMP0135 NEW) # Set the timestamps of all extracted contents to the time of the extraction.

# Include user-provided default options if available. We do that before the main
# `project()` so that we can define the C/C++ compilers from the option file.
Expand Down Expand Up @@ -66,7 +67,7 @@ endif()

# Set default macOS deployment target
if(LAGRANGE_TOPLEVEL_PROJECT)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14" CACHE STRING "Minimum OS X deployment version")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
endif()

################################################################################
Expand All @@ -82,7 +83,7 @@ else()
endif()

# Meta target: ALL includes all optional modules and UI.
option(LAGRANGE_ALL "Build all lagrange modules" OFF)
option(LAGRANGE_ALL "Build all lagrange modules" OFF)

# General CMake options
option(LAGRANGE_ASSERT_DEBUG_BREAK "Assert will break into debugger on failure" ${LAGRANGE_TOPLEVEL_PROJECT})
Expand Down Expand Up @@ -159,6 +160,11 @@ else()
endif()
set(LAGRANGE_IDE_PREFIX ${LAGRANGE_IDE_PREFIX_DEFAULT} CACHE STRING "Folder prefix for Lagrange targets in MSVC/Xcode")

# When building python module, compile TBB as a shared library
if(LAGRANGE_MODULE_PYTHON OR LAGRANGE_ALL)
option(TBB_PREFER_STATIC "Build with static TBB" OFF)
endif()

# When building anorigami module, defaults to pre-built Arpack and dynamic MKL/TBB
if(LAGRANGE_MODULE_ANORIGAMI OR (LAGRANGE_ALL AND NOT LAGRANGE_NO_INTERNAL))
set(MKL_LINKING "dynamic" CACHE STRING "Linking strategy to use with MKL (static, dynamic or sdl)")
Expand All @@ -168,10 +174,21 @@ endif()

# On Linux & Windows we use MKL to provide BLAS/LAPACK. Since it comes precompiled with /MD on Windows,
# we need to use the MSVC runtime library flag globally for the whole project.
if(LAGRANGE_TOPLEVEL_PROJECT AND NOT APPLE)
if(LAGRANGE_ALL OR LAGRANGE_MODULE_ANORIGAMI OR LAGRANGE_MODULE_DEFORMERS)
file(READ "cmake/lagrange/lagrangeMklModules.txt" LAGRANGE_MKL_MODULES)
if(LAGRANGE_TOPLEVEL_PROJECT)
if(LAGRANGE_ALL AND NOT LAGRANGE_NO_INTERNAL)
# Set MSVC runtime library globally for all targets
message(STATUS "Forcing /MD globally due to LAGRANGE_ALL requiring MKL")
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDLL" CACHE STRING "Select the MSVC runtime library")
else()
foreach(mkl_module_lc IN ITEMS ${LAGRANGE_MKL_MODULES})
string(TOUPPER ${mkl_module_lc} mkl_module_uc)
if(LAGRANGE_MODULE_${mkl_module_uc})
# Set MSVC runtime library globally for all targets
message(STATUS "Forcing /MD globally due to lagrange::${mkl_module_lc} requiring MKL")
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDLL" CACHE STRING "Select the MSVC runtime library")
endif()
endforeach()
endif()
endif()

Expand Down
2 changes: 2 additions & 0 deletions LagrangeOptions.cmake.sample
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@
# option(LAGRANGE_MODULE_PARTITIONING "Build module lagrange::partitioning" ON)
# option(LAGRANGE_MODULE_PYTHON "Build module lagrange::python" ON)
# option(LAGRANGE_MODULE_RAYCASTING "Build module lagrange::raycasting" ON)
# option(LAGRANGE_MODULE_SCENE "Build module lagrange::scene" ON)
# option(LAGRANGE_MODULE_SUBDIVISION "Build module lagrange::subdivision" ON)
# option(LAGRANGE_MODULE_UI "Build module lagrange::ui" ON)
# option(LAGRANGE_MODULE_VOLUME "Build module lagrange::volume" ON)
# option(LAGRANGE_MODULE_WINDING "Build module lagrange::winding" ON)

# General options
# option(LAGRANGE_DOCUMENTATION "Build Doxygen documentation" ON)
Expand Down
49 changes: 49 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,55 @@ Lagrange
========
The following is a list of sources from which code was used/modified in this codebase.

-------------------------------------------------------------------------------
This codebase contains a modified portion of code from Boost.Functional/Hash which can be obtained at:
* SOURCE:
* https://www.boost.org/doc/libs/1_64_0/boost/functional/hash/hash.hpp

* LICENSE:
* https://www.boost.org/LICENSE_1_0.txt

-------------------------------------------------------------------------------
This codebase contains a modified portion of code from Christer Ericson, Real-Time Collision Detection which can be obtained at:
* SOURCE:
* https://doi.org/10.1201/b14581

* LICENSE:
This project contains code adapted from Real-Time Collision Detection by Christer
Ericson, published by Morgan Kaufmann Publishers, (c) 2005 Elsevier Inc. Usage is
governed by the following license.

Software License Agreement

This Software License Agreement is a legal agreement between the Author and any person
or legal entity using or accepting any software governed by this Agreement. The software
is available on the CD-ROM in the Book, Real-Time Collision Detection, which is
published by Morgan Kaufmann Publishers. "The software" is comprised of all code
(fragments and pseudocode) presented in the book. No additional files are on the CD-ROM.

By installing, copying, or otherwise using the software, you agree to be bound by the
terms of this Agreement.

The parties agree as follows:

1. Grant of License. We grant you a nonexclusive license to use the software for any
purpose, commercial or non-commercial, as long as the following credit is included
identifying the original source of the software: "from Real-Time Collision Detection by
Christer Ericson, published by Morgan Kaufmann Publishers, (c) 2005 Elsevier Inc".

2. Disclaimer of Warranty. We make no warranties at all.The software is transferred to
you on an "as is" basis. You use the software at your own peril. You assume all risk of
loss for all claims or controversies, now existing or hereafter, arising out of use of
the software. We shall have no liability based on a claim that your use or combination
of the software with products or data not supplied by us infringes any patent,
copyright, or proprietary right. All other warranties, expressed or implied, including,
without limitation, any warranty of merchantability or fitness for a particular purpose
are hereby excluded.

3. Limitation of Liability. We will have no liability for special, incidental or
consequential damages even if advised of the possibility of such damages. We will not be
liable for any other damages or loss in any way connected with the software.

-------------------------------------------------------------------------------
This codebase contains a modified portion of code from CMake Scripts which can be obtained at:
* SOURCE:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.7.0
6.8.0
1 change: 1 addition & 0 deletions cmake/lagrange/lagrangeMklModules.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
anorigami;deformers
2 changes: 2 additions & 0 deletions cmake/lagrange/lagrange_add_module.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ function(lagrange_add_module)
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)

target_compile_features(lagrange_${module_name} ${module_scope} cxx_std_17)

# Target sources
file(GLOB_RECURSE INC_FILES "include/*.h")
file(GLOB_RECURSE SRC_FILES "src/*.cpp")
Expand Down
2 changes: 1 addition & 1 deletion cmake/lagrange/lagrange_download_data.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function(lagrange_download_data)
PREFIX "${FETCHCONTENT_BASE_DIR}/lagrange-test-data"
SOURCE_DIR ${LAGRANGE_DATA_FOLDER}
GIT_REPOSITORY https://github.com/adobe/lagrange-test-data.git
GIT_TAG 8f90b3ec4c9616d6d92a0df397ee01aa7882fe0d
GIT_TAG d78861e85da84b341e86bbdc3fb0d4d2ddde6394
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
Expand Down
2 changes: 1 addition & 1 deletion cmake/lagrange/lagrange_has_onetbb.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2020 Adobe. All rights reserved.
# Copyright 2022 Adobe. All rights reserved.
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
Expand Down
2 changes: 1 addition & 1 deletion cmake/recipes/external/assimp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ include(FetchContent)
FetchContent_Declare(
assimp
GIT_REPOSITORY https://github.com/assimp/assimp.git
GIT_TAG ed8612ea356021080898ea2378f0b545431ccae3
GIT_TAG 0fdae2879d78864693ee730610dcf8ee10707875
)

option(BUILD_SHARED_LIBS "Build package with shared libraries." OFF)
Expand Down
11 changes: 11 additions & 0 deletions cmake/recipes/external/blas.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
#
# Copyright 2022 Adobe. All rights reserved.
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
# OF ANY KIND, either express or implied. See the License for the specific language
# governing permissions and limitations under the License.
#
if(TARGET BLAS::BLAS)
return()
endif()
Expand Down
2 changes: 1 addition & 1 deletion cmake/recipes/external/embree.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2022 Adobe. All rights reserved.
# Copyright 2019 Adobe. All rights reserved.
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
Expand Down
5 changes: 2 additions & 3 deletions cmake/recipes/external/filesystem.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
# OF ANY KIND, either express or implied. See the License for the specific language
# governing permissions and limitations under the License.
#
if(TARGET filesystem::filesystem)
if(TARGET ghcFilesystem::ghc_filesystem)
return()
endif()

message(STATUS "Third-party (external): creating target 'filesystem::filesystem'")
message(STATUS "Third-party (external): creating target 'ghcFilesystem::ghc_filesystem'")

include(FetchContent)
FetchContent_Declare(
Expand All @@ -24,4 +24,3 @@ FetchContent_Declare(
FetchContent_MakeAvailable(filesystem)

target_compile_definitions(ghc_filesystem INTERFACE GHC_WIN_WSTRING_STRING_TYPE)
add_library(filesystem::filesystem ALIAS ghc_filesystem)
42 changes: 42 additions & 0 deletions cmake/recipes/external/happly.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#
# Copyright 2023 Adobe. All rights reserved.
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
# OF ANY KIND, either express or implied. See the License for the specific language
# governing permissions and limitations under the License.
#
if(TARGET happly::happly)
return()
endif()

message(STATUS "Third-party (external): creating target 'happly::happly'")

include(FetchContent)
FetchContent_Declare(
happly
GIT_REPOSITORY https://github.com/nmwsharp/happly.git
GIT_TAG cfa2611550bc7da65855a78af0574b65deb81766
)
FetchContent_MakeAvailable(happly)

# Define happly library
add_library(happly INTERFACE ${happly_SOURCE_DIR}/happly.h)
add_library(happly::happly ALIAS happly)

include(GNUInstallDirs)
target_include_directories(happly INTERFACE
$<BUILD_INTERFACE:${happly_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)

set_target_properties(happly PROPERTIES FOLDER third_party)

# Install rules
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME happly)
install(DIRECTORY ${happly_SOURCE_DIR} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(TARGETS happly EXPORT Happly_Targets)
install(EXPORT Happly_Targets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/happly NAMESPACE happly::)
11 changes: 11 additions & 0 deletions cmake/recipes/external/lapack.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
#
# Copyright 2022 Adobe. All rights reserved.
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
# OF ANY KIND, either express or implied. See the License for the specific language
# governing permissions and limitations under the License.
#
if(TARGET LAPACK::LAPACK)
return()
endif()
Expand Down
2 changes: 2 additions & 0 deletions cmake/recipes/external/mikktspace.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ FetchContent_MakeAvailable(mikktspace)
add_library(mikktspace ${mikktspace_SOURCE_DIR}/mikktspace.c)
add_library(mikktspace::mikktspace ALIAS mikktspace)
target_include_directories(mikktspace PUBLIC ${mikktspace_SOURCE_DIR})

set_target_properties(mikktspace PROPERTIES FOLDER third_party)
2 changes: 1 addition & 1 deletion cmake/recipes/external/nanobind.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ include(FetchContent)
FetchContent_Declare(
nanobind
GIT_REPOSITORY https://github.com/wjakob/nanobind.git
GIT_TAG 42db2fdb3292c6851d68d4a56f48e2031666173f
GIT_TAG v0.1.0
)

include(python)
Expand Down
2 changes: 1 addition & 1 deletion cmake/recipes/external/opensubdiv.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ include(FetchContent)
FetchContent_Declare(
opensubdiv
GIT_REPOSITORY https://github.com/PixarAnimationStudios/OpenSubdiv.git
GIT_TAG tags/v3_4_0
GIT_TAG tags/v3_4_4
GIT_SHALLOW TRUE
)

Expand Down
18 changes: 15 additions & 3 deletions cmake/recipes/external/openvdb.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,15 @@ FetchContent_Declare(
GIT_TAG v10.0.0
)

option(OPENVDB_CORE_SHARED "" OFF)
option(OPENVDB_CORE_STATIC "" ON)
if(WIN32)
# On Windows, prefer shared lib for OpenVDB, otherwise we can run into
# linking error LNK1248 in Debug mode (due to lib size exceeding 4GB).
option(OPENVDB_CORE_SHARED "" ON)
option(OPENVDB_CORE_STATIC "" OFF)
else()
option(OPENVDB_CORE_SHARED "" OFF)
option(OPENVDB_CORE_STATIC "" ON)
endif()
option(OPENVDB_BUILD_CORE "" ON)
option(OPENVDB_BUILD_BINARIES "" OF)
option(OPENVDB_ENABLE_RPATH "" OFF)
Expand Down Expand Up @@ -135,4 +142,9 @@ endfunction()
# Call via a proper function in order to scope variables such as CMAKE_FIND_PACKAGE_PREFER_CONFIG and TBB_DIR
openvdb_import_target()

set_target_properties(openvdb_static PROPERTIES FOLDER third_party)
# Set folders for MSVC
foreach(name IN ITEMS openvdb_static openvdb_shared)
if(TARGET ${name})
set_target_properties(${name} PROPERTIES FOLDER third_party)
endif()
endforeach()
2 changes: 1 addition & 1 deletion cmake/recipes/external/spdlog.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ include(FetchContent)
FetchContent_Declare(
spdlog
GIT_REPOSITORY https://github.com/gabime/spdlog.git
GIT_TAG v1.9.2
GIT_TAG v1.10.0
)

option(SPDLOG_INSTALL "Generate the install target" ON)
Expand Down
36 changes: 36 additions & 0 deletions cmake/recipes/external/tinygltf.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#
# Copyright 2022 Adobe. All rights reserved.
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
# OF ANY KIND, either express or implied. See the License for the specific language
# governing permissions and limitations under the License.
#
if(TARGET tinygltf::tinygltf)
return()
endif()

message(STATUS "Third-party (external): creating target 'tinygltf::tinygltf'")

include(FetchContent)
FetchContent_Declare(
tinygltf
GIT_REPOSITORY https://github.com/syoyo/tinygltf.git
GIT_TAG v2.7.0
GIT_SHALLOW TRUE
)

option(TINYGLTF_BUILD_LOADER_EXAMPLE "Build loader_example(load glTF and dump infos)" OFF)
option(TINYGLTF_BUILD_GL_EXAMPLES "Build GL exampels(requires glfw, OpenGL, etc)" OFF)
option(TINYGLTF_BUILD_VALIDATOR_EXAMPLE "Build validator exampe" OFF)
option(TINYGLTF_BUILD_BUILDER_EXAMPLE "Build glTF builder example" OFF)
option(TINYGLTF_HEADER_ONLY "On: header-only mode. Off: create tinygltf library(No TINYGLTF_IMPLEMENTATION required in your project)" OFF)
option(TINYGLTF_INSTALL "Install tinygltf files during install step. Usually set to OFF if you include tinygltf through add_subdirectory()" ON)
FetchContent_MakeAvailable(tinygltf)

set_target_properties(tinygltf PROPERTIES FOLDER third_party)

add_library(tinygltf::tinygltf ALIAS tinygltf)
2 changes: 1 addition & 1 deletion cmake/recipes/external/winding_number.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2022 Adobe. All rights reserved.
# Copyright 2021 Adobe. All rights reserved.
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
Expand Down
Loading

0 comments on commit 0f83ddf

Please sign in to comment.