diff options
Diffstat (limited to 'Tests')
31 files changed, 228 insertions, 28 deletions
diff --git a/Tests/CMakeCommands/link_directories/CMakeLists.txt b/Tests/CMakeCommands/link_directories/CMakeLists.txt new file mode 100644 index 0000000..60c07b6 --- /dev/null +++ b/Tests/CMakeCommands/link_directories/CMakeLists.txt @@ -0,0 +1,30 @@ +cmake_minimum_required(VERSION 3.12) + +project(link_directories LANGUAGES C) + + +link_directories(/A) +link_directories(BEFORE /B) + +set(CMAKE_LINK_DIRECTORIES_BEFORE ON) +link_directories(/C) + +get_directory_property(result LINK_DIRECTORIES) +if (NOT result MATCHES "/C;/B;/A") + message(SEND_ERROR "link_directories not populated the LINK_DIRECTORIES directory property") +endif() + + +add_executable(link_directories EXCLUDE_FROM_ALL LinkDirectoriesExe.c) + +get_target_property(result link_directories LINK_DIRECTORIES) +if (NOT result MATCHES "/C;/B;/A") + message(SEND_ERROR "link_directories not populated the LINK_DIRECTORIES target property") +endif() + + +add_library(imp UNKNOWN IMPORTED) +get_target_property(result imp LINK_DIRECTORIES) +if (result) + message(FATAL_ERROR "link_directories populated the LINK_DIRECTORIES target property") +endif() diff --git a/Tests/CMakeCommands/link_directories/LinkDirectoriesExe.c b/Tests/CMakeCommands/link_directories/LinkDirectoriesExe.c new file mode 100644 index 0000000..8488f4e --- /dev/null +++ b/Tests/CMakeCommands/link_directories/LinkDirectoriesExe.c @@ -0,0 +1,4 @@ +int main(void) +{ + return 0; +} diff --git a/Tests/CMakeCommands/target_link_directories/CMakeLists.txt b/Tests/CMakeCommands/target_link_directories/CMakeLists.txt new file mode 100644 index 0000000..bc7b9b2 --- /dev/null +++ b/Tests/CMakeCommands/target_link_directories/CMakeLists.txt @@ -0,0 +1,40 @@ + +cmake_minimum_required(VERSION 3.12) + +project(target_link_directories LANGUAGES C) + +add_library(target_link_directories SHARED LinkDirectoriesLib.c) +# Test no items +target_link_directories(target_link_directories PRIVATE) + +add_library(target_link_directories_2 SHARED EXCLUDE_FROM_ALL LinkDirectoriesLib.c) +target_link_directories(target_link_directories_2 PRIVATE /private/dir INTERFACE /interface/dir) +get_target_property(result target_link_directories_2 LINK_DIRECTORIES) +if (NOT result MATCHES "/private/dir") + message(SEND_ERROR "${result} target_link_directories not populated the LINK_DIRECTORIES target property") +endif() +get_target_property(result target_link_directories_2 INTERFACE_LINK_DIRECTORIES) +if (NOT result MATCHES "/interface/dir") + message(SEND_ERROR "target_link_directories not populated the INTERFACE_LINK_DIRECTORIES target property of shared library") +endif() + +add_library(target_link_directories_3 STATIC EXCLUDE_FROM_ALL LinkDirectoriesLib.c) +target_link_directories(target_link_directories_3 INTERFACE /interface/dir) +get_target_property(result target_link_directories_3 INTERFACE_LINK_DIRECTORIES) +if (NOT result MATCHES "/interface/dir") + message(SEND_ERROR "target_link_directories not populated the INTERFACE_LINK_DIRECTORIES target property of static library") +endif() + +add_library(target_link_directories_4 SHARED EXCLUDE_FROM_ALL LinkDirectoriesLib.c) +target_link_directories(target_link_directories_4 PRIVATE relative/dir) +get_target_property(result target_link_directories_4 LINK_DIRECTORIES) +if (NOT result MATCHES "${CMAKE_CURRENT_SOURCE_DIR}/relative/dir") + message(SEND_ERROR "target_link_directories not populated the LINK_DIRECTORIES with relative path") +endif() + +add_subdirectory(subdir) +target_link_directories(target_link_directories_5 PRIVATE relative/dir) +get_target_property(result target_link_directories_5 LINK_DIRECTORIES) +if (NOT result MATCHES "${CMAKE_CURRENT_SOURCE_DIR}/relative/dir") + message(SEND_ERROR "target_link_directories not populated the LINK_DIRECTORIES with relative path") +endif() diff --git a/Tests/CMakeCommands/target_link_directories/LinkDirectoriesLib.c b/Tests/CMakeCommands/target_link_directories/LinkDirectoriesLib.c new file mode 100644 index 0000000..9bbd24c --- /dev/null +++ b/Tests/CMakeCommands/target_link_directories/LinkDirectoriesLib.c @@ -0,0 +1,7 @@ +#if defined(_WIN32) +__declspec(dllexport) +#endif + int flags_lib(void) +{ + return 0; +} diff --git a/Tests/CMakeCommands/target_link_directories/subdir/CMakeLists.txt b/Tests/CMakeCommands/target_link_directories/subdir/CMakeLists.txt new file mode 100644 index 0000000..7e7ad2a --- /dev/null +++ b/Tests/CMakeCommands/target_link_directories/subdir/CMakeLists.txt @@ -0,0 +1,2 @@ + +add_library(target_link_directories_5 SHARED EXCLUDE_FROM_ALL ../LinkDirectoriesLib.c) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index fb44077..0de6c41 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -2128,12 +2128,13 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release get_filename_component(ntver "[HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion;CurrentVersion]" NAME) if(WIN32 AND ntver VERSION_GREATER 6.1) # Windows >= 8.0 - macro(add_test_VSWinStorePhone name generator systemName systemVersion) + macro(add_test_VSWinStorePhone name generator systemName systemVersion architecture) add_test(NAME VSWinStorePhone.${name} COMMAND ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/VSWinStorePhone" "${CMake_BINARY_DIR}/Tests/VSWinStorePhone/${name}" --build-generator "${generator}" + --build-generator-platform "${architecture}" --build-project VSWinStorePhone --build-config $<CONFIGURATION> --build-options -DCMAKE_SYSTEM_NAME=${systemName} @@ -2143,14 +2144,14 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release endmacro() if(vs11 AND ws80) - add_test_VSWinStorePhone(vs11-store80-X86 "Visual Studio 11 2012" WindowsStore 8.0) - add_test_VSWinStorePhone(vs11-store80-ARM "Visual Studio 11 2012 ARM" WindowsStore 8.0) - add_test_VSWinStorePhone(vs11-store80-X64 "Visual Studio 11 2012 Win64" WindowsStore 8.0) + add_test_VSWinStorePhone(vs11-store80-X86 "Visual Studio 11 2012" WindowsStore 8.0 Win32) + add_test_VSWinStorePhone(vs11-store80-ARM "Visual Studio 11 2012" WindowsStore 8.0 ARM) + add_test_VSWinStorePhone(vs11-store80-X64 "Visual Studio 11 2012" WindowsStore 8.0 x64) endif() if(vs12 AND ws81) - add_test_VSWinStorePhone(vs12-store81-X86 "Visual Studio 12 2013" WindowsStore 8.1) - add_test_VSWinStorePhone(vs12-store81-ARM "Visual Studio 12 2013 ARM" WindowsStore 8.1) - add_test_VSWinStorePhone(vs12-store81-X64 "Visual Studio 12 2013 Win64" WindowsStore 8.1) + add_test_VSWinStorePhone(vs12-store81-X86 "Visual Studio 12 2013" WindowsStore 8.1 Win32) + add_test_VSWinStorePhone(vs12-store81-ARM "Visual Studio 12 2013" WindowsStore 8.1 ARM) + add_test_VSWinStorePhone(vs12-store81-X64 "Visual Studio 12 2013" WindowsStore 8.1 x64) add_test(NAME VSXaml COMMAND ${CMAKE_CTEST_COMMAND} --build-and-test @@ -2164,22 +2165,23 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release ) endif() if(CMake_TEST_VSWinStorePhone_VS_2017 AND ws10_0) - add_test_VSWinStorePhone(vs15-store10_0-X86 "Visual Studio 15 2017" WindowsStore 10.0) - add_test_VSWinStorePhone(vs15-store10_0-ARM "Visual Studio 15 2017 ARM" WindowsStore 10.0) - add_test_VSWinStorePhone(vs15-store10_0-X64 "Visual Studio 15 2017 Win64" WindowsStore 10.0) + add_test_VSWinStorePhone(vs15-store10_0-X86 "Visual Studio 15 2017" WindowsStore 10.0 Win32) + add_test_VSWinStorePhone(vs15-store10_0-ARM "Visual Studio 15 2017" WindowsStore 10.0 ARM) + add_test_VSWinStorePhone(vs15-store10_0-X64 "Visual Studio 15 2017" WindowsStore 10.0 x64) + add_test_VSWinStorePhone(vs15-store10_0-ARM64 "Visual Studio 15 2017" WindowsStore 10.0 ARM64) endif() if(vs14 AND ws10_0) - add_test_VSWinStorePhone(vs14-store10_0-X86 "Visual Studio 14 2015" WindowsStore 10.0) - add_test_VSWinStorePhone(vs14-store10_0-ARM "Visual Studio 14 2015 ARM" WindowsStore 10.0) - add_test_VSWinStorePhone(vs14-store10_0-X64 "Visual Studio 14 2015 Win64" WindowsStore 10.0) + add_test_VSWinStorePhone(vs14-store10_0-X86 "Visual Studio 14 2015" WindowsStore 10.0 Win32) + add_test_VSWinStorePhone(vs14-store10_0-ARM "Visual Studio 14 2015" WindowsStore 10.0 ARM) + add_test_VSWinStorePhone(vs14-store10_0-X64 "Visual Studio 14 2015" WindowsStore 10.0 x64) endif() if(vs11 AND wp80) - add_test_VSWinStorePhone(vs11-phone80-X86 "Visual Studio 11 2012" WindowsPhone 8.0) - add_test_VSWinStorePhone(vs11-phone80-ARM "Visual Studio 11 2012 ARM" WindowsPhone 8.0) + add_test_VSWinStorePhone(vs11-phone80-X86 "Visual Studio 11 2012" WindowsPhone 8.0 Win32) + add_test_VSWinStorePhone(vs11-phone80-ARM "Visual Studio 11 2012" WindowsPhone 8.0 ARM) endif() if(vs12 AND wp81) - add_test_VSWinStorePhone(vs12-phone81-X86 "Visual Studio 12 2013" WindowsPhone 8.1) - add_test_VSWinStorePhone(vs12-phone81-ARM "Visual Studio 12 2013 ARM" WindowsPhone 8.1) + add_test_VSWinStorePhone(vs12-phone81-X86 "Visual Studio 12 2013" WindowsPhone 8.1 Win32) + add_test_VSWinStorePhone(vs12-phone81-ARM "Visual Studio 12 2013" WindowsPhone 8.1 ARM) endif() endif() @@ -2830,6 +2832,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release ADD_TEST_MACRO(CMakeCommands.add_link_options) ADD_TEST_MACRO(CMakeCommands.target_link_options) + ADD_TEST_MACRO(CMakeCommands.link_directories) + ADD_TEST_MACRO(CMakeCommands.target_link_directories) # The cmake server-mode test requires python for a simple client. find_package(PythonInterp QUIET) diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt index cb048be..c6b7dbc 100644 --- a/Tests/ExportImport/Export/CMakeLists.txt +++ b/Tests/ExportImport/Export/CMakeLists.txt @@ -619,6 +619,18 @@ export(TARGETS testLinkOptions NAMESPACE bld_ APPEND FILE ExportBuildTree.cmake) #------------------------------------------------------------------------------ +# test export of INTERFACE_LINK_DIRECTORIES +add_library(testLinkDirectories INTERFACE) +target_link_directories(testLinkDirectories INTERFACE + $<BUILD_INTERFACE:/interface/build> + $<INSTALL_INTERFACE:interface/install>) + +install(TARGETS testLinkDirectories + EXPORT RequiredExp DESTINATION lib) +export(TARGETS testLinkDirectories NAMESPACE bld_ APPEND FILE ExportBuildTree.cmake) + + +#------------------------------------------------------------------------------ # test export of INTERFACE_LINK_DEPENDS if(CMAKE_GENERATOR MATCHES "Make|Ninja") add_library(testLinkDepends INTERFACE) diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt index 8791a19..67fcc02 100644 --- a/Tests/ExportImport/Import/A/CMakeLists.txt +++ b/Tests/ExportImport/Import/A/CMakeLists.txt @@ -490,6 +490,11 @@ checkForProperty(bld_testLinkOptions "INTERFACE_LINK_OPTIONS" "INTERFACE_FLAG") checkForProperty(Req::testLinkOptions "INTERFACE_LINK_OPTIONS" "INTERFACE_FLAG") #--------------------------------------------------------------------------------- +# check that imported libraries have the expected INTERFACE_LINK_DIRECTORIES property +checkForProperty(bld_testLinkDirectories "INTERFACE_LINK_DIRECTORIES" "/interface/build") +checkForProperty(Req::testLinkDirectories "INTERFACE_LINK_DIRECTORIES" "${CMAKE_INSTALL_PREFIX}/interface/install") + +#--------------------------------------------------------------------------------- # check that imported libraries have the expected INTERFACE_LINK_DEPENDS property if(CMAKE_GENERATOR MATCHES "Make|Ninja") checkForProperty(bld_testLinkDepends "INTERFACE_LINK_DEPENDS" "BUILD_LINK_DEPENDS") diff --git a/Tests/LinkDirectory/External/CMakeLists.txt b/Tests/LinkDirectory/External/CMakeLists.txt index f7c840f..d2a1f9f 100644 --- a/Tests/LinkDirectory/External/CMakeLists.txt +++ b/Tests/LinkDirectory/External/CMakeLists.txt @@ -1,6 +1,20 @@ cmake_minimum_required(VERSION 2.8) project(LinkDirectoryExternal C) + +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_libraries(myexe2 PRIVATE mylibA mylibB) + +add_library (mylibs INTERFACE) +target_link_directories(mylibs INTERFACE lib "${CMAKE_CURRENT_SOURCE_DIR}/../lib") +target_link_libraries(mylibs INTERFACE mylibA mylibB) +add_executable(myexe3 myexe.c) +set_property(TARGET myexe3 PROPERTY OUTPUT_NAME LinkDirectory3) +target_link_libraries(myexe3 PRIVATE mylibs) + + # Test CMP0015 OLD behavior: -L../lib cmake_policy(SET CMP0015 OLD) link_directories(../lib) diff --git a/Tests/RunCMake/CMP0081/CMP0081-Common.cmake b/Tests/RunCMake/CMP0081/CMP0081-Common.cmake new file mode 100644 index 0000000..3ea5277 --- /dev/null +++ b/Tests/RunCMake/CMP0081/CMP0081-Common.cmake @@ -0,0 +1,5 @@ + +enable_language(CXX) + +add_library(foo SHARED empty.cpp) +set_target_properties(foo PROPERTIES LINK_DIRECTORIES "../lib") diff --git a/Tests/RunCMake/CMP0081/CMP0081-NEW-result.txt b/Tests/RunCMake/CMP0081/CMP0081-NEW-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMP0081/CMP0081-NEW-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMP0081/CMP0081-NEW-stderr.txt b/Tests/RunCMake/CMP0081/CMP0081-NEW-stderr.txt new file mode 100644 index 0000000..d31c149 --- /dev/null +++ b/Tests/RunCMake/CMP0081/CMP0081-NEW-stderr.txt @@ -0,0 +1,4 @@ +CMake Error in CMakeLists.txt: + Found relative path while evaluating link directories of "foo": + + "../lib" diff --git a/Tests/RunCMake/CMP0081/CMP0081-NEW.cmake b/Tests/RunCMake/CMP0081/CMP0081-NEW.cmake new file mode 100644 index 0000000..9b927a2 --- /dev/null +++ b/Tests/RunCMake/CMP0081/CMP0081-NEW.cmake @@ -0,0 +1,4 @@ + +cmake_policy(SET CMP0081 NEW) + +include (CMP0081-Common.cmake) diff --git a/Tests/RunCMake/CMP0081/CMP0081-OLD-result.txt b/Tests/RunCMake/CMP0081/CMP0081-OLD-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0081/CMP0081-OLD-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0081/CMP0081-OLD.cmake b/Tests/RunCMake/CMP0081/CMP0081-OLD.cmake new file mode 100644 index 0000000..2e91bf6 --- /dev/null +++ b/Tests/RunCMake/CMP0081/CMP0081-OLD.cmake @@ -0,0 +1,4 @@ + +cmake_policy(SET CMP0081 OLD) + +include (CMP0081-Common.cmake) diff --git a/Tests/RunCMake/CMP0081/CMP0081-WARN-result.txt b/Tests/RunCMake/CMP0081/CMP0081-WARN-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0081/CMP0081-WARN-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0081/CMP0081-WARN-stderr.txt b/Tests/RunCMake/CMP0081/CMP0081-WARN-stderr.txt new file mode 100644 index 0000000..eac0648 --- /dev/null +++ b/Tests/RunCMake/CMP0081/CMP0081-WARN-stderr.txt @@ -0,0 +1,10 @@ +CMake Warning \(dev\) in CMakeLists.txt: + Policy CMP0081 is not set: Relative paths not allowed in LINK_DIRECTORIES + target property. Run "cmake --help-policy CMP0081" for policy details. + Use the cmake_policy command to set the policy and suppress this warning. + + Found relative path while evaluating link directories of "foo": + + "../lib" + +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0081/CMP0081-WARN.cmake b/Tests/RunCMake/CMP0081/CMP0081-WARN.cmake new file mode 100644 index 0000000..33bb21d --- /dev/null +++ b/Tests/RunCMake/CMP0081/CMP0081-WARN.cmake @@ -0,0 +1,2 @@ + +include (CMP0081-Common.cmake) diff --git a/Tests/RunCMake/CMP0081/CMakeLists.txt b/Tests/RunCMake/CMP0081/CMakeLists.txt new file mode 100644 index 0000000..ef2163c --- /dev/null +++ b/Tests/RunCMake/CMP0081/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.1) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0081/RunCMakeTest.cmake b/Tests/RunCMake/CMP0081/RunCMakeTest.cmake new file mode 100644 index 0000000..335d8c5 --- /dev/null +++ b/Tests/RunCMake/CMP0081/RunCMakeTest.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +run_cmake(CMP0081-OLD) +run_cmake(CMP0081-NEW) +run_cmake(CMP0081-WARN) diff --git a/Tests/RunCMake/CMP0081/empty.cpp b/Tests/RunCMake/CMP0081/empty.cpp new file mode 100644 index 0000000..11ec041 --- /dev/null +++ b/Tests/RunCMake/CMP0081/empty.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif + int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 69cb5b7..080d0d0 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -106,6 +106,7 @@ if(CMAKE_SYSTEM_NAME MATCHES Darwin AND CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG) add_RunCMake_test(CMP0068) endif() add_RunCMake_test(CMP0069) +add_RunCMake_test(CMP0081) # The test for Policy 65 requires the use of the # CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS variable, which both the VS and Xcode diff --git a/Tests/RunCMake/CPack/DEB/Helpers.cmake b/Tests/RunCMake/CPack/DEB/Helpers.cmake index e01f81d..9b98ed4 100644 --- a/Tests/RunCMake/CPack/DEB/Helpers.cmake +++ b/Tests/RunCMake/CPack/DEB/Helpers.cmake @@ -1,4 +1,4 @@ -set(ALL_FILES_GLOB "*.deb") +set(ALL_FILES_GLOB "*.deb" "*.ddeb") function(getPackageContent FILE RESULT_VAR) execute_process(COMMAND ${CMAKE_COMMAND} -E env TZ=Etc/UTC ${DPKG_EXECUTABLE} -c "${FILE}" diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake index 91fed3e..91d3cb7 100644 --- a/Tests/RunCMake/CPack/RunCMakeTest.cmake +++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake @@ -6,7 +6,7 @@ include("${RunCMake_SOURCE_DIR}/CPackTestHelpers.cmake") # run_cpack_test args: TEST_NAME "GENERATORS" RUN_CMAKE_BUILD_STEP "PACKAGING_TYPES" run_cpack_test(CUSTOM_BINARY_SPEC_FILE "RPM" false "MONOLITHIC;COMPONENT") run_cpack_test(CUSTOM_NAMES "RPM;DEB;TGZ" true "COMPONENT") -run_cpack_test(DEBUGINFO "RPM" true "COMPONENT") +run_cpack_test(DEBUGINFO "RPM;DEB" true "COMPONENT") run_cpack_test_subtests(DEFAULT_PERMISSIONS "CMAKE_var_set;CPACK_var_set;both_set;invalid_CMAKE_var;invalid_CPACK_var" "RPM;DEB" false "MONOLITHIC;COMPONENT") run_cpack_test(DEPENDENCIES "RPM;DEB" true "COMPONENT") run_cpack_test(DIST "RPM" false "MONOLITHIC") diff --git a/Tests/RunCMake/CPack/VerifyResult.cmake b/Tests/RunCMake/CPack/VerifyResult.cmake index af12d37..345b37f 100644 --- a/Tests/RunCMake/CPack/VerifyResult.cmake +++ b/Tests/RunCMake/CPack/VerifyResult.cmake @@ -92,7 +92,7 @@ if(NOT EXPECTED_FILES_COUNT EQUAL 0) # check that there were no extra files generated foreach(all_files_glob_ IN LISTS ALL_FILES_GLOB) file(GLOB foundAll_ RELATIVE "${bin_dir}" "${all_files_glob_}") - list(APPEND allFoundFiles_ "${foundAll_}") + list(APPEND allFoundFiles_ ${foundAll_}) endforeach() list(LENGTH foundFiles_ foundFilesCount_) diff --git a/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake index c745828..cf2e8ac 100644 --- a/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake +++ b/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake @@ -3,16 +3,39 @@ set(whitespaces_ "[\t\n\r ]*") set(EXPECTED_FILES_COUNT "5") set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE) -set(EXPECTED_FILE_1_NAME "Debuginfo") +if(GENERATOR_TYPE STREQUAL "RPM") + set(NAME "Debuginfo") + set(DEBUG_SUFFIX "debuginfo") + set(PKG "rpm") + set(DEBUG_PKG "rpm") +elseif(GENERATOR_TYPE STREQUAL "DEB") + set(NAME "debuginfo") + set(DEBUG_SUFFIX "dbgsym") + set(PKG "deb") + set(DEBUG_PKG "ddeb") +endif() + +set(EXPECTED_FILE_1_NAME "${NAME}") set(EXPECTED_FILE_1_COMPONENT "applications") set(EXPECTED_FILE_CONTENT_1_LIST "/foo;/foo/test_prog") -set(EXPECTED_FILE_2 "TestDinfo-pkg*-headers.rpm") + +set(EXPECTED_FILE_2 "TestDinfo-pkg*-headers.${PKG}") set(EXPECTED_FILE_CONTENT_2_LIST "/bar;/bar/CMakeLists.txt") -set(EXPECTED_FILE_3 "TestDinfo-pkg*-libs.rpm") + +set(EXPECTED_FILE_3 "TestDinfo-pkg*-libs.${PKG}") set(EXPECTED_FILE_CONTENT_3_LIST "/bas;/bas/libtest_lib.so") -set(EXPECTED_FILE_4_NAME "Debuginfo") -set(EXPECTED_FILE_4_COMPONENT "applications-debuginfo") -set(EXPECTED_FILE_CONTENT_4 ".*/src${whitespaces_}/src/src_1${whitespaces_}/src/src_1/main.cpp.*\.debug.*") -set(EXPECTED_FILE_5 "libs-DebugInfoPackage.rpm") -set(EXPECTED_FILE_CONTENT_5 ".*/src${whitespaces_}/src/src_1${whitespaces_}/src/src_1/test_lib.cpp.*\.debug.*") +set(EXPECTED_FILE_4 "${NAME}-applications-${DEBUG_SUFFIX}*.${DEBUG_PKG}") +if(GENERATOR_TYPE STREQUAL "RPM") + set(EXPECTED_FILE_CONTENT_4 ".*/src${whitespaces_}/src/src_1${whitespaces_}/src/src_1/main.cpp.*\.debug.*") +elseif(GENERATOR_TYPE STREQUAL "DEB") + set(EXPECTED_FILE_CONTENT_4 ".*/usr/lib/debug/.build-id/.*\.debug.*") +endif() + +if(GENERATOR_TYPE STREQUAL "RPM") + set(EXPECTED_FILE_5 "libs-DebugInfoPackage.rpm") + set(EXPECTED_FILE_CONTENT_5 ".*/src${whitespaces_}/src/src_1${whitespaces_}/src/src_1/test_lib.cpp.*\.debug.*") +elseif(GENERATOR_TYPE STREQUAL "DEB") + set(EXPECTED_FILE_5 "TestDinfo-pkg-libs-dbgsym.ddeb") + set(EXPECTED_FILE_CONTENT_5 ".*/usr/lib/debug/.build-id/.*\.debug.*") +endif() diff --git a/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake b/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake index 71457d4..161a36a 100644 --- a/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake +++ b/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake @@ -29,12 +29,16 @@ install(TARGETS test_lib DESTINATION bas COMPONENT libs) set(CPACK_RPM_APPLICATIONS_FILE_NAME "RPM-DEFAULT") set(CPACK_RPM_APPLICATIONS_DEBUGINFO_PACKAGE ON) +set(CPACK_DEBIAN_APPLICATIONS_FILE_NAME "DEB-DEFAULT") +set(CPACK_DEBIAN_APPLICATIONS_DEBUGINFO_PACKAGE ON) # test that components with debuginfo enabled still honor # CPACK_PACKAGE_FILE_NAME setting set(CPACK_RPM_PACKAGE_NAME "Debuginfo") set(CPACK_PACKAGE_FILE_NAME "TestDinfo-pkg") set(CPACK_RPM_LIBS_DEBUGINFO_PACKAGE ON) +set(CPACK_DEBIAN_PACKAGE_NAME "Debuginfo") +set(CPACK_DEBIAN_LIBS_DEBUGINFO_PACKAGE ON) # test debuginfo package rename set(CPACK_RPM_DEBUGINFO_FILE_NAME diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt index 6c861fa..2441a9c 100644 --- a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt +++ b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt @@ -25,6 +25,7 @@ \* CMP0069 \* CMP0073 \* CMP0076 + \* CMP0081 Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/set_property/LINK_DIRECTORIES-stdout.txt b/Tests/RunCMake/set_property/LINK_DIRECTORIES-stdout.txt new file mode 100644 index 0000000..580c373 --- /dev/null +++ b/Tests/RunCMake/set_property/LINK_DIRECTORIES-stdout.txt @@ -0,0 +1,2 @@ +-- Target LINK_DIRECTORIES is 'a;b;c;d;;e' +-- Directory LINK_DIRECTORIES is 'a;b;c;d;;e' diff --git a/Tests/RunCMake/set_property/LINK_DIRECTORIES.cmake b/Tests/RunCMake/set_property/LINK_DIRECTORIES.cmake new file mode 100644 index 0000000..8529ef5 --- /dev/null +++ b/Tests/RunCMake/set_property/LINK_DIRECTORIES.cmake @@ -0,0 +1,3 @@ +include(Common.cmake) +test_target_property(LINK_DIRECTORIES) +test_directory_property(LINK_DIRECTORIES) diff --git a/Tests/RunCMake/set_property/RunCMakeTest.cmake b/Tests/RunCMake/set_property/RunCMakeTest.cmake index 77da703..8d4614c 100644 --- a/Tests/RunCMake/set_property/RunCMakeTest.cmake +++ b/Tests/RunCMake/set_property/RunCMakeTest.cmake @@ -6,6 +6,7 @@ run_cmake(COMPILE_OPTIONS) run_cmake(IMPORTED_GLOBAL) run_cmake(INCLUDE_DIRECTORIES) run_cmake(LINK_OPTIONS) +run_cmake(LINK_DIRECTORIES) run_cmake(LINK_LIBRARIES) run_cmake(SOURCES) run_cmake(TYPE) |