diff options
Diffstat (limited to 'Tests')
21 files changed, 211 insertions, 63 deletions
diff --git a/Tests/CMakeLib/testVisualStudioSlnParser.cxx b/Tests/CMakeLib/testVisualStudioSlnParser.cxx index 5b62f23..5007ab8 100644 --- a/Tests/CMakeLib/testVisualStudioSlnParser.cxx +++ b/Tests/CMakeLib/testVisualStudioSlnParser.cxx @@ -3,7 +3,7 @@ #include "cmVisualStudioSlnData.h" #include "cmVisualStudioSlnParser.h" -#include <cmsys/ios/iostream> +#include <iostream> //---------------------------------------------------------------------------- static bool parsedRight(cmVisualStudioSlnParser& parser, @@ -27,10 +27,10 @@ static bool parsedRight(cmVisualStudioSlnParser& parser, return true; } } - cmsys_ios::cerr << "cmVisualStudioSlnParser mis-parsed " << file - << "." SLN_EXTENSION << "; expected result " << expected - << ", got " << parser.GetParseResult() - << cmsys_ios::endl; + std::cerr << "cmVisualStudioSlnParser mis-parsed " << file + << "." SLN_EXTENSION << "; expected result " << expected + << ", got " << parser.GetParseResult() + << std::endl; return false; } @@ -42,8 +42,8 @@ int testVisualStudioSlnParser(int, char*[]) // Test clean parser if (parser.GetParseResult() != cmVisualStudioSlnParser::ResultOK) { - cmsys_ios::cerr << "cmVisualStudioSlnParser initialisation failed" - << cmsys_ios::endl; + std::cerr << "cmVisualStudioSlnParser initialisation failed" + << std::endl; return 1; } @@ -73,38 +73,38 @@ int testVisualStudioSlnParser(int, char*[]) const size_t expectedProjectCount = sizeof(names) / sizeof(*names); if (projects.size() != expectedProjectCount) { - cmsys_ios::cerr << "cmVisualStudioSlnParser returned bad number of " - << "projects (" << projects.size() << " instead of " - << expectedProjectCount << ')' - << cmsys_ios::endl; + std::cerr << "cmVisualStudioSlnParser returned bad number of " + << "projects (" << projects.size() << " instead of " + << expectedProjectCount << ')' + << std::endl; return 1; } for (size_t idx = 0; idx < expectedProjectCount; ++idx) { if (projects[idx].GetName() != names[idx]) { - cmsys_ios::cerr << "cmVisualStudioSlnParser returned bad project #" - << idx << "; expected \"" << names[idx] << "\", got \"" - << projects[idx].GetName() << '"' - << cmsys_ios::endl; + std::cerr << "cmVisualStudioSlnParser returned bad project #" + << idx << "; expected \"" << names[idx] << "\", got \"" + << projects[idx].GetName() << '"' + << std::endl; return 1; } } if (projects[0].GetRelativePath() != "Utilities\\3rdParty") { - cmsys_ios::cerr << "cmVisualStudioSlnParser returned bad relative path of " - << "project 3rdParty; expected \"Utilities\\3rdParty\", " - << "got \"" << projects[0].GetRelativePath() << '"' - << cmsys_ios::endl; + std::cerr << "cmVisualStudioSlnParser returned bad relative path of " + << "project 3rdParty; expected \"Utilities\\3rdParty\", " + << "got \"" << projects[0].GetRelativePath() << '"' + << std::endl; return 1; } if (projects[2].GetGUID() != "{59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}") { - cmsys_ios::cerr << "cmVisualStudioSlnParser returned bad relative path of " - << "project CMakeLib; expected " - << "\"{59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}\", " - << "got \"" << projects[2].GetGUID() << '"' - << cmsys_ios::endl; + std::cerr << "cmVisualStudioSlnParser returned bad relative path of " + << "project CMakeLib; expected " + << "\"{59BCCCCD-3AD1-4491-B8F4-C5793AC007E2}\", " + << "got \"" << projects[2].GetGUID() << '"' + << std::endl; return 1; } } @@ -119,9 +119,9 @@ int testVisualStudioSlnParser(int, char*[]) } if (!parser.GetParseHadBOM()) { - cmsys_ios::cerr << "cmVisualStudioSlnParser didn't find BOM in bom." - << SLN_EXTENSION - << cmsys_ios::endl; + std::cerr << "cmVisualStudioSlnParser didn't find BOM in bom." + << SLN_EXTENSION + << std::endl; return 1; } @@ -131,9 +131,9 @@ int testVisualStudioSlnParser(int, char*[]) } if (parser.GetParseHadBOM()) { - cmsys_ios::cerr << "cmVisualStudioSlnParser found BOM in nobom." - << SLN_EXTENSION - << cmsys_ios::endl; + std::cerr << "cmVisualStudioSlnParser found BOM in nobom." + << SLN_EXTENSION + << std::endl; return 1; } } diff --git a/Tests/CMakeLib/testXMLParser.cxx b/Tests/CMakeLib/testXMLParser.cxx index 54ed5dc..b5219e2 100644 --- a/Tests/CMakeLib/testXMLParser.cxx +++ b/Tests/CMakeLib/testXMLParser.cxx @@ -2,7 +2,7 @@ #include "cmXMLParser.h" -#include <cmsys/ios/iostream> +#include <iostream> int testXMLParser(int, char*[]) { @@ -10,7 +10,7 @@ int testXMLParser(int, char*[]) cmXMLParser parser; if(!parser.ParseFile(SOURCE_DIR "/testXMLParser.xml")) { - cmsys_ios::cerr << "cmXMLParser failed!" << cmsys_ios::endl; + std::cerr << "cmXMLParser failed!" << std::endl; return 1; } return 0; diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt index 7fdfaa8..2b9e844 100644 --- a/Tests/ExportImport/Export/CMakeLists.txt +++ b/Tests/ExportImport/Export/CMakeLists.txt @@ -127,6 +127,9 @@ target_link_libraries(testLibCycleA testLibCycleB) target_link_libraries(testLibCycleB testLibCycleA) set_property(TARGET testLibCycleA PROPERTY LINK_INTERFACE_MULTIPLICITY 3) +add_library(testLibNoSONAME SHARED testLibNoSONAME.c) +set_property(TARGET testLibNoSONAME PROPERTY NO_SONAME 1) + # Test exporting dependent libraries into different exports add_library(testLibRequired testLibRequired.c) add_library(testLibDepends testLibDepends.c) @@ -467,6 +470,7 @@ install( testExe2lib testLib4lib testLib4libdbg testLib4libopt testLib6 testLib7 testLibCycleA testLibCycleB + testLibNoSONAME cmp0022NEW cmp0022OLD systemlib EXPORT exp @@ -527,6 +531,7 @@ export(TARGETS testExe1 testLib1 testLib2 testLib3 export(TARGETS testExe2 testLib4 testLib5 testLib6 testLib7 testExe3 testExe4 testExe2lib testLib4lib testLib4libdbg testLib4libopt testLibCycleA testLibCycleB + testLibNoSONAME testLibPerConfigDest NAMESPACE bld_ APPEND FILE ExportBuildTree.cmake diff --git a/Tests/ExportImport/Export/testLibNoSONAME.c b/Tests/ExportImport/Export/testLibNoSONAME.c new file mode 100644 index 0000000..2193e1f --- /dev/null +++ b/Tests/ExportImport/Export/testLibNoSONAME.c @@ -0,0 +1,7 @@ +#if defined(_WIN32) || defined(__CYGWIN__) +# define testLibNoSONAME_EXPORT __declspec(dllexport) +#else +# define testLibNoSONAME_EXPORT +#endif + +testLibNoSONAME_EXPORT int testLibNoSONAME(void) { return 0; } diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt index 0f56495..5ce9628 100644 --- a/Tests/ExportImport/Import/A/CMakeLists.txt +++ b/Tests/ExportImport/Import/A/CMakeLists.txt @@ -90,6 +90,50 @@ add_custom_target(check_testLib1_genex ALL -P ${CMAKE_CURRENT_SOURCE_DIR}/check_testLib1_genex.cmake ) +if(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG AND + "${CMAKE_C_CREATE_SHARED_MODULE}" MATCHES "SONAME_FLAG") + foreach(ns exp bld) + get_property(configs TARGET ${ns}_testLib5 PROPERTY IMPORTED_CONFIGURATIONS) + foreach(c ${configs}) + string(TOUPPER "${c}" CONFIG) + get_property(soname TARGET ${ns}_testLib5 PROPERTY IMPORTED_NO_SONAME_${CONFIG}) + if(soname) + message(SEND_ERROR "${ns}_testLib5 has IMPORTED_NO_SONAME_${CONFIG} but should:\n ${soname}") + else() + message(STATUS "${ns}_testLib5 does not have IMPORTED_NO_SONAME_${CONFIG} as expected") + endif() + endforeach() + + get_property(configs TARGET ${ns}_testLibNoSONAME PROPERTY IMPORTED_CONFIGURATIONS) + foreach(c ${configs}) + string(TOUPPER "${c}" CONFIG) + get_property(soname TARGET ${ns}_testLibNoSONAME PROPERTY IMPORTED_NO_SONAME_${CONFIG}) + if(soname) + message(STATUS "${ns}_testLibNoSONAME has IMPORTED_NO_SONAME_${CONFIG} as expected") + else() + message(SEND_ERROR "${ns}_testLibNoSONAME does not have IMPORTED_NO_SONAME_${CONFIG} but should") + endif() + endforeach() + + # Parse the binary to check for SONAME if possible. + if("${CMAKE_EXECUTABLE_FORMAT}" MATCHES "ELF") + find_program(READELF_EXE readelf) + if(READELF_EXE) + add_custom_target(check_${ns}_testLib5_soname ALL COMMAND + ${CMAKE_COMMAND} -Dreadelf=${READELF_EXE} + -Dlib=$<TARGET_FILE:${ns}_testLib5> + -P ${CMAKE_CURRENT_SOURCE_DIR}/check_lib_soname.cmake + ) + add_custom_target(check_${ns}_testLibNoSONAME_soname ALL COMMAND + ${CMAKE_COMMAND} -Dreadelf=${READELF_EXE} + -Dlib=$<TARGET_FILE:${ns}_testLibNoSONAME> + -P ${CMAKE_CURRENT_SOURCE_DIR}/check_lib_nosoname.cmake + ) + endif() + endif() + endforeach() +endif() + add_executable(cmp0022OLD_test cmp0022OLD_test_vs6_1.cpp) target_link_libraries(cmp0022OLD_test bld_cmp0022OLD) add_executable(cmp0022NEW_test cmp0022NEW_test_vs6_1.cpp) diff --git a/Tests/ExportImport/Import/A/check_lib_nosoname.cmake b/Tests/ExportImport/Import/A/check_lib_nosoname.cmake new file mode 100644 index 0000000..6261ff4 --- /dev/null +++ b/Tests/ExportImport/Import/A/check_lib_nosoname.cmake @@ -0,0 +1,7 @@ +execute_process(COMMAND ${readelf} -d ${lib} OUTPUT_FILE ${lib}.readelf.txt) +file(STRINGS ${lib}.readelf.txt soname REGEX "\\(SONAME\\)") +if(soname) + message(FATAL_ERROR "${lib} has soname but should not:\n ${soname}") +else() + message(STATUS "${lib} has no soname as expected:\n ${soname}") +endif() diff --git a/Tests/ExportImport/Import/A/check_lib_soname.cmake b/Tests/ExportImport/Import/A/check_lib_soname.cmake new file mode 100644 index 0000000..7794e80 --- /dev/null +++ b/Tests/ExportImport/Import/A/check_lib_soname.cmake @@ -0,0 +1,7 @@ +execute_process(COMMAND ${readelf} -d ${lib} OUTPUT_FILE ${lib}.readelf.txt) +file(STRINGS ${lib}.readelf.txt soname REGEX "\\(SONAME\\)") +if(soname) + message(STATUS "${lib} has soname as expected:\n ${soname}") +else() + message(FATAL_ERROR "${lib} has no soname but should:\n ${soname}") +endif() diff --git a/Tests/Plugin/CMakeLists.txt b/Tests/Plugin/CMakeLists.txt index ecdece8..2b7bac1 100644 --- a/Tests/Plugin/CMakeLists.txt +++ b/Tests/Plugin/CMakeLists.txt @@ -52,13 +52,8 @@ target_link_libraries(example_mod_1 example_exe) if(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG AND "${CMAKE_C_CREATE_SHARED_MODULE}" MATCHES "SONAME_FLAG") - # Add a second plugin that should not have any soname. - add_library(example_mod_2 MODULE src/example_mod_1.c) - target_link_libraries(example_mod_2 example_exe) - set_property(TARGET example_mod_2 PROPERTY NO_SONAME 1) - # Verify that targets export with proper IMPORTED SONAME properties. - export(TARGETS example_mod_1 example_mod_2 NAMESPACE exp_ + export(TARGETS example_mod_1 NAMESPACE exp_ FILE ${CMAKE_CURRENT_BINARY_DIR}/mods.cmake) include(ExternalProject) @@ -68,7 +63,7 @@ if(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG AND DOWNLOAD_COMMAND "" INSTALL_COMMAND "" ) - add_dependencies(PluginTest example_mod_1 example_mod_2) + add_dependencies(PluginTest example_mod_1) endif() # TODO: diff --git a/Tests/Plugin/PluginTest/CMakeLists.txt b/Tests/Plugin/PluginTest/CMakeLists.txt index 79ef8a9..5626dbc 100644 --- a/Tests/Plugin/PluginTest/CMakeLists.txt +++ b/Tests/Plugin/PluginTest/CMakeLists.txt @@ -6,17 +6,11 @@ include(${CMAKE_CURRENT_BINARY_DIR}/../mods.cmake) get_property(configs TARGET exp_example_mod_1 PROPERTY IMPORTED_CONFIGURATIONS) foreach(c ${configs}) string(TOUPPER "${c}" CONFIG) - get_property(soname1 TARGET exp_example_mod_1 PROPERTY IMPORTED_SONAME_${CONFIG}) - get_property(soname2 TARGET exp_example_mod_2 PROPERTY IMPORTED_NO_SONAME_${CONFIG}) - if(soname1) - message(STATUS "exp_example_mod_1 has IMPORTED_SONAME_${CONFIG} as expected: ${soname1}") + get_property(soname TARGET exp_example_mod_1 PROPERTY IMPORTED_NO_SONAME_${CONFIG}) + if(soname) + message(STATUS "exp_example_mod_1 has IMPORTED_NO_SONAME_${CONFIG} as expected: ${soname}") else() - message(SEND_ERROR "exp_example_mod_1 does not have IMPORTED_SONAME_${CONFIG} but should") - endif() - if(soname2) - message(STATUS "exp_example_mod_2 has IMPORTED_NO_SONAME_${CONFIG} as expected: ${soname2}") - else() - message(SEND_ERROR "exp_example_mod_2 does not have IMPORTED_NO_SONAME_${CONFIG} but should") + message(SEND_ERROR "exp_example_mod_1 does not have IMPORTED_NO_SONAME_${CONFIG} but should") endif() endforeach() @@ -26,8 +20,7 @@ if("${CMAKE_EXECUTABLE_FORMAT}" MATCHES "ELF") if(READELF_EXE) add_custom_target(check_mod_soname ALL COMMAND ${CMAKE_COMMAND} -Dreadelf=${READELF_EXE} - -Dmod1=$<TARGET_FILE:exp_example_mod_1> - -Dmod2=$<TARGET_FILE:exp_example_mod_2> + -Dmod=$<TARGET_FILE:exp_example_mod_1> -P ${CMAKE_CURRENT_SOURCE_DIR}/../check_mod_soname.cmake ) endif() diff --git a/Tests/Plugin/check_mod_soname.cmake b/Tests/Plugin/check_mod_soname.cmake index 3737b45..21a33b1 100644 --- a/Tests/Plugin/check_mod_soname.cmake +++ b/Tests/Plugin/check_mod_soname.cmake @@ -1,14 +1,7 @@ -execute_process(COMMAND ${readelf} -d ${mod1} OUTPUT_FILE ${mod1}.readelf.txt) -execute_process(COMMAND ${readelf} -d ${mod2} OUTPUT_FILE ${mod2}.readelf.txt) -file(STRINGS ${mod1}.readelf.txt soname1 REGEX "\\(SONAME\\)") -file(STRINGS ${mod2}.readelf.txt soname2 REGEX "\\(SONAME\\)") -if(soname1) - message(STATUS "${mod1} has soname as expected: ${soname1}") +execute_process(COMMAND ${readelf} -d ${mod} OUTPUT_FILE ${mod}.readelf.txt) +file(STRINGS ${mod}.readelf.txt soname REGEX "\\(SONAME\\)") +if(soname) + message(FATAL_ERROR "${mod} has soname but should not:\n ${soname}") else() - message(FATAL_ERROR "${mod1} has no soname but should:\n ${soname1}") -endif() -if(soname2) - message(FATAL_ERROR "${mod2} has soname but should not:\n ${soname2}") -else() - message(STATUS "${mod2} has no soname as expected") + message(STATUS "${mod} has no soname as expected") endif() diff --git a/Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion-result.txt b/Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion-stderr.txt b/Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion-stderr.txt new file mode 100644 index 0000000..bf592e7 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at OUTPUT_NAME-recursion.cmake:[0-9]+ \(add_executable\): + Target 'empty1' OUTPUT_NAME depends on itself. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion.cmake b/Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion.cmake new file mode 100644 index 0000000..5cb8050 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion.cmake @@ -0,0 +1,3 @@ +enable_language(C) +add_executable(empty1 empty.c) +set_property(TARGET empty1 PROPERTY OUTPUT_NAME $<TARGET_FILE_NAME:empty1>) diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake index 21fc851..0679024 100644 --- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake +++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake @@ -26,6 +26,7 @@ run_cmake(COMPILE_LANGUAGE-add_library) run_cmake(COMPILE_LANGUAGE-add_test) run_cmake(COMPILE_LANGUAGE-unknown-lang) run_cmake(TARGET_FILE-recursion) +run_cmake(OUTPUT_NAME-recursion) run_cmake(ImportedTarget-TARGET_PDB_FILE) if(LINKER_SUPPORTS_PDB) diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE-recursion.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_FILE-recursion.cmake index 7633be1..e780103 100644 --- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE-recursion.cmake +++ b/Tests/RunCMake/GeneratorExpression/TARGET_FILE-recursion.cmake @@ -1,3 +1,4 @@ enable_language(C) add_executable(empty1 empty.c) +set_property(TARGET empty1 PROPERTY OUTPUT_NAME $<TARGET_FILE_NAME:empty1>) set_property(TARGET empty1 PROPERTY RUNTIME_OUTPUT_DIRECTORY $<TARGET_FILE_DIR:empty1>) diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake index b7de614..ef81739 100644 --- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake +++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake @@ -7,3 +7,35 @@ run_cmake(XcodeObjectNeedsQuote) if (NOT XCODE_VERSION VERSION_LESS 6) run_cmake(XcodePlatformFrameworks) endif() + +# Use a single build tree for a few tests without cleaning. + +if(NOT XCODE_VERSION VERSION_LESS 5) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeBundlesOSX-build) + set(RunCMake_TEST_NO_CLEAN 1) + set(RunCMake_TEST_OPTIONS "-DTEST_IOS=OFF") + + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + + run_cmake(XcodeBundles) + run_cmake_command(XcodeBundles-build ${CMAKE_COMMAND} --build .) + + unset(RunCMake_TEST_BINARY_DIR) + unset(RunCMake_TEST_NO_CLEAN) + unset(RunCMake_TEST_OPTIONS) + + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeBundlesIOS-build) + set(RunCMake_TEST_NO_CLEAN 1) + set(RunCMake_TEST_OPTIONS "-DTEST_IOS=ON") + + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + + run_cmake(XcodeBundles) + run_cmake_command(XcodeBundles-build ${CMAKE_COMMAND} --build .) + + unset(RunCMake_TEST_BINARY_DIR) + unset(RunCMake_TEST_NO_CLEAN) + unset(RunCMake_TEST_OPTIONS) +endif() diff --git a/Tests/RunCMake/XcodeProject/XcodeBundles.cmake b/Tests/RunCMake/XcodeProject/XcodeBundles.cmake new file mode 100644 index 0000000..d5cb51f --- /dev/null +++ b/Tests/RunCMake/XcodeProject/XcodeBundles.cmake @@ -0,0 +1,46 @@ +# check if Xcode and CMake have the same understanding of Bundle layout + +cmake_minimum_required(VERSION 3.3) +enable_language(C) + +if(TEST_IOS) + set(CMAKE_OSX_SYSROOT iphoneos) + set(CMAKE_OSX_ARCHITECTURES "armv7") + set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimulator") + set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO") + set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO") +endif(TEST_IOS) + +# App Bundle + +add_executable(AppBundle MACOSX_BUNDLE main.m) + +add_custom_target(AppBundleTest ALL + COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_FILE:AppBundle>" "$<TARGET_FILE:AppBundle>.old") + +add_dependencies(AppBundleTest AppBundle) + +# Framework (not supported for iOS on Xcode < 6) + +if(NOT TEST_IOS OR NOT XCODE_VERSION VERSION_LESS 6) + add_library(Framework SHARED main.c) + set_target_properties(Framework PROPERTIES FRAMEWORK TRUE) + + add_custom_target(FrameworkTest ALL + COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_FILE:Framework>" "$<TARGET_FILE:Framework>.old") + + add_dependencies(FrameworkTest Framework) +endif() + +# Bundle + +add_library(Bundle MODULE main.c) +set_target_properties(Bundle PROPERTIES BUNDLE TRUE) + +add_custom_target(BundleTest ALL + COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_FILE:Bundle>" "$<TARGET_FILE:Bundle>.old") + +add_dependencies(BundleTest Bundle) diff --git a/Tests/RunCMake/XcodeProject/main.m b/Tests/RunCMake/XcodeProject/main.m new file mode 100644 index 0000000..6dc190a --- /dev/null +++ b/Tests/RunCMake/XcodeProject/main.m @@ -0,0 +1,3 @@ +int main(int argc, const char * argv[]) { + return 1; +} diff --git a/Tests/RunCMake/include_directories/DirectoryBefore-stdout.txt b/Tests/RunCMake/include_directories/DirectoryBefore-stdout.txt new file mode 100644 index 0000000..e986082 --- /dev/null +++ b/Tests/RunCMake/include_directories/DirectoryBefore-stdout.txt @@ -0,0 +1 @@ +-- INCLUDE_DIRECTORIES: '[^;]*/Tests/RunCMake/include_directories/BeforeDir;[^;]*/Tests/RunCMake/include_directories/AfterDir' diff --git a/Tests/RunCMake/include_directories/DirectoryBefore.cmake b/Tests/RunCMake/include_directories/DirectoryBefore.cmake new file mode 100644 index 0000000..be3f663 --- /dev/null +++ b/Tests/RunCMake/include_directories/DirectoryBefore.cmake @@ -0,0 +1,4 @@ +include_directories(AfterDir) +include_directories(BEFORE BeforeDir) +get_property(dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES) +message(STATUS "INCLUDE_DIRECTORIES: '${dirs}'") diff --git a/Tests/RunCMake/include_directories/RunCMakeTest.cmake b/Tests/RunCMake/include_directories/RunCMakeTest.cmake index 54d5e97..57e8274 100644 --- a/Tests/RunCMake/include_directories/RunCMakeTest.cmake +++ b/Tests/RunCMake/include_directories/RunCMakeTest.cmake @@ -5,6 +5,7 @@ set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/NotDefa run_cmake(NotFoundContent) run_cmake(DebugIncludes) +run_cmake(DirectoryBefore) run_cmake(TID-bad-target) run_cmake(ImportedTarget) run_cmake(CMP0021) |