Specifying the assembly directory in the CMakeLists file

Can I specify the assembly directory in the CMakeLists file? If so, how.

My goal is to be able to call "cmake" in the top-level source directory and see cmake in the build directory.

+4
source share
2 answers

Afaik, with CMakethe assembly directory is always the directory from which you call the CMakeor command ccmake. Therefore, if you want to change the assembly directory, you need to change the directories before starting CMake.

To control the location where executable files, static and shared libraries are placed after completion, you can modifiy CMAKE_RUNTIME_OUTPUT_DIRECTORY, CMAKE_ARCHIVE_OUTPUT_DIRECTORYand CMAKE_LIBRARY_OUTPUT_DIRECTORYaccordingly.

+5

, CMakeLists.txt. , , . :

  • .
  • , .
  • cmake ccmake, .
  • .

, CMakeLists.txt, ${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR}. , , CMake.

+2

All Articles