diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2019-11-15 13:01:36 -0500 |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2019-12-13 10:51:46 -0500 |
commit | 5a8a9f72293ab1b3fd768ff40e5fb1f07cdb7dd2 (patch) | |
tree | 7e456292c9299223c3bd851261595f24371d2f3b /Tests/LinkDirectory | |
parent | 3bc63e99e44b3ef82c19d018f939ea839882a131 (diff) | |
download | cmake-5a8a9f72293ab1b3fd768ff40e5fb1f07cdb7dd2.tar.gz |
Ninja: Add multi-config variant
Co-Authored-by: vector-of-bool <vectorofbool@gmail.com>
Diffstat (limited to 'Tests/LinkDirectory')
-rw-r--r-- | Tests/LinkDirectory/External/CMakeLists.txt | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Tests/LinkDirectory/External/CMakeLists.txt b/Tests/LinkDirectory/External/CMakeLists.txt index d2a1f9f77a..c877913583 100644 --- a/Tests/LinkDirectory/External/CMakeLists.txt +++ b/Tests/LinkDirectory/External/CMakeLists.txt @@ -2,13 +2,19 @@ cmake_minimum_required(VERSION 2.8) project(LinkDirectoryExternal C) +set(cfg_dir) +get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(_isMultiConfig) + set(cfg_dir /$<CONFIG>) +endif() + add_executable(myexe2 myexe.c) set_property(TARGET myexe2 PROPERTY OUTPUT_NAME LinkDirectory2) -target_link_directories(myexe2 PRIVATE lib "${CMAKE_CURRENT_SOURCE_DIR}/../lib") +target_link_directories(myexe2 PRIVATE lib${cfg_dir} "${CMAKE_CURRENT_SOURCE_DIR}/../lib${cfg_dir}") target_link_libraries(myexe2 PRIVATE mylibA mylibB) add_library (mylibs INTERFACE) -target_link_directories(mylibs INTERFACE lib "${CMAKE_CURRENT_SOURCE_DIR}/../lib") +target_link_directories(mylibs INTERFACE lib${cfg_dir} "${CMAKE_CURRENT_SOURCE_DIR}/../lib${cfg_dir}") target_link_libraries(mylibs INTERFACE mylibA mylibB) add_executable(myexe3 myexe.c) set_property(TARGET myexe3 PROPERTY OUTPUT_NAME LinkDirectory3) @@ -17,11 +23,11 @@ target_link_libraries(myexe3 PRIVATE mylibs) # Test CMP0015 OLD behavior: -L../lib cmake_policy(SET CMP0015 OLD) -link_directories(../lib) +link_directories(../lib${cfg_dir}) # Test CMP0015 NEW behavior: -L${CMAKE_CURRENT_SOURCE_DIR}/lib cmake_policy(SET CMP0015 NEW) -link_directories(lib) +link_directories(lib${cfg_dir}) add_executable(myexe myexe.c) set_property(TARGET myexe PROPERTY OUTPUT_NAME LinkDirectory) |