-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds installation logic and updates cmake to use relative paths
- Loading branch information
Timothy Burke
committed
Jun 11, 2024
1 parent
368dbd9
commit 83f5206
Showing
5 changed files
with
144 additions
and
46 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 |
---|---|---|
@@ -1,40 +1,53 @@ | ||
cmake_minimum_required( VERSION 3.14 ) | ||
cmake_minimum_required( VERSION 3.27 ) | ||
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/.cmake) | ||
include( FetchContent ) | ||
|
||
####################################################################### | ||
# Declare project dependencies | ||
####################################################################### | ||
|
||
FetchContent_Declare( spdlog | ||
GIT_REPOSITORY https://github.com/gabime/spdlog | ||
GIT_TAG v1.11.0 | ||
GIT_SHALLOW TRUE | ||
) | ||
set( SPDLOG_BUILD_PIC CACHE INTERNAL BOOL ON ) | ||
|
||
FetchContent_Declare( Catch2 | ||
GIT_REPOSITORY https://github.com/catchorg/Catch2 | ||
GIT_TAG v3.3.2 | ||
GIT_SHALLOW TRUE | ||
) | ||
|
||
FetchContent_Declare( pybind11 | ||
GIT_REPOSITORY https://github.com/pybind/pybind11 | ||
GIT_TAG v2.10.4 | ||
FetchContent_Declare( FastFloat | ||
GIT_REPOSITORY ../../fastfloat/fast_float | ||
GIT_TAG v6.1.1 | ||
GIT_SHALLOW TRUE | ||
) | ||
|
||
FetchContent_Declare( fast_float | ||
GIT_REPOSITORY https://github.com/fastfloat/fast_float | ||
GIT_TAG v6.1.1 | ||
FetchContent_Declare( spdlog | ||
GIT_REPOSITORY ../../gabime/spdlog | ||
GIT_TAG v1.11.0 | ||
GIT_SHALLOW TRUE | ||
) | ||
set( SPDLOG_BUILD_PIC CACHE INTERNAL BOOL ON ) | ||
if (tools.installation) | ||
set( SPDLOG_INSTALL CACHE INTERNAL BOOL ON ) | ||
else() | ||
set( SPDLOG_INSTALL CACHE INTERNAL BOOL OFF ) | ||
endif() | ||
|
||
####################################################################### | ||
# Load dependencies | ||
####################################################################### | ||
|
||
FetchContent_MakeAvailable( | ||
spdlog | ||
fast_float | ||
) | ||
FastFloat | ||
) | ||
|
||
if (tools.tests) | ||
FetchContent_Declare( Catch2 | ||
GIT_REPOSITORY ../../catchorg/catch2 | ||
GIT_TAG v3.3.2 | ||
GIT_SHALLOW TRUE | ||
) | ||
FetchContent_MakeAvailable(Catch2) | ||
endif() | ||
|
||
if (tools.python) | ||
FetchContent_Declare( pybind11 | ||
GIT_REPOSITORY ../../pybind/pybind11 | ||
GIT_TAG v2.10.4 | ||
GIT_SHALLOW TRUE | ||
) | ||
FetchContent_MakeAvailable(pybind11) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,49 @@ | ||
cmake_minimum_required( VERSION 3.14 ) | ||
cmake_minimum_required( VERSION 3.27 ) | ||
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/.cmake) | ||
include( FetchContent ) | ||
|
||
####################################################################### | ||
# Declare project dependencies | ||
####################################################################### | ||
|
||
FetchContent_Declare( Catch2 | ||
GIT_REPOSITORY https://github.com/catchorg/Catch2 | ||
GIT_TAG 3f0283de7a9c43200033da996ff9093be3ac84dc # tag: v3.3.2 | ||
) | ||
|
||
FetchContent_Declare( fast_float | ||
GIT_REPOSITORY https://github.com/fastfloat/fast_float | ||
FetchContent_Declare( FastFloat | ||
GIT_REPOSITORY ../../fastfloat/fast_float | ||
GIT_TAG f476bc713fda06fbd34dc621b466745a574b3d4c # tag: v6.1.1 | ||
) | ||
|
||
FetchContent_Declare( pybind11 | ||
GIT_REPOSITORY https://github.com/pybind/pybind11 | ||
GIT_TAG 5b0a6fc2017fcc176545afe3e09c9f9885283242 # tag: v2.10.4 | ||
) | ||
|
||
FetchContent_Declare( spdlog | ||
GIT_REPOSITORY https://github.com/gabime/spdlog | ||
GIT_REPOSITORY ../../gabime/spdlog | ||
GIT_TAG ad0e89cbfb4d0c1ce4d097e134eb7be67baebb36 # tag: v1.11.0 | ||
) | ||
set( SPDLOG_BUILD_PIC CACHE INTERNAL BOOL ON ) | ||
|
||
if (tools.installation) | ||
set( SPDLOG_INSTALL CACHE INTERNAL BOOL ON ) | ||
else() | ||
set( SPDLOG_INSTALL CACHE INTERNAL BOOL OFF ) | ||
endif() | ||
|
||
####################################################################### | ||
# Load dependencies | ||
####################################################################### | ||
|
||
FetchContent_MakeAvailable( | ||
fast_float | ||
FastFloat | ||
spdlog | ||
) | ||
|
||
if (tools.tests) | ||
FetchContent_Declare( Catch2 | ||
GIT_REPOSITORY ../../catchorg/Catch2 | ||
GIT_TAG 3f0283de7a9c43200033da996ff9093be3ac84dc # tag: v3.3.2 | ||
) | ||
|
||
FetchContent_MakeAvailable(Catch2) | ||
endif() | ||
|
||
if (tools.python) | ||
FetchContent_Declare( pybind11 | ||
GIT_REPOSITORY ../../pybind/pybind11 | ||
GIT_TAG 5b0a6fc2017fcc176545afe3e09c9f9885283242 # tag: v2.10.4 | ||
) | ||
FetchContent_MakeAvailable(pybind11) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
include(CMakeFindDependencyMacro) | ||
|
||
if (NOT TARGET spdlog::spdlog) | ||
find_dependency(spdlog) | ||
endif() | ||
|
||
|
||
if (NOT TARGET FastFloat::fast_float) | ||
find_dependency(FastFloat) | ||
endif() | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/tools-targets.cmake") |
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