diff options
author | Robert Goulet <robert.goulet@autodesk.com> | 2015-08-11 19:19:03 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-08-12 17:43:00 (GMT) |
commit | d25819bc2623b5144ffc57b694500993ac5759b4 (patch) | |
tree | 89116aa3d941ae23e5cb53a0c85dc255abd5ee0d /Tests/ExportImport/Export | |
parent | e36a05fd7f7d008c4c1e75ebf46eac3072ef71b1 (diff) | |
download | CMake-d25819bc2623b5144ffc57b694500993ac5759b4.zip CMake-d25819bc2623b5144ffc57b694500993ac5759b4.tar.gz CMake-d25819bc2623b5144ffc57b694500993ac5759b4.tar.bz2 |
Add generator expression support to OUTPUT_DIRECTORY target properties
If {ARCHIVE,LIBRARY,RUNTIME}_OUTPUT_DIRECTORY is set with a genex then
do not add the per-config subdirectory on multi-config generators.
This will allow projects to use $<CONFIG> to place the per-config
part of the directory path somewhere other than the end.
Diffstat (limited to 'Tests/ExportImport/Export')
-rw-r--r-- | Tests/ExportImport/Export/CMakeLists.txt | 17 | ||||
-rw-r--r-- | Tests/ExportImport/Export/testExe4.c | 24 |
2 files changed, 39 insertions, 2 deletions
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt index df3f178..7fdfaa8 100644 --- a/Tests/ExportImport/Export/CMakeLists.txt +++ b/Tests/ExportImport/Export/CMakeLists.txt @@ -105,6 +105,19 @@ target_link_libraries(testLib4 add_executable(testExe3 testExe3.c) set_property(TARGET testExe3 PROPERTY MACOSX_BUNDLE 1) +# Test <ARCHIVE|LIBRARY|RUNTIME>_OUTPUT_DIRECTORY[_<CONFIG>] properties with generator expressions +add_executable(testExe4 testExe4.c) +target_link_libraries(testExe4 testExe1lib) +set_property(TARGET testLib7 PROPERTY ARCHIVE_OUTPUT_DIRECTORY_DEBUG testLib7D-$<CONFIG>) +set_property(TARGET testLib7 PROPERTY ARCHIVE_OUTPUT_DIRECTORY_RELEASE testLib7R-$<CONFIG>) +set_property(TARGET testLib7 PROPERTY ARCHIVE_OUTPUT_DIRECTORY testLib7-$<CONFIG>) +set_property(TARGET testLib5 PROPERTY LIBRARY_OUTPUT_DIRECTORY_DEBUG testLib5D-$<CONFIG>) +set_property(TARGET testLib5 PROPERTY LIBRARY_OUTPUT_DIRECTORY_RELEASE testLib5R-$<CONFIG>) +set_property(TARGET testLib5 PROPERTY LIBRARY_OUTPUT_DIRECTORY testLib5-$<CONFIG>) +set_property(TARGET testExe4 PROPERTY RUNTIME_OUTPUT_DIRECTORY_DEBUG testExe4D-$<CONFIG>) +set_property(TARGET testExe4 PROPERTY RUNTIME_OUTPUT_DIRECTORY_RELEASE testExe4R-$<CONFIG>) +set_property(TARGET testExe4 PROPERTY RUNTIME_OUTPUT_DIRECTORY testExe4-$<CONFIG>) + # Test cyclic dependencies. add_library(testLibCycleA STATIC testLibCycleA1.c testLibCycleA2.c testLibCycleA3.c) @@ -450,7 +463,7 @@ install(FILES # Install and export from install tree. install( TARGETS - testExe1 testLib1 testLib2 testExe2 testLib3 testLib4 testExe3 + testExe1 testLib1 testLib2 testExe2 testLib3 testLib4 testExe3 testExe4 testExe2lib testLib4lib testLib4libdbg testLib4libopt testLib6 testLib7 testLibCycleA testLibCycleB @@ -511,7 +524,7 @@ export(TARGETS testExe1 testLib1 testLib2 testLib3 NAMESPACE bld_ FILE ExportBuildTree.cmake ) -export(TARGETS testExe2 testLib4 testLib5 testLib6 testLib7 testExe3 testExe2lib +export(TARGETS testExe2 testLib4 testLib5 testLib6 testLib7 testExe3 testExe4 testExe2lib testLib4lib testLib4libdbg testLib4libopt testLibCycleA testLibCycleB testLibPerConfigDest diff --git a/Tests/ExportImport/Export/testExe4.c b/Tests/ExportImport/Export/testExe4.c new file mode 100644 index 0000000..731057e --- /dev/null +++ b/Tests/ExportImport/Export/testExe4.c @@ -0,0 +1,24 @@ +#include <stdio.h> + +int main(int argc, const char* argv[]) +{ + if(argc < 2) + { + fprintf(stderr, "Must specify output file.\n"); + return 1; + } + { + FILE* f = fopen(argv[1], "w"); + if(f) + { + fprintf(f, "int generated_by_testExe4() { return 0; }\n"); + fclose(f); + } + else + { + fprintf(stderr, "Error writing to %s\n", argv[1]); + return 1; + } + } + return 0; +} |