Skip to content

Commit ced6e05

Browse files
authored
Sync with 2b95866 (#81)
1 parent 5b7deeb commit ced6e05

17 files changed

Lines changed: 221 additions & 48 deletions

File tree

.github/.git_archival.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node: $Format:%H$
2+
node-date: $Format:%cI$
3+
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$

.github/workflows/continuous.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,11 @@ jobs:
6464
6565
- name: Checkout repository
6666
uses: actions/checkout@v4
67+
# Note: Update to actions/checkout@6 once 6.0.2 is out, and remove the fetch-depth: 0
68+
# https://github.com/actions/checkout/issues/1471
6769
with:
68-
fetch-depth: 10
70+
fetch-tags: true
71+
fetch-depth: 0
6972

7073
- name: Install Ninja
7174
uses: seanmiddleditch/gha-setup-ninja@master
@@ -171,7 +174,8 @@ jobs:
171174
- name: Checkout repository
172175
uses: actions/checkout@v4
173176
with:
174-
fetch-depth: 10
177+
fetch-tags: true
178+
fetch-depth: 0
175179

176180
- uses: actions/setup-python@v5
177181
with:

.github/workflows/wheel.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ jobs:
2121
steps:
2222
- name: Checkout
2323
uses: actions/checkout@v4
24+
with:
25+
fetch-tags: true
26+
fetch-depth: 0
2427

2528
- name: Setup Xcode version
2629
if: matrix.os == 'macos-15-intel'

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ __pycache__
3232
# Python folders
3333
*.egg-info
3434

35-
# Nightly version file
36-
/VERSION_NIGHTLY
35+
# Python version file
36+
modules/python/lagrange/_version.py
3737

3838
# Lock files
3939
uv.lock

CMakeLists.txt

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,27 @@ if(LAGRANGE_TOPLEVEL_PROJECT AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
103103
endif()
104104

105105
################################################################################
106-
file(READ "VERSION" lagrange_version)
107-
string(STRIP ${lagrange_version} lagrange_version)
106+
107+
if(SKBUILD)
108+
# Version number dictated by setuptools_scm
109+
set(lagrange_version ${SKBUILD_PROJECT_VERSION})
110+
else()
111+
# Set ${lagrange_version} according to git tag
112+
include(cmake/lagrange/lagrange_cpm_cache.cmake)
113+
include(cmake/recipes/external/DynamicVersion.cmake)
114+
dynamic_version(
115+
PROJECT_PREFIX Lagrange_
116+
OUTPUT_VERSION lagrange_version
117+
VERSION_FULL_MODE POST
118+
GIT_ARCHIVAL_FILE "${CMAKE_CURRENT_LIST_DIR}/.github/.git_archival.txt"
119+
)
120+
endif()
121+
122+
message(STATUS "Using Lagrange version: ${lagrange_version}")
108123
project(Lagrange VERSION ${lagrange_version})
109124

125+
################################################################################
126+
110127
if(MINGW)
111128
message(FATAL_ERROR "Please use the MSVC compiler on Windows")
112129
endif()

VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

cmake/lagrange/lagrange_cpm_cache.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# OF ANY KIND, either express or implied. See the License for the specific language
1010
# governing permissions and limitations under the License.
1111
#
12+
include_guard(GLOBAL)
1213

1314
if(DEFINED ENV{CPM_SOURCE_CACHE})
1415
set(CPM_SOURCE_CACHE_DEFAULT $ENV{CPM_SOURCE_CACHE})

cmake/lagrange/lagrange_vcpkg_toolchain.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ CPMAddPackage(
4242
)
4343

4444
set(ENV{VCPKG_ROOT} "${vcpkg_SOURCE_DIR}")
45-
set(ENV{VCPKG_KEEP_ENV_VARS} "VCPKG_ROOT" $ENV{VCPKG_KEEP_ENV_VARS})
45+
set(ENV{VCPKG_KEEP_ENV_VARS} "VCPKG_ROOT;$ENV{VCPKG_KEEP_ENV_VARS}")
4646

4747
# Since this file is included as a toolchain file via our CMake preset, we setup vcpkg.cmake
4848
# via CMAKE_PROJECT_TOP_LEVEL_INCLUDES instead. See the following threads for more information:
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#
2+
# Copyright 2025 Adobe. All rights reserved.
3+
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License. You may obtain a copy
5+
# of the License at http://www.apache.org/licenses/LICENSE-2.0
6+
#
7+
# Unless required by applicable law or agreed to in writing, software distributed under
8+
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9+
# OF ANY KIND, either express or implied. See the License for the specific language
10+
# governing permissions and limitations under the License.
11+
#
12+
include_guard(GLOBAL)
13+
14+
# Using full path because this is included early in our root CMakeLists.txt
15+
include(${CMAKE_CURRENT_LIST_DIR}/CPM.cmake)
16+
CPMAddPackage(
17+
NAME CMakeExtraUtils
18+
GITHUB_REPOSITORY LecrisUT/CMakeExtraUtils
19+
GIT_TAG v0.4.1
20+
21+
# There is a bug in CPM when using DOWNLOAD_ONLY that before the first project() call.
22+
# Because CPM attempts to bypass FetchContent, subsequent calls to FetchContent_GetProperties()
23+
# may not give any result. This seems to only happen when the package is added with DOWNLOAD_ONLY.
24+
#
25+
# https://github.com/cpm-cmake/CPM.cmake/issues/227
26+
#
27+
SOURCE_SUBDIR cmake
28+
)
29+
30+
# Due to the bug mentioned above, ${cmakeextrautils_SOURCE_DIR} can point to either the subdir or
31+
# the root dir of the CMakeExtraUtils, depending on whether the cache is already populated. This is
32+
# really ugly, but have to work around it for now.
33+
FetchContent_GetProperties(CMakeExtraUtils)
34+
if(EXISTS ${cmakeextrautils_SOURCE_DIR}/DynamicVersion.cmake)
35+
include(${cmakeextrautils_SOURCE_DIR}/DynamicVersion.cmake)
36+
else()
37+
include(${cmakeextrautils_SOURCE_DIR}/cmake/DynamicVersion.cmake)
38+
endif()

cmake/recipes/external/Eigen3.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ else()
2626
CPMAddPackage(
2727
NAME eigen
2828
GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
29-
GIT_TAG 3.4.0
29+
GIT_TAG 3.4.1
3030
DOWNLOAD_ONLY ON
3131
)
3232
set(EIGEN_INCLUDE_DIRS ${eigen_SOURCE_DIR})

0 commit comments

Comments
 (0)