Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aidge_core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Houssem ROUIS
aidge_core
Commits
d7584936
Commit
d7584936
authored
5 months ago
by
Jerome Hue
Committed by
Maxence Naud
5 months ago
Browse files
Options
Downloads
Patches
Plain Diff
chore: Use find_package in CMake, fallback to fetch_content
parent
efc3c4b5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+19
-13
19 additions, 13 deletions
CMakeLists.txt
unit_tests/CMakeLists.txt
+12
-7
12 additions, 7 deletions
unit_tests/CMakeLists.txt
with
31 additions
and
20 deletions
CMakeLists.txt
+
19
−
13
View file @
d7584936
...
...
@@ -5,7 +5,7 @@ file(STRINGS "${CMAKE_SOURCE_DIR}/version.txt" version)
project
(
aidge_core
VERSION
${
version
}
DESCRIPTION
"Core algorithms for operators and graph of the AIDGE framework"
DESCRIPTION
"Core algorithms for operators and graph of the AIDGE framework"
LANGUAGES CXX
)
message
(
STATUS
"Project name:
${
CMAKE_PROJECT_NAME
}
"
)
message
(
STATUS
"Project version:
${
version
}
"
)
...
...
@@ -36,22 +36,28 @@ endif()
##############################################
# Find system dependencies
Include
(
FetchContent
)
set
(
FMT_VERSION 10.2.1
)
message
(
STATUS
"Retrieving fmt
${
FMT_VERSION
}
from git"
)
FetchContent_Declare
(
fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_TAG
${
FMT_VERSION
}
# or a later release
)
set
(
FMT_SYSTEM_HEADERS ON
)
FetchContent_MakeAvailable
(
fmt
)
set_property
(
TARGET fmt PROPERTY POSITION_INDEPENDENT_CODE ON
)
find_package
(
fmt
${
FMT_VERSION
}
QUIET
)
find_package
(
Threads REQUIRED
)
if
(
NOT fmt_FOUND
)
message
(
STATUS
"fmt not found in system, retrieving from git"
)
Include
(
FetchContent
)
FetchContent_Declare
(
fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_TAG
${
FMT_VERSION
}
)
set
(
FMT_SYSTEM_HEADERS ON
)
FetchContent_MakeAvailable
(
fmt
)
set_property
(
TARGET fmt PROPERTY POSITION_INDEPENDENT_CODE ON
)
else
()
message
(
STATUS
"Found system fmt version
${
fmt_VERSION
}
"
)
endif
()
find_package
(
Threads REQUIRED
)
##############################################
# Create target and set properties
...
...
This diff is collapsed.
Click to expand it.
unit_tests/CMakeLists.txt
+
12
−
7
View file @
d7584936
Include
(
FetchContent
)
find_package
(
Catch2 3.0.1
)
FetchContent_Declare
(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.0.1
# or a later release
)
if
(
NOT Catch2_FOUND
)
message
(
STATUS
"Catch2 not found in system, retrieving from git"
)
Include
(
FetchContent
)
FetchContent_MakeAvailable
(
Catch2
)
FetchContent_Declare
(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.0.1
# or a later release
)
FetchContent_MakeAvailable
(
Catch2
)
endif
()
file
(
GLOB_RECURSE src_files
"*.cpp"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment