GLOB路径相对于cmake文件,但set_target_properties路径相对于命令行目录

时间:2018-12-15 12:45:25

标签: cmake

在以下代码段中,为什么注释所标记的两个相对路径解释不同?

cmake_minimum_required(VERSION 3.7)
project(environment_exe)

find_package(SDL2 REQUIRED)
include_directories(environment_exe ${SDL2_INCLUDE_DIRS})

file(GLOB_RECURSE environment_exe_src ./src/environment/*.cpp) # relative to CMakeLists.txt

add_executable(environment_exe ${environment_exe_src})
target_link_libraries(environment_exe ${SDL2_LIBRARIES})

set_target_properties(
    environment_exe
    PROPERTIES
    ARCHIVE_OUTPUT_DIRECTORY "../lib" # relative to build file lovation
    LIBRARY_OUTPUT_DIRECTORY "../lib"
    RUNTIME_OUTPUT_DIRECTORY "../bin"
)

0 个答案:

没有答案