I use Googletest library as a git submodule
and I would like to move its build artifacts in a designated folder, however inside of googletest/CMakeLists.txt
(that I would like to avoid changing) it hardcodes artifacts path to
${CMAKE_BUILD_DIR}/lib
and unfortunately maintainers didn't use ${CMAKE_CURRENT_BUILD_DIR}
instead to add their artifacts in their local build path that I specify using add_subdirectory
command in my own CMakeLists.txt
:
add_subdirectory(${VENDOR_SOURCE_DIR}/googletest ${VENDOR_BINARY_DIR}/googletest)
Some artifacts respect the second path, but those hardcoded with aforementioned line don't.
Is there a way to overwrite Googletest's local value of ${CMAKE_BUILD_DIR}
without forking/modifying the library's CMakeLists.txt
?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…