0

I need to compile several open sources, one of them has CMakeLists.txt which includes

##############################################################
# Output paths
##############################################################
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")

I want to put all output into my custom folder, so in the parent CMakeLists.txt has

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/build/runtime")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/build/")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/build/lib")

But it does not work and I don't want to change the open sources' CMakeLists.txt. I know cache var or PARENT_SCOPE var can be changed in parent level, how can I change the normal var without PARENT_SCOPE.

I want to know how to build the correct cmake project or how to solve my problem.

enter image description here

Tsyvarev
  • 60,011
  • 17
  • 110
  • 153
caorenxxy
  • 1
  • 1
  • 1
    Welcome to Stack Overflow! Here we discourage using **images** for represent **code**. Instead, paste the code into the question post as **text**. About explanations, see [that question](https://meta.stackoverflow.com/questions/285551/why-should-i-not-upload-images-of-code-data-errors) on meta. After properly pasting the code, specify also which **exact** child project has undesirable variable's settings: there are many child projects in your code included via `add_subdirectory`. – Tsyvarev Nov 25 '22 at 09:58

0 Answers0