一、CMAKE_LIBRARY_OUTPUT_DIRECTORY
Where to put all the LIBRARY targets when built.
This variable is used to initialize the LIBRARY_OUTPUT_DIRECTORY property on all the targets. See that target property for additional information.
说人话就是指定动态库或者静态库的输出目录。
栗子
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
二、CMAKE_ARCHIVE_OUTPUT_DIRECTORY
Where to put all the ARCHIVE targets when built.
This variable is used to initialize the ARCHIVE_OUTPUT_DIRECTORY property on all the targets. See that target property for additional information.
暂时没用过。
三、CMAKE_RUNTIME_OUTPUT_DIRECTORY
Where to put all the RUNTIME targets when built.
This variable is used to initialize the RUNTIME_OUTPUT_DIRECTORY property on all the targets. See that target property for additional information.
说人话就是指定可执行文件的输出目录。
栗子
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Bin)
三者一般都是在根 CMakeLists 中使用,如果子目录中没有指定输出位置,则沿用父目录指定的输出位置。
(SAW:Game Over!)