set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${PROJECT_SOURCE_DIR}/lib") set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${PROJECT_SOURCE_DIR}/lib") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/lib") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${PROJECT_SOURCE_DIR}/lib") set(CMAKE...
Copy Highlighter-hljs # 指定可执行程序输出目录set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG${publish_bin_debug})set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE${publish_bin_release}) 2. 设置库文件输出目录# Copy Highlighter-hljs # 指定 库文件输出目录set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG${publish_lib_...
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Bin) # 设置分别设置Debug和Release输出目录 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/Lib) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/Lib) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_...
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/lib") set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${PROJECT_SOURCE_DIR}/lib") set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${PROJECT_SOURCE_DIR}/lib") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/lib") set(CMAKE_LIBRAR...
LIBRARY, ARCHIVE, RUNTIME, PUBLIC_HEADER是可选的,可以根据需要进行选择。 DESTINATION后面的路径可以自行制定,根目录默认为CMAKE_INSTALL_PREFIX,可以试用set方法进行指定,如果使用默认值的话,Unix系统的默认值为 /usr/local, Windows的默认值为 c...
RELEASE_POSTFIX "_release" ) install(TARGETS test_message EXPORT message_export_target RUNTIME DESTINATION "bin" LIBRARY DESTINATION "lib" ARCHIVE DESTINATION "lib" ) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION "include" ...
EXECUTABLE_OUTPUT_PATH #库文件输出路径 LIBRARY_OUTPUT_PATH #安装路径 CMAKE_INSTALL_PREFIX Note:该变量可以在Cmakelist中显式地定义,即:SET(CMAKE_INSTALL_PREFIX < install_path >);也可以作为命令行参数传递:cmake -DCMAKE_INSTALL_PREFIX=< install_path > ;还可以在cmake完成后使用make install ...
LIBRARY_OUTPUT_DIR,BINARY_OUTPUT_DIR:库和可执行的最终存放目录 PROJECT_NAME,CMAKE_PROJECT_NAME:前者是当前CMakeList.txt里设置的project_name,后者是整个项目配置的project_name 四、cmake中调用环境变量 1. Using $ENV{NAME} : 调用系统环境变量,我们也可以使用 "SET(ENV{NAME} value)". 需要注意的是这里...
指令[ ] 中为可选参数,通常不用填,除add_library外,实际中通常需要指定是动态/静态库。 1.3.1重要指令 cmake_minimum_required:指定CMake的最小版本要求 语法: cmake_minimum_required(VERSION versionNumber [FATAL_ERROR]) # CMake最小版本要求为2.8.3 ...
CMAKE_LIBRARY_OUTPUT_DIRECTORY生成库的文件夹路径 CMAKE_BUILD_TYPE指定基于make的产生器的构建类型(Release,Debug) CMAKE_C_FLAGS*.C文件编译选项,如-std=c99 -O3 -march=native CMAKE_CXX_FLAGS*.CPP文件编译选项,如-std=c++11 -O3 -march=native ...