Skip to content

Commit 5025f7d

Browse files
committed
Split package root specifications into individual cmake files
1 parent 1852ade commit 5025f7d

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ if(YSTDLIB_CPP_IS_TOP_LEVEL)
4040
# Include dependency settings if the project isn't being included as a subproject.
4141
# NOTE: We mark the file optional because if the user happens to have the dependencies
4242
# installed, this file is not necessary.
43-
include(build/deps/settings.cmake OPTIONAL)
43+
include(build/deps/CMake/settings.cmake OPTIONAL)
4444

4545
# If previously undefined, `BUILD_TESTING` will be set to ON.
4646
include(CTest)

taskfile.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ vars:
1111
G_CPP_SRC_DIR: "{{.ROOT_DIR}}/src"
1212
G_DEPS_DIR: "{{.G_BUILD_DIR}}/deps"
1313

14-
# This should be kept in-sync with its usage in CMakeLists.txt
15-
G_DEPS_CMAKE_SETTINGS_FILE: "{{.G_DEPS_DIR}}/settings.cmake"
14+
# These should be kept in-sync with its usage in CMakeLists.txt
15+
G_DEPS_CMAKE_SETTINGS_DIR: "{{.G_DEPS_DIR}}/CMake"
16+
G_DEPS_CMAKE_SETTINGS_FILE: "{{.G_DEPS_CMAKE_SETTINGS_DIR}}/settings.cmake"
1617

1718
G_TEST_BIN_DIR: "{{.G_BUILD_DIR}}/testbin"
1819
G_TEST_TARGET_SUFFIXES:

taskfiles/deps.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,8 @@ tasks:
1818
install-all-init:
1919
internal: true
2020
cmds:
21-
- "mkdir -p {{.G_DEPS_DIR}}"
21+
- "mkdir -p {{.G_DEPS_CMAKE_SETTINGS_DIR}}"
2222
- "rm -f '{{.G_DEPS_CMAKE_SETTINGS_FILE}}'"
23-
# Enable CMP0074 to ensure Cmake versions prior to 3.12 does not ignore <PackageName>_ROOT.
24-
- >-
25-
echo "set(CMAKE_POLICY_DEFAULT_CMP0074 NEW CACHE STRING \"Enable <PackageName>_ROOT
26-
flags\")" >> "{{.G_DEPS_CMAKE_SETTINGS_FILE}}"
2723

2824
install-all-run:
2925
internal: true
@@ -34,6 +30,8 @@ tasks:
3430

3531
add-package-root-to-settings:
3632
internal: true
33+
vars:
34+
PACKAGE_ROOT_SETTINGS_FILE: "{{.G_DEPS_CMAKE_SETTINGS_DIR}}/{{.NAME}}-root.cmake"
3735
requires:
3836
vars:
3937
- "NAME"
@@ -43,7 +41,9 @@ tasks:
4341
# See also: https://man7.org/linux/man-pages/man7/pipe.7.html
4442
- >-
4543
echo "set({{.NAME}}_ROOT \"{{.INSTALL_PREFIX}}\" CACHE PATH \"Path to {{.NAME}}\")" >>
46-
"{{.G_DEPS_CMAKE_SETTINGS_FILE}}"
44+
"{{.PACKAGE_ROOT_SETTINGS_FILE}}"
45+
- >-
46+
echo "include({{.PACKAGE_ROOT_SETTINGS_FILE}})" >> "{{.G_DEPS_CMAKE_SETTINGS_FILE}}"
4747
4848
install-Catch2:
4949
internal: true
@@ -73,7 +73,7 @@ tasks:
7373
FILE_SHA256: "0382248cbb00806ce4b5f3ce6939797dc3b597c85fd3531614959e31ef488b39"
7474
URL: "https://github.com/ned14/outcome/archive/refs/tags/v2.2.11.tar.gz"
7575
GEN_ARGS:
76-
- "-C {{.G_DEPS_CMAKE_SETTINGS_FILE}}"
76+
- "-C {{.G_DEPS_CMAKE_SETTINGS_DIR}}/{{.G_QUICKCPPLIB_LIB_NAME}}-root.cmake"
7777
- "-DCMAKE_BUILD_TYPE=Release"
7878
JOBS: 8
7979
- task: "add-package-root-to-settings"

0 commit comments

Comments
 (0)