From 4d559e53b39c0d385dafc7707bf99fcc34315cc7 Mon Sep 17 00:00:00 2001 From: fagsctvg Date: Tue, 22 Oct 2024 17:16:03 -0800 Subject: [PATCH 1/2] Update range-v3.cmake --- cmake/range-v3.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/range-v3.cmake b/cmake/range-v3.cmake index eaab3b09e332..6424dc68eff1 100644 --- a/cmake/range-v3.cmake +++ b/cmake/range-v3.cmake @@ -1,4 +1,4 @@ -include(${CMAKE_SOURCE_DIR}/cmake/submodules.cmake) +include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/submodules.cmake) initialize_submodule(range-v3) add_library(range-v3 INTERFACE IMPORTED) From 5f7c81fe9ae970965a919548c0a235489c78ab17 Mon Sep 17 00:00:00 2001 From: ellllie-42 <160203817+ellllie-42@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:34:43 -0800 Subject: [PATCH 2/2] Changed CMAKE_SOURCE_DIR into CMAKE_CURRENT_SOURCE_DIR --- cmake/fmtlib.cmake | 4 ++-- cmake/nlohmann-json.cmake | 4 ++-- cmake/range-v3.cmake | 4 ++-- cmake/scripts/buildinfo.cmake | 2 +- cmake/submodules.cmake | 8 ++++---- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cmake/fmtlib.cmake b/cmake/fmtlib.cmake index f9522aaecd00..3f97716671a8 100644 --- a/cmake/fmtlib.cmake +++ b/cmake/fmtlib.cmake @@ -1,9 +1,9 @@ -include(${CMAKE_SOURCE_DIR}/cmake/submodules.cmake) +include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/submodules.cmake) initialize_submodule(fmtlib) set(FMT_SYSTEM_HEADERS ON) add_subdirectory( - ${CMAKE_SOURCE_DIR}/deps/fmtlib + ${CMAKE_CURRENT_SOURCE_DIR}/deps/fmtlib EXCLUDE_FROM_ALL ) diff --git a/cmake/nlohmann-json.cmake b/cmake/nlohmann-json.cmake index 638fcdd6502d..b25deaaa8a9a 100644 --- a/cmake/nlohmann-json.cmake +++ b/cmake/nlohmann-json.cmake @@ -1,9 +1,9 @@ -include(${CMAKE_SOURCE_DIR}/cmake/submodules.cmake) +include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/submodules.cmake) initialize_submodule(nlohmann-json) set(JSON_Install OFF CACHE INTERNAL "") add_subdirectory( - ${CMAKE_SOURCE_DIR}/deps/nlohmann-json + ${CMAKE_CURRENT_SOURCE_DIR}/deps/nlohmann-json EXCLUDE_FROM_ALL ) diff --git a/cmake/range-v3.cmake b/cmake/range-v3.cmake index 6424dc68eff1..60b081fb32fd 100644 --- a/cmake/range-v3.cmake +++ b/cmake/range-v3.cmake @@ -4,8 +4,8 @@ initialize_submodule(range-v3) add_library(range-v3 INTERFACE IMPORTED) set_target_properties(range-v3 PROPERTIES INTERFACE_COMPILE_OPTIONS "\$<\$:/permissive->" - INTERFACE_SYSTEM_INCLUDE_DIRECTORIES ${CMAKE_SOURCE_DIR}/deps/range-v3/include - INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_SOURCE_DIR}/deps/range-v3/include + INTERFACE_SYSTEM_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/deps/range-v3/include + INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/deps/range-v3/include ) add_dependencies(range-v3 range-v3-project) diff --git a/cmake/scripts/buildinfo.cmake b/cmake/scripts/buildinfo.cmake index 3fb6beb2b787..d7ccbfce1ac6 100644 --- a/cmake/scripts/buildinfo.cmake +++ b/cmake/scripts/buildinfo.cmake @@ -1,7 +1,7 @@ # generates BuildInfo.h # # this module expects -# ETH_SOURCE_DIR - main CMAKE_SOURCE_DIR +# ETH_SOURCE_DIR - main CMAKE_CURRENT_SOURCE_DIR # ETH_DST_DIR - main CMAKE_BINARY_DIR # ETH_BUILD_TYPE # ETH_BUILD_PLATFORM diff --git a/cmake/submodules.cmake b/cmake/submodules.cmake index 1ef55d289ccb..85393069b510 100644 --- a/cmake/submodules.cmake +++ b/cmake/submodules.cmake @@ -1,18 +1,18 @@ macro(initialize_submodule SUBMODULE_PATH) if(NOT IGNORE_VENDORED_DEPENDENCIES) - file(GLOB submodule_contents "${CMAKE_SOURCE_DIR}/deps/${SUBMODULE_PATH}/*") + file(GLOB submodule_contents "${CMAKE_CURRENT_SOURCE_DIR}/deps/${SUBMODULE_PATH}/*") if(submodule_contents) message(STATUS "git submodule '${SUBMODULE_PATH}' seem to be already initialized: nothing to do.") else() - message(STATUS "git submodule '${SUBMODULE_PATH}' seem not to be initialized: implicitly executing 'git submodule update --init '${CMAKE_SOURCE_DIR}/deps/${SUBMODULE_PATH}'.") + message(STATUS "git submodule '${SUBMODULE_PATH}' seem not to be initialized: implicitly executing 'git submodule update --init '${CMAKE_CURRENT_SOURCE_DIR}/deps/${SUBMODULE_PATH}'.") find_package(Git) if(NOT Git_FOUND) message(FATAL_ERROR "Failed to initialize submodules: 'git' command not found.") endif() execute_process( - COMMAND git submodule update --init ${CMAKE_SOURCE_DIR}/deps/${SUBMODULE_PATH} - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + COMMAND git submodule update --init ${CMAKE_CURRENT_SOURCE_DIR}/deps/${SUBMODULE_PATH} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} RESULT_VARIABLE result ) if(NOT result EQUAL 0)