diff --git a/cmake/fmtlib.cmake b/cmake/fmtlib.cmake index 2610424f6..792bf3b02 100644 --- a/cmake/fmtlib.cmake +++ b/cmake/fmtlib.cmake @@ -2,7 +2,7 @@ include(FetchContent) FetchContent_Declare( fmtlib - PREFIX "${CMAKE_BINARY_DIR}/deps" + PREFIX "${PROJECT_BINARY_DIR}/deps" DOWNLOAD_DIR "${PROJECT_SOURCE_DIR}/deps/downloads" DOWNLOAD_NAME fmt-8.0.1.tar.gz URL https://github.com/fmtlib/fmt/archive/8.0.1.tar.gz diff --git a/cmake/jsoncpp.cmake b/cmake/jsoncpp.cmake index 48a9d2b49..cf1cc656b 100644 --- a/cmake/jsoncpp.cmake +++ b/cmake/jsoncpp.cmake @@ -6,7 +6,7 @@ else() set(JSONCPP_CMAKE_COMMAND ${CMAKE_COMMAND}) endif() -set(prefix "${CMAKE_BINARY_DIR}/deps") +set(prefix "${PROJECT_BINARY_DIR}/deps") set(JSONCPP_LIBRARY "${prefix}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}jsoncpp${CMAKE_STATIC_LIBRARY_SUFFIX}") set(JSONCPP_INCLUDE_DIR "${prefix}/include") diff --git a/cmake/range-v3.cmake b/cmake/range-v3.cmake index 4f3225420..d2f54452b 100644 --- a/cmake/range-v3.cmake +++ b/cmake/range-v3.cmake @@ -6,7 +6,7 @@ else() set(RANGE_V3_CMAKE_COMMAND ${CMAKE_COMMAND}) endif() -set(prefix "${CMAKE_BINARY_DIR}/deps") +set(prefix "${PROJECT_BINARY_DIR}/deps") set(RANGE_V3_INCLUDE_DIR "${prefix}/include") ExternalProject_Add(range-v3-project diff --git a/libstdlib/CMakeLists.txt b/libstdlib/CMakeLists.txt index 4a995c78f..65a3a1cda 100644 --- a/libstdlib/CMakeLists.txt +++ b/libstdlib/CMakeLists.txt @@ -11,8 +11,8 @@ foreach(src IN LISTS STDLIB) string(REGEX REPLACE ";" ",\n\t0x" STDLIB_FILE_CONTENT "${STDLIB_FILE_CONTENT}") set(STDLIB_FILE_CONTENT "0x${STDLIB_FILE_CONTENT}") set(STDLIB_FILE_NAME ${src}) - configure_file("${PROJECT_SOURCE_DIR}/libstdlib/stdlib.src.h.in" ${CMAKE_BINARY_DIR}/include/libstdlib/${src}.h NEWLINE_STYLE LF @ONLY) - list(APPEND GENERATED_STDLIB_HEADERS ${CMAKE_BINARY_DIR}/include/libstdlib/${src}.h) + configure_file("${PROJECT_SOURCE_DIR}/libstdlib/stdlib.src.h.in" ${PROJECT_BINARY_DIR}/include/libstdlib/${src}.h NEWLINE_STYLE LF @ONLY) + list(APPEND GENERATED_STDLIB_HEADERS ${PROJECT_BINARY_DIR}/include/libstdlib/${src}.h) endforeach() -configure_file("${PROJECT_SOURCE_DIR}/libstdlib/stdlib.h.in" ${CMAKE_BINARY_DIR}/include/libstdlib/stdlib.h NEWLINE_STYLE LF @ONLY) +configure_file("${PROJECT_SOURCE_DIR}/libstdlib/stdlib.h.in" ${PROJECT_BINARY_DIR}/include/libstdlib/stdlib.h NEWLINE_STYLE LF @ONLY)