我在用cmake version 3.5.1编译时,发现 set(LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) 不起作用,后来我把LIBRARY_OUTPUT_DIRECTORY改成 LIBRARY_OUTPUT_PATH就可以了。
cmake官网的解释:
Old executable location variable.
The target property RUNTIME_OUTPUT_DIRECTORY
supercedes this variable for a target if it is set. Executable targets are otherwise placed in this directory.
有谁清楚的,可以在评论区评论