diff options
author | Brad King <brad.king@kitware.com> | 2015-09-22 17:57:08 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-09-22 17:57:08 (GMT) |
commit | 2e6063068c94d4045e699fed51e6d1e9af344bbf (patch) | |
tree | d11025f71134b3238e52655640dcdf2158425597 /Tests/ExportImport | |
parent | 81739e9215ef10d870f14404b0ec5eb4bee16ce4 (diff) | |
parent | 3bb707f0a1408dc0381ecbf4ec934e9f14d8927c (diff) | |
download | CMake-2e6063068c94d4045e699fed51e6d1e9af344bbf.zip CMake-2e6063068c94d4045e699fed51e6d1e9af344bbf.tar.gz CMake-2e6063068c94d4045e699fed51e6d1e9af344bbf.tar.bz2 |
Merge branch 'improve-variable-help-formatting' into revert-cmake-W-options
Resolve conflicts in
Help/variable/CMAKE_ERROR_DEPRECATED.rst
Help/variable/CMAKE_WARN_DEPRECATED.rst
by integrating changes from both sides.
Diffstat (limited to 'Tests/ExportImport')
-rw-r--r-- | Tests/ExportImport/Export/CMakeLists.txt | 17 | ||||
-rw-r--r-- | Tests/ExportImport/Export/testExe4.c | 24 | ||||
-rw-r--r-- | Tests/ExportImport/Import/A/CMakeLists.txt | 12 | ||||
-rw-r--r-- | Tests/ExportImport/Import/A/imp_testExe1.c | 3 |
4 files changed, 53 insertions, 3 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; +} diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt index a74bad1..0f56495 100644 --- a/Tests/ExportImport/Import/A/CMakeLists.txt +++ b/Tests/ExportImport/Import/A/CMakeLists.txt @@ -19,11 +19,17 @@ add_custom_command( COMMAND exp_testExe3 ${Import_BINARY_DIR}/exp_generated3.c DEPENDS exp_testExe3 ) +add_custom_command( + OUTPUT ${Import_BINARY_DIR}/exp_generated4.c + COMMAND exp_testExe4 ${Import_BINARY_DIR}/exp_generated4.c + DEPENDS exp_testExe4 + ) add_executable(imp_testExe1 imp_testExe1.c ${Import_BINARY_DIR}/exp_generated.c ${Import_BINARY_DIR}/exp_generated3.c + ${Import_BINARY_DIR}/exp_generated4.c ) # Try linking to a library imported from the install tree. @@ -53,11 +59,17 @@ add_custom_command( COMMAND bld_testExe3 ${Import_BINARY_DIR}/bld_generated3.c DEPENDS bld_testExe3 ) +add_custom_command( + OUTPUT ${Import_BINARY_DIR}/bld_generated4.c + COMMAND bld_testExe4 ${Import_BINARY_DIR}/bld_generated4.c + DEPENDS bld_testExe4 + ) add_executable(imp_testExe1b imp_testExe1.c ${Import_BINARY_DIR}/bld_generated.c ${Import_BINARY_DIR}/bld_generated3.c + ${Import_BINARY_DIR}/bld_generated4.c ) # Try linking to a library imported from the build tree. diff --git a/Tests/ExportImport/Import/A/imp_testExe1.c b/Tests/ExportImport/Import/A/imp_testExe1.c index 56cdd2c..0a74309 100644 --- a/Tests/ExportImport/Import/A/imp_testExe1.c +++ b/Tests/ExportImport/Import/A/imp_testExe1.c @@ -1,5 +1,6 @@ extern int generated_by_testExe1(); extern int generated_by_testExe3(); +extern int generated_by_testExe4(); extern int testLib2(); extern int testLib3(); extern int testLib4(); @@ -24,5 +25,5 @@ int main() return (testLib2() + generated_by_testExe1() + testLib3() + testLib4() + testLib5() + testLib6() + testLib7() + testLibCycleA1() + testLibPerConfigDest() - + generated_by_testExe3() + testLib4lib() + testLib4libcfg()); + + generated_by_testExe3() + generated_by_testExe4() + testLib4lib() + testLib4libcfg()); } |