Skip to content

Commit 3fdc4b9

Browse files
committed
Build and download 3rd-party to build dir
1 parent cfcde43 commit 3fdc4b9

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

3rd-party/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ include(ExternalProject)
3939
ExternalProject_Add(
4040
plog
4141
URL ${CMAKE_CURRENT_SOURCE_DIR}/plog-${PLOG_VERSION}.tar.gz
42-
INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/plog-${PLOG_VERSION}
42+
INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/plog-${PLOG_VERSION}
4343
CMAKE_ARGS -D CMAKE_BUILD_TYPE=Release
4444
-D CMAKE_INSTALL_PREFIX=<INSTALL_DIR>
4545
-D PLOG_BUILD_SAMPLES=OFF
@@ -50,7 +50,7 @@ ExternalProject_Add(
5050
ExternalProject_Add(
5151
json
5252
URL ${CMAKE_CURRENT_SOURCE_DIR}/json-${NLOHMANN_VERSION}.tar.gz
53-
INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/json-${NLOHMANN_VERSION}
53+
INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/json-${NLOHMANN_VERSION}
5454
CMAKE_ARGS -D CMAKE_BUILD_TYPE=Release
5555
-D BUILD_TESTING=OFF
5656
-D CMAKE_INSTALL_PREFIX=<INSTALL_DIR>

3rd-party/CMakeLists_benchmark.txt.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ include(ExternalProject)
66
ExternalProject_Add(benchmark
77
GIT_REPOSITORY https://github.com/google/benchmark.git
88
GIT_TAG main
9-
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/benchmark-src"
10-
BINARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/benchmark-build"
9+
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/benchmark-src"
10+
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/benchmark-build"
1111
GIT_SHALLOW 1
1212
CONFIGURE_COMMAND ""
1313
BUILD_COMMAND ""

3rd-party/CMakeLists_googletest.txt.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ ExternalProject_Add(googletest
77
GIT_REPOSITORY https://github.com/google/googletest.git
88
GIT_TAG main
99
GIT_SHALLOW 1
10-
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/googletest-src"
11-
BINARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/googletest-build"
10+
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-src"
11+
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-build"
1212
CONFIGURE_COMMAND ""
1313
BUILD_COMMAND ""
1414
INSTALL_COMMAND ""

CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,10 @@ endif()
173173

174174

175175
#-------------------
176-
# 3rd-party
176+
# Include 3rd-party
177177
#-------------------
178-
include_directories(3rd-party/json-${NLOHMANN_VERSION}/include)
179-
include_directories(3rd-party/plog-${PLOG_VERSION}/include)
178+
include_directories(${CMAKE_CURRENT_BINARY_DIR}/3rd-party/json-${NLOHMANN_VERSION}/include)
179+
include_directories(${CMAKE_CURRENT_BINARY_DIR}/3rd-party/plog-${PLOG_VERSION}/include)
180180

181181

182182
#-------------------

0 commit comments

Comments
 (0)