Skip to content

Commit ecde422

Browse files
committed
fix(cmake): fetch instrument-hooks git repository
1 parent d611a75 commit ecde422

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

core/CMakeLists.txt

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,30 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
1111
# Add the include directory
1212
include_directories(include)
1313

14+
include(FetchContent)
15+
FetchContent_Declare(
16+
instrument_hooks_repo
17+
GIT_REPOSITORY https://github.com/CodSpeedHQ/instrument-hooks
18+
GIT_TAG b1e401a4d031ad308edb22ed59a52253a1ebe924
19+
)
20+
FetchContent_MakeAvailable(instrument_hooks_repo)
21+
FetchContent_GetProperties(instrument_hooks_repo)
22+
if(NOT instrument_hooks_repo_POPULATED)
23+
FetchContent_Populate(instrument_hooks_repo)
24+
endif()
25+
set(instrument_hooks_SOURCE_DIR ${instrument_hooks_repo_SOURCE_DIR})
26+
1427
# Add the instrument_hooks library
1528
add_library(
1629
instrument_hooks
1730
STATIC
18-
instrument-hooks/dist/core.c
31+
${instrument_hooks_SOURCE_DIR}/dist/core.c
1932
)
2033

2134
target_include_directories(
2235
instrument_hooks
2336
PUBLIC
24-
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/instrument-hooks/includes>
37+
$<BUILD_INTERFACE:${instrument_hooks_SOURCE_DIR}/includes>
2538
$<INSTALL_INTERFACE:includes>
2639
)
2740

@@ -72,7 +85,7 @@ add_compile_definitions(CODSPEED_VERSION="${CODSPEED_VERSION}")
7285
target_include_directories(
7386
codspeed
7487
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
75-
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/instrument-hooks/includes>
88+
$<BUILD_INTERFACE:${instrument_hooks_SOURCE_DIR}/includes>
7689
)
7790

7891
# Disable valgrind compilation errors

0 commit comments

Comments
 (0)