From 248d0570c9016392feb841ffce6ac77e194aefe8 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 16 Jun 2020 10:50:27 -0400 Subject: Tests: Factor out RunCMake.file-GET_RUNTIME_DEPENDENCIES test Move the `file(GET_RUNTIME_DEPENDENCIES)` cases out of `RunCMake.install`. --- Tests/RunCMake/CMakeLists.txt | 6 +- .../file-GET_RUNTIME_DEPENDENCIES/CMakeLists.txt | 3 + .../RunCMakeTest.cmake | 55 ++++++ ...le-GET_RUNTIME_DEPENDENCIES-badargs1-result.txt | 1 + ...le-GET_RUNTIME_DEPENDENCIES-badargs1-stderr.txt | 18 ++ .../file-GET_RUNTIME_DEPENDENCIES-badargs1.cmake | 2 + ...le-GET_RUNTIME_DEPENDENCIES-badargs2-result.txt | 1 + ...le-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt | 23 +++ .../file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake | 15 ++ ...-GET_RUNTIME_DEPENDENCIES-linux-all-check.cmake | 44 +++++ ...e-GET_RUNTIME_DEPENDENCIES-linux-all-stderr.txt | 119 ++++++++++++ ...TIME_DEPENDENCIES-linux-conflict-all-result.txt | 1 + ...TIME_DEPENDENCIES-linux-conflict-all-stderr.txt | 7 + ...e-GET_RUNTIME_DEPENDENCIES-linux-conflict.cmake | 54 ++++++ ...NTIME_DEPENDENCIES-linux-notfile-all-result.txt | 1 + ...NTIME_DEPENDENCIES-linux-notfile-all-stderr.txt | 5 + ...le-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake | 30 +++ ...ME_DEPENDENCIES-linux-unresolved-all-result.txt | 1 + ...ME_DEPENDENCIES-linux-unresolved-all-stderr.txt | 2 + ...GET_RUNTIME_DEPENDENCIES-linux-unresolved.cmake | 18 ++ .../file-GET_RUNTIME_DEPENDENCIES-linux.cmake | 169 ++++++++++++++++ .../file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c | 9 + .../file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c | 8 + ...-GET_RUNTIME_DEPENDENCIES-macos-all-check.cmake | 157 +++++++++++++++ ...TIME_DEPENDENCIES-macos-conflict-all-result.txt | 1 + ...TIME_DEPENDENCIES-macos-conflict-all-stderr.txt | 7 + ...e-GET_RUNTIME_DEPENDENCIES-macos-conflict.cmake | 55 ++++++ ...NTIME_DEPENDENCIES-macos-notfile-all-result.txt | 1 + ...NTIME_DEPENDENCIES-macos-notfile-all-stderr.txt | 5 + ...le-GET_RUNTIME_DEPENDENCIES-macos-notfile.cmake | 30 +++ ...ME_DEPENDENCIES-macos-unresolved-all-result.txt | 1 + ...ME_DEPENDENCIES-macos-unresolved-all-stderr.txt | 2 + ...GET_RUNTIME_DEPENDENCIES-macos-unresolved.cmake | 18 ++ .../file-GET_RUNTIME_DEPENDENCIES-macos.cmake | 216 +++++++++++++++++++++ .../file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c | 7 + .../file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c | 6 + ...ile-GET_RUNTIME_DEPENDENCIES-project-stderr.txt | 13 ++ .../file-GET_RUNTIME_DEPENDENCIES-project.cmake | 1 + ...GET_RUNTIME_DEPENDENCIES-unsupported-result.txt | 1 + ...GET_RUNTIME_DEPENDENCIES-unsupported-stderr.txt | 5 + ...file-GET_RUNTIME_DEPENDENCIES-unsupported.cmake | 2 + ...EPENDENCIES-variable-propagation-all-result.txt | 1 + ...EPENDENCIES-variable-propagation-all-stderr.txt | 6 + ...EPENDENCIES-variable-propagation-dev-result.txt | 1 + ...EPENDENCIES-variable-propagation-dev-stderr.txt | 6 + ...RUNTIME_DEPENDENCIES-variable-propagation.cmake | 17 ++ ...ET_RUNTIME_DEPENDENCIES-windows-all-check.cmake | 38 ++++ ...ME_DEPENDENCIES-windows-conflict-all-result.txt | 1 + ...ME_DEPENDENCIES-windows-conflict-all-stderr.txt | 7 + ...GET_RUNTIME_DEPENDENCIES-windows-conflict.cmake | 47 +++++ ...IME_DEPENDENCIES-windows-notfile-all-result.txt | 1 + ...IME_DEPENDENCIES-windows-notfile-all-stderr.txt | 5 + ...-GET_RUNTIME_DEPENDENCIES-windows-notfile.cmake | 28 +++ ..._DEPENDENCIES-windows-unresolved-all-result.txt | 1 + ..._DEPENDENCIES-windows-unresolved-all-stderr.txt | 2 + ...T_RUNTIME_DEPENDENCIES-windows-unresolved.cmake | 18 ++ .../file-GET_RUNTIME_DEPENDENCIES-windows.cmake | 114 +++++++++++ .../file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c | 7 + .../file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c | 6 + Tests/RunCMake/install/CMakeLists.txt | 3 - Tests/RunCMake/install/RunCMakeTest.cmake | 39 ---- ...le-GET_RUNTIME_DEPENDENCIES-badargs1-result.txt | 1 - ...le-GET_RUNTIME_DEPENDENCIES-badargs1-stderr.txt | 18 -- .../file-GET_RUNTIME_DEPENDENCIES-badargs1.cmake | 2 - ...le-GET_RUNTIME_DEPENDENCIES-badargs2-result.txt | 1 - ...le-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt | 23 --- .../file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake | 15 -- ...-GET_RUNTIME_DEPENDENCIES-linux-all-check.cmake | 44 ----- ...e-GET_RUNTIME_DEPENDENCIES-linux-all-stderr.txt | 119 ------------ ...TIME_DEPENDENCIES-linux-conflict-all-result.txt | 1 - ...TIME_DEPENDENCIES-linux-conflict-all-stderr.txt | 7 - ...e-GET_RUNTIME_DEPENDENCIES-linux-conflict.cmake | 54 ------ ...NTIME_DEPENDENCIES-linux-notfile-all-result.txt | 1 - ...NTIME_DEPENDENCIES-linux-notfile-all-stderr.txt | 5 - ...le-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake | 30 --- ...ME_DEPENDENCIES-linux-unresolved-all-result.txt | 1 - ...ME_DEPENDENCIES-linux-unresolved-all-stderr.txt | 2 - ...GET_RUNTIME_DEPENDENCIES-linux-unresolved.cmake | 18 -- .../file-GET_RUNTIME_DEPENDENCIES-linux.cmake | 169 ---------------- .../file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c | 9 - .../file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c | 8 - ...-GET_RUNTIME_DEPENDENCIES-macos-all-check.cmake | 157 --------------- ...TIME_DEPENDENCIES-macos-conflict-all-result.txt | 1 - ...TIME_DEPENDENCIES-macos-conflict-all-stderr.txt | 7 - ...e-GET_RUNTIME_DEPENDENCIES-macos-conflict.cmake | 55 ------ ...NTIME_DEPENDENCIES-macos-notfile-all-result.txt | 1 - ...NTIME_DEPENDENCIES-macos-notfile-all-stderr.txt | 5 - ...le-GET_RUNTIME_DEPENDENCIES-macos-notfile.cmake | 30 --- ...ME_DEPENDENCIES-macos-unresolved-all-result.txt | 1 - ...ME_DEPENDENCIES-macos-unresolved-all-stderr.txt | 2 - ...GET_RUNTIME_DEPENDENCIES-macos-unresolved.cmake | 18 -- .../file-GET_RUNTIME_DEPENDENCIES-macos.cmake | 216 --------------------- .../file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c | 7 - .../file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c | 6 - ...ile-GET_RUNTIME_DEPENDENCIES-project-stderr.txt | 13 -- .../file-GET_RUNTIME_DEPENDENCIES-project.cmake | 1 - ...GET_RUNTIME_DEPENDENCIES-unsupported-result.txt | 1 - ...GET_RUNTIME_DEPENDENCIES-unsupported-stderr.txt | 5 - ...file-GET_RUNTIME_DEPENDENCIES-unsupported.cmake | 2 - ...EPENDENCIES-variable-propagation-all-result.txt | 1 - ...EPENDENCIES-variable-propagation-all-stderr.txt | 6 - ...EPENDENCIES-variable-propagation-dev-result.txt | 1 - ...EPENDENCIES-variable-propagation-dev-stderr.txt | 6 - ...RUNTIME_DEPENDENCIES-variable-propagation.cmake | 17 -- ...ET_RUNTIME_DEPENDENCIES-windows-all-check.cmake | 38 ---- ...ME_DEPENDENCIES-windows-conflict-all-result.txt | 1 - ...ME_DEPENDENCIES-windows-conflict-all-stderr.txt | 7 - ...GET_RUNTIME_DEPENDENCIES-windows-conflict.cmake | 47 ----- ...IME_DEPENDENCIES-windows-notfile-all-result.txt | 1 - ...IME_DEPENDENCIES-windows-notfile-all-stderr.txt | 5 - ...-GET_RUNTIME_DEPENDENCIES-windows-notfile.cmake | 28 --- ..._DEPENDENCIES-windows-unresolved-all-result.txt | 1 - ..._DEPENDENCIES-windows-unresolved-all-stderr.txt | 2 - ...T_RUNTIME_DEPENDENCIES-windows-unresolved.cmake | 18 -- .../file-GET_RUNTIME_DEPENDENCIES-windows.cmake | 114 ----------- .../file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c | 7 - .../file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c | 6 - 117 files changed, 1425 insertions(+), 1405 deletions(-) create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMakeLists.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/RunCMakeTest.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs1-result.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs1-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs1.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs2-result.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-all-check.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-all-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-result.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-conflict.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-result.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-result.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-all-check.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-result.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-conflict.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-result.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-notfile.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-result.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-project-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-project.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-unsupported-result.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-unsupported-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-unsupported.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-all-result.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-all-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-dev-result.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-dev-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-all-check.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-result.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-conflict.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-result.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-notfile.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-result.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-result.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-stderr.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1.cmake delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-result.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-check.cmake delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-stderr.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-result.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-stderr.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict.cmake delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-result.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-stderr.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-result.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-stderr.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved.cmake delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux.cmake delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-all-check.cmake delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-result.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-stderr.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict.cmake delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-result.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-stderr.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile.cmake delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-result.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-stderr.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved.cmake delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos.cmake delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project-stderr.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project.cmake delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-result.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-stderr.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported.cmake delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-all-result.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-all-stderr.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-dev-result.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-dev-stderr.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-variable-propagation.cmake delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-all-check.cmake delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-result.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-stderr.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict.cmake delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-result.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-stderr.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile.cmake delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-result.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-stderr.txt delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved.cmake delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows.cmake delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c delete mode 100644 Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 58a859f..866e7c0 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -522,11 +522,15 @@ else() set(NO_NAMELINK 0) endif() -add_RunCMake_test(install -DNO_NAMELINK=${NO_NAMELINK} -DCYGWIN=${CYGWIN} -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID} +add_RunCMake_test(install -DNO_NAMELINK=${NO_NAMELINK} -DCYGWIN=${CYGWIN} -DCMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN=${CMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN} -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DCMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG=${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG} -DCMAKE_EXECUTABLE_FORMAT=${CMAKE_EXECUTABLE_FORMAT} + ) + +add_RunCMake_test(file-GET_RUNTIME_DEPENDENCIES + -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID} -DCMake_INSTALL_NAME_TOOL_BUG=${CMake_INSTALL_NAME_TOOL_BUG} ) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMakeLists.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMakeLists.txt new file mode 100644 index 0000000..2632ffa --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.16) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/RunCMakeTest.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/RunCMakeTest.cmake new file mode 100644 index 0000000..da5069c --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/RunCMakeTest.cmake @@ -0,0 +1,55 @@ +cmake_minimum_required(VERSION 3.16) +include(RunCMake) + +# Function to build and install a project. +function(run_install_test case) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${case}-build) + set(RunCMake_TEST_NO_CLEAN 1) + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + run_cmake(${case}) + run_cmake_command(${case}-build ${CMAKE_COMMAND} --build . --config Debug) + # Check "all" components. + set(CMAKE_INSTALL_PREFIX ${RunCMake_TEST_BINARY_DIR}/root-all) + run_cmake_command(${case}-all ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DBUILD_TYPE=Debug -P cmake_install.cmake) +endfunction() + +if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") + if(NOT CMake_INSTALL_NAME_TOOL_BUG) + run_install_test(file-GET_RUNTIME_DEPENDENCIES-macos) + run_install_test(file-GET_RUNTIME_DEPENDENCIES-macos-unresolved) + run_install_test(file-GET_RUNTIME_DEPENDENCIES-macos-conflict) + run_install_test(file-GET_RUNTIME_DEPENDENCIES-macos-notfile) + endif() + run_cmake(file-GET_RUNTIME_DEPENDENCIES-project) + run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs1) + run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs2) +elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") + run_install_test(file-GET_RUNTIME_DEPENDENCIES-windows) + run_install_test(file-GET_RUNTIME_DEPENDENCIES-windows-unresolved) + run_install_test(file-GET_RUNTIME_DEPENDENCIES-windows-conflict) + run_install_test(file-GET_RUNTIME_DEPENDENCIES-windows-notfile) + run_cmake(file-GET_RUNTIME_DEPENDENCIES-project) + run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs1) + run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs2) +elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") + if(DEFINED ENV{LDFLAGS}) + # Some setups prebake disable-new-dtags into LDFLAGS + string(REPLACE "-Wl,--disable-new-dtags" "" new_ldflags "$ENV{LDFLAGS}") + set(ENV{LDFLAGS} "${new_ldflags}") + endif() + + if(NOT CMAKE_C_COMPILER_ID MATCHES "^XL") + run_install_test(file-GET_RUNTIME_DEPENDENCIES-linux) + endif() + run_install_test(file-GET_RUNTIME_DEPENDENCIES-linux-unresolved) + run_install_test(file-GET_RUNTIME_DEPENDENCIES-linux-conflict) + run_install_test(file-GET_RUNTIME_DEPENDENCIES-linux-notfile) + run_cmake(file-GET_RUNTIME_DEPENDENCIES-project) + run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs1) + run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs2) +else() + run_cmake(file-GET_RUNTIME_DEPENDENCIES-unsupported) +endif() + +run_install_test(file-GET_RUNTIME_DEPENDENCIES-variable-propagation) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs1-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs1-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs1-stderr.txt new file mode 100644 index 0000000..b66d1fe --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs1-stderr.txt @@ -0,0 +1,18 @@ +^CMake Warning \(dev\) at file-GET_RUNTIME_DEPENDENCIES-badargs1\.cmake:[0-9]+ \(file\): + You have used file\(GET_RUNTIME_DEPENDENCIES\) in project mode\. This is + probably not what you intended to do\. Instead, please consider using it in + an install\(CODE\) or install\(SCRIPT\) command\. For example: + + install\(CODE \[\[ + file\(GET_RUNTIME_DEPENDENCIES + # \.\.\. + \) + ]]\) +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) +This warning is for project developers\. Use -Wno-dev to suppress it\. + +CMake Error at file-GET_RUNTIME_DEPENDENCIES-badargs1\.cmake:[0-9]+ \(file\): + file Unrecognized argument: "invalid" +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs1.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs1.cmake new file mode 100644 index 0000000..f3b8ce4 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs1.cmake @@ -0,0 +1,2 @@ +file(GET_RUNTIME_DEPENDENCIES invalid) +message(FATAL_ERROR "This message should not be displayed") diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs2-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt new file mode 100644 index 0000000..50fa81f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt @@ -0,0 +1,23 @@ +^CMake Warning \(dev\) at file-GET_RUNTIME_DEPENDENCIES-badargs2\.cmake:[0-9]+ \(file\): + You have used file\(GET_RUNTIME_DEPENDENCIES\) in project mode\. This is + probably not what you intended to do\. Instead, please consider using it in + an install\(CODE\) or install\(SCRIPT\) command\. For example: + + install\(CODE \[\[ + file\(GET_RUNTIME_DEPENDENCIES + # \.\.\. + \) + ]]\) +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) +This warning is for project developers\. Use -Wno-dev to suppress it\. + +CMake Error at file-GET_RUNTIME_DEPENDENCIES-badargs2\.cmake:[0-9]+ \(file\): + file Keywords missing values: + + RESOLVED_DEPENDENCIES_VAR + UNRESOLVED_DEPENDENCIES_VAR + CONFLICTING_DEPENDENCIES_PREFIX + BUNDLE_EXECUTABLE +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake new file mode 100644 index 0000000..ac6af85 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake @@ -0,0 +1,15 @@ +file(GET_RUNTIME_DEPENDENCIES + RESOLVED_DEPENDENCIES_VAR + UNRESOLVED_DEPENDENCIES_VAR + CONFLICTING_DEPENDENCIES_PREFIX + BUNDLE_EXECUTABLE + EXECUTABLES + LIBRARIES + MODULES + DIRECTORIES + PRE_INCLUDE_REGEXES + PRE_EXCLUDE_REGEXES + POST_INCLUDE_REGEXES + POST_EXCLUDE_REGEXES + ) +message(FATAL_ERROR "This message should not be displayed") diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-all-check.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-all-check.cmake new file mode 100644 index 0000000..ab482f2 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-all-check.cmake @@ -0,0 +1,44 @@ +function(check_contents filename contents_regex) + if(EXISTS "${CMAKE_INSTALL_PREFIX}/${filename}") + file(READ "${CMAKE_INSTALL_PREFIX}/${filename}" contents) + if(NOT contents MATCHES "${contents_regex}") + string(APPEND RunCMake_TEST_FAILED "File contents: + ${contents} +do not match what we expected: + ${contents_regex} +in file: + ${CMAKE_INSTALL_PREFIX}/${filename}\n") + set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) + endif() + else() + string(APPEND RunCMake_TEST_FAILED "File ${CMAKE_INSTALL_PREFIX}/${filename} does not exist") + set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) + endif() +endfunction() + +set(_check + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/libtest_rpath\.so]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/libtest_runpath\.so]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath/librpath\.so]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_parent/librpath_parent\.so]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search/librpath_search\.so]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath/librunpath\.so]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search/librunpath_search\.so]] + ) +check_contents(deps/deps1.txt "^${_check}$") +check_contents(deps/deps2.txt "^${_check}$") +check_contents(deps/deps3.txt "^${_check}$") +set(_check + [[librpath_unresolved\.so]] + [[librunpath_parent_unresolved\.so]] + [[librunpath_unresolved\.so]] + ) +check_contents(deps/udeps1.txt "^${_check}$") +check_contents(deps/udeps2.txt "^${_check}$") +check_contents(deps/udeps3.txt "^${_check}$") +set(_check + "^libconflict\\.so:[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/conflict/libconflict\\.so;[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/conflict2/libconflict\\.so\n$" + ) +check_contents(deps/cdeps1.txt "${_check}") +check_contents(deps/cdeps2.txt "${_check}") +check_contents(deps/cdeps3.txt "${_check}") diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-all-stderr.txt new file mode 100644 index 0000000..7ba3033 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-all-stderr.txt @@ -0,0 +1,119 @@ +^CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librpath_search_postexcluded\.so found in search directory: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search_postexcluded + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librpath_search\.so found in search directory: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librunpath_search_postexcluded\.so found in search directory: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search_postexcluded + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librunpath_search\.so found in search directory: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librpath_search_postexcluded\.so found in search directory: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search_postexcluded + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librpath_search\.so found in search directory: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librunpath_search_postexcluded\.so found in search directory: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search_postexcluded + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librunpath_search\.so found in search directory: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librpath_search_postexcluded\.so found in search directory: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search_postexcluded + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librpath_search\.so found in search directory: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librunpath_search_postexcluded\.so found in search directory: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search_postexcluded + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librunpath_search\.so found in search directory: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-stderr.txt new file mode 100644 index 0000000..37f283a --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-stderr.txt @@ -0,0 +1,7 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): + file Multiple conflicting paths found for librpath\.so: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-build/root-all/lib/rpath1/librpath\.so + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-build/root-all/lib/rpath2/librpath\.so$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-conflict.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-conflict.cmake new file mode 100644 index 0000000..f719499 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-conflict.cmake @@ -0,0 +1,54 @@ +enable_language(C) + +set(test1_names rpath) +set(test2_names rpath) + +file(WRITE "${CMAKE_BINARY_DIR}/rpath.c" "void rpath(void) {}\n") +add_library(rpath SHARED "${CMAKE_BINARY_DIR}/rpath.c") +install(TARGETS rpath DESTINATION lib/rpath1) +install(TARGETS rpath DESTINATION lib/rpath2) + +file(REMOVE "${CMAKE_BINARY_DIR}/test1.c") +add_library(test1 SHARED "${CMAKE_BINARY_DIR}/test1.c") +foreach(name ${test1_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "void test1(void)\n{\n") +foreach(name ${test1_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test1.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "}\n") + +target_link_libraries(test1 PRIVATE ${test1_names}) +set_property(TARGET test1 PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/lib/rpath1" + ) + +file(REMOVE "${CMAKE_BINARY_DIR}/test2.c") +add_library(test2 SHARED "${CMAKE_BINARY_DIR}/test2.c") +foreach(name ${test2_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "void test2(void)\n{\n") +foreach(name ${test2_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test2.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "}\n") + +target_link_libraries(test2 PRIVATE ${test2_names}) +set_property(TARGET test2 PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/lib/rpath2" + ) + +install(TARGETS test1 test2 DESTINATION lib) + +install(CODE [[ + file(GET_RUNTIME_DEPENDENCIES + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/lib/$" + "${CMAKE_INSTALL_PREFIX}/lib/$" + PRE_INCLUDE_REGEXES "^librpath\\.so$" + PRE_EXCLUDE_REGEXES ".*" + ) + message(FATAL_ERROR "This message should not be displayed") + ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-stderr.txt new file mode 100644 index 0000000..4e56787 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): + file Failed to run objdump on: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-build/root-all/bin/\.\./lib/libtest\.so$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake new file mode 100644 index 0000000..6567438 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake @@ -0,0 +1,30 @@ +enable_language(C) +cmake_policy(SET CMP0095 NEW) + +file(WRITE "${CMAKE_BINARY_DIR}/test.c" "void test(void) {}\n") +file(WRITE "${CMAKE_BINARY_DIR}/main.c" [[extern void test(void); + +int main(void) +{ + test(); + return 0; +} +]]) + +add_library(test SHARED "${CMAKE_BINARY_DIR}/test.c") +add_executable(exe "${CMAKE_BINARY_DIR}/main.c") +target_link_libraries(exe PRIVATE test) +set_property(TARGET exe PROPERTY INSTALL_RPATH "\${ORIGIN}/../lib") + +install(TARGETS exe DESTINATION bin) + +install(CODE [[ + file(MAKE_DIRECTORY "${CMAKE_INSTALL_PREFIX}/lib/$") + file(GET_RUNTIME_DEPENDENCIES + EXECUTABLES + "${CMAKE_INSTALL_PREFIX}/bin/$" + PRE_INCLUDE_REGEXES "^libtest\\.so$" + PRE_EXCLUDE_REGEXES ".*" + ) + message(FATAL_ERROR "This message should not be displayed") + ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-stderr.txt new file mode 100644 index 0000000..eaca512 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): + file Could not resolve file libunresolved\.so$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved.cmake new file mode 100644 index 0000000..3efa305 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved.cmake @@ -0,0 +1,18 @@ +enable_language(C) + +file(WRITE "${CMAKE_BINARY_DIR}/testlib.c" "extern void unresolved(void);\nvoid testlib(void)\n{\n unresolved();\n}\n") +add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c") +file(WRITE "${CMAKE_BINARY_DIR}/unresolved.c" "void unresolved(void) {}\n") +add_library(unresolved SHARED "${CMAKE_BINARY_DIR}/unresolved.c") +target_link_libraries(testlib PRIVATE unresolved) +install(TARGETS testlib DESTINATION lib) + +install(CODE [[ + file(GET_RUNTIME_DEPENDENCIES + PRE_INCLUDE_REGEXES "^libunresolved\\.so$" + PRE_EXCLUDE_REGEXES ".*" + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/lib/$" + ) + message(FATAL_ERROR "This message should not be displayed") + ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux.cmake new file mode 100644 index 0000000..bd0f9f1 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux.cmake @@ -0,0 +1,169 @@ +enable_language(C) +cmake_policy(SET CMP0095 NEW) + +set(test_rpath_names + preexcluded + rpath_postexcluded + rpath + rpath_parent_postexcluded + rpath_parent + rpath_origin_postexcluded + rpath_origin + rpath_search_postexcluded + rpath_search + rpath_unresolved + conflict + ) +set(test_runpath_names + runpath_postexcluded + runpath + runpath_origin_postexcluded + runpath_origin + runpath_parent_unresolved + runpath_search_postexcluded + runpath_search + runpath_unresolved + ) + +file(REMOVE "${CMAKE_BINARY_DIR}/test_rpath.c") +add_library(test_rpath SHARED "${CMAKE_BINARY_DIR}/test_rpath.c") +foreach(name ${test_rpath_names}) + file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "void ${name}(void) {}\n") + add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c") + + file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" "extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" "void test_rpath(void)\n{\n") +foreach(name ${test_rpath_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" "}\n") + +install(TARGETS rpath_postexcluded DESTINATION lib/rpath_postexcluded) +install(TARGETS rpath DESTINATION lib/rpath) +install(TARGETS rpath_origin_postexcluded DESTINATION lib/rpath_origin_postexcluded) +install(TARGETS rpath_origin DESTINATION lib/rpath_origin) +install(TARGETS rpath_parent_postexcluded DESTINATION lib/rpath_parent_postexcluded) +install(TARGETS rpath rpath_origin rpath_parent DESTINATION lib/rpath_parent) +install(TARGETS rpath_search_postexcluded DESTINATION lib/rpath_search_postexcluded) +install(TARGETS rpath rpath_origin rpath_parent rpath_search DESTINATION lib/rpath_search) +install(TARGETS conflict DESTINATION lib/conflict) + +target_link_libraries(test_rpath PRIVATE ${test_rpath_names}) +set_property(TARGET test_rpath PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/lib/rpath_postexcluded" + "${CMAKE_BINARY_DIR}/root-all/lib/rpath" + "\$ORIGIN/rpath_origin_postexcluded" + "\${ORIGIN}/rpath_origin" + "${CMAKE_BINARY_DIR}/root-all/lib/conflict" + ) +target_link_options(test_rpath PRIVATE -Wl,--disable-new-dtags) + +file(REMOVE "${CMAKE_BINARY_DIR}/test_runpath.c") +add_library(test_runpath SHARED "${CMAKE_BINARY_DIR}/test_runpath.c") +foreach(name ${test_runpath_names} rpath conflict) + file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "void ${name}(void) {}\n") + if(NOT name MATCHES "^(rpath|conflict)$") + add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c") + endif() + + file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" "extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" "void test_runpath(void)\n{\n") +foreach(name ${test_runpath_names} rpath conflict) + file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" "}\n") + +install(TARGETS runpath_postexcluded DESTINATION lib/runpath_postexcluded) +install(TARGETS runpath DESTINATION lib/runpath) +install(TARGETS runpath_origin_postexcluded DESTINATION lib/runpath_origin_postexcluded) +install(TARGETS runpath_origin DESTINATION lib/runpath_origin) +install(TARGETS runpath_parent_unresolved DESTINATION lib/runpath_parent_unresolved) +install(TARGETS runpath_search_postexcluded DESTINATION lib/runpath_search_postexcluded) +install(TARGETS runpath runpath_origin runpath_search DESTINATION lib/runpath_search) +install(TARGETS conflict DESTINATION lib/conflict2) + +target_link_libraries(test_runpath PRIVATE ${test_runpath_names} rpath conflict) +set_property(TARGET test_runpath PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/lib/runpath/../rpath" # Ensure that files that don't conflict are treated correctly + "${CMAKE_BINARY_DIR}/root-all/lib/runpath_postexcluded" + "${CMAKE_BINARY_DIR}/root-all/lib/runpath" + "\${ORIGIN}/runpath_origin_postexcluded" + "\$ORIGIN/runpath_origin" + "${CMAKE_BINARY_DIR}/root-all/lib/conflict2" + ) +target_link_options(test_runpath PRIVATE -Wl,--enable-new-dtags) + +set_property(TARGET test_rpath ${test_rpath_names} test_runpath ${test_runpath_names} PROPERTY LIBRARY_OUTPUT_DIRECTORY lib) +install(TARGETS test_rpath test_runpath DESTINATION lib) + +add_executable(topexe file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c) +add_library(toplib SHARED file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c) +add_library(topmod MODULE file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c) +target_link_libraries(topexe PRIVATE test_rpath test_runpath) +target_link_libraries(toplib PRIVATE test_rpath test_runpath) +target_link_libraries(topmod PRIVATE test_rpath test_runpath) +set_property(TARGET topexe toplib topmod PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/lib" + "${CMAKE_BINARY_DIR}/root-all/lib/rpath_parent_postexcluded" + "${CMAKE_BINARY_DIR}/root-all/lib/rpath_parent" + "${CMAKE_BINARY_DIR}/root-all/lib/runpath_parent_unresolved" + ) +target_link_options(topexe PRIVATE -Wl,--disable-new-dtags) +target_link_options(toplib PRIVATE -Wl,--disable-new-dtags) +target_link_options(topmod PRIVATE -Wl,--disable-new-dtags) + +install(TARGETS topexe toplib RUNTIME DESTINATION bin LIBRARY DESTINATION lib) +install(TARGETS topmod LIBRARY DESTINATION lib/modules) + +install(CODE [[ + function(exec_get_runtime_dependencies depsfile udepsfile cdepsfile) + file(GET_RUNTIME_DEPENDENCIES + RESOLVED_DEPENDENCIES_VAR deps + UNRESOLVED_DEPENDENCIES_VAR udeps + CONFLICTING_DEPENDENCIES_PREFIX cdeps + PRE_INCLUDE_REGEXES + "^lib(test_rpath|rpath_postexcluded|rpath|rpath_parent_postexcluded|rpath_parent|rpath_origin_postexcluded|rpath_origin|rpath_search_postexcluded|rpath_search|rpath_unresolved|test_runpath|runpath_postexcluded|runpath|runpath_origin_postexcluded|runpath_origin|runpath_parent_unresolved|runpath_search_postexcluded|runpath_search|runpath_unresolved|conflict)\\.so$" + "^libc\\.so" + PRE_EXCLUDE_REGEXES ".*" + POST_INCLUDE_REGEXES "^.*/(libtest_rpath|rpath/librpath|rpath_parent/librpath_parent|rpath_search/librpath_search|libtest_runpath|runpath/librunpath|runpath_origin_postexcluded|runpath_origin|runpath_search/librunpath_search|conflict2?/libconflict)\\.so$" + POST_EXCLUDE_REGEXES ".*" + DIRECTORIES + "${CMAKE_INSTALL_PREFIX}/lib/rpath_search_postexcluded" + "${CMAKE_INSTALL_PREFIX}/lib/rpath_search" + "${CMAKE_INSTALL_PREFIX}/lib/runpath_search_postexcluded" + "${CMAKE_INSTALL_PREFIX}/lib/runpath_search" + ${ARGN} + ) + list(SORT deps) + list(SORT udeps) + list(SORT cdeps_FILENAMES) + file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${depsfile}" "${deps}") + file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${udepsfile}" "${udeps}") + file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "") + foreach(cdep IN LISTS cdeps_FILENAMES) + set(cdep_values ${cdeps_${cdep}}) + list(SORT cdep_values) + file(APPEND "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "${cdep}:${cdep_values}\n") + endforeach() + endfunction() + + exec_get_runtime_dependencies( + deps1.txt udeps1.txt cdeps1.txt + EXECUTABLES + "${CMAKE_INSTALL_PREFIX}/bin/$" + ) + + exec_get_runtime_dependencies( + deps2.txt udeps2.txt cdeps2.txt + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/lib/$" + ) + + exec_get_runtime_dependencies( + deps3.txt udeps3.txt cdeps3.txt + MODULES + "${CMAKE_INSTALL_PREFIX}/lib/modules/$" + ) + ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c new file mode 100644 index 0000000..d196afe --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c @@ -0,0 +1,9 @@ +extern void test_rpath(void); +extern void test_runpath(void); + +int main(void) +{ + test_rpath(); + test_runpath(); + return 0; +} diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c new file mode 100644 index 0000000..040e591 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c @@ -0,0 +1,8 @@ +extern void test_rpath(void); +extern void test_runpath(void); + +void toplib(void) +{ + test_rpath(); + test_runpath(); +} diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-all-check.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-all-check.cmake new file mode 100644 index 0000000..d2f79ed --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-all-check.cmake @@ -0,0 +1,157 @@ +function(check_contents filename contents_regex) + if(EXISTS "${CMAKE_INSTALL_PREFIX}/${filename}") + file(READ "${CMAKE_INSTALL_PREFIX}/${filename}" contents) + if(NOT contents MATCHES "${contents_regex}") + string(APPEND RunCMake_TEST_FAILED "File contents: + ${contents} +do not match what we expected: + ${contents_regex} +in file: + ${CMAKE_INSTALL_PREFIX}/${filename}\n") + set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) + endif() + else() + string(APPEND RunCMake_TEST_FAILED "File ${CMAKE_INSTALL_PREFIX}/${filename} does not exist") + set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) + endif() +endfunction() + +set(_check + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/bin/../lib/executable_path/libexecutable_path\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/bin/../lib/rpath_executable_path/librpath_executable_path\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] + [[/usr/lib/libSystem\.B\.dylib]] + ) +check_contents(deps/deps1.txt "^${_check}$") + +set(_check + [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] + [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] + [[@rpath/librpath_executable_path_bundle\.dylib]] + [[@rpath/librpath_loader_path_unresolved\.dylib]] + [[@rpath/librpath_unresolved\.dylib]] + ) +check_contents(deps/udeps1.txt "^${_check}$") + +set(_check + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] + [[/usr/lib/libSystem\.B\.dylib]] + ) +check_contents(deps/deps2.txt "^${_check}$") + +set(_check + [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]] + [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] + [[@executable_path/../lib/executable_path_postexcluded/libexecutable_path_postexcluded\.dylib]] + [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] + [[@rpath/librpath_executable_path\.dylib]] + [[@rpath/librpath_executable_path_bundle\.dylib]] + [[@rpath/librpath_executable_path_postexcluded\.dylib]] + [[@rpath/librpath_loader_path_unresolved\.dylib]] + [[@rpath/librpath_unresolved\.dylib]] + ) +check_contents(deps/udeps2.txt "^${_check}$") + +set(_check + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] + [[/usr/lib/libSystem\.B\.dylib]] + ) +check_contents(deps/deps3.txt "^${_check}$") + +set(_check + [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]] + [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] + [[@executable_path/../lib/executable_path_postexcluded/libexecutable_path_postexcluded\.dylib]] + [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] + [[@rpath/librpath_executable_path\.dylib]] + [[@rpath/librpath_executable_path_bundle\.dylib]] + [[@rpath/librpath_executable_path_postexcluded\.dylib]] + [[@rpath/librpath_loader_path_unresolved\.dylib]] + [[@rpath/librpath_unresolved\.dylib]] + ) +check_contents(deps/udeps3.txt "^${_check}$") + +set(_check + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/bin/../lib/executable_path/libexecutable_path\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/bin/../lib/rpath_executable_path/librpath_executable_path\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] + [[/usr/lib/libSystem\.B\.dylib]] + ) +check_contents(deps/deps4.txt "^${_check}$") + +set(_check + [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] + [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] + [[@rpath/librpath_executable_path_bundle\.dylib]] + [[@rpath/librpath_loader_path_unresolved\.dylib]] + [[@rpath/librpath_unresolved\.dylib]] + ) +check_contents(deps/udeps4.txt "^${_check}$") + +set(_check + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/bundle_executable/bin/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] + [[/usr/lib/libSystem\.B\.dylib]] + ) +check_contents(deps/deps5.txt "^${_check}$") + +set(_check + [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]] + [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] + [[@rpath/librpath_executable_path\.dylib]] + [[@rpath/librpath_executable_path_bundle\.dylib]] + [[@rpath/librpath_loader_path_unresolved\.dylib]] + [[@rpath/librpath_unresolved\.dylib]] + ) +check_contents(deps/udeps5.txt "^${_check}$") + +set(_check + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/bundle_executable/bin/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] + [[/usr/lib/libSystem\.B\.dylib]] + ) +check_contents(deps/deps6.txt "^${_check}$") + +set(_check + [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]] + [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] + [[@rpath/librpath_executable_path\.dylib]] + [[@rpath/librpath_executable_path_bundle\.dylib]] + [[@rpath/librpath_loader_path_unresolved\.dylib]] + [[@rpath/librpath_unresolved\.dylib]] + ) +check_contents(deps/udeps6.txt "^${_check}$") + +set(_check + "^libconflict\\.dylib:[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/conflict/libconflict\\.dylib;[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/conflict2/libconflict\\.dylib\n$" + ) +check_contents(deps/cdeps1.txt "${_check}") +check_contents(deps/cdeps2.txt "${_check}") +check_contents(deps/cdeps3.txt "${_check}") +check_contents(deps/cdeps4.txt "${_check}") +check_contents(deps/cdeps5.txt "${_check}") +check_contents(deps/cdeps6.txt "${_check}") diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-stderr.txt new file mode 100644 index 0000000..7f36f71 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-stderr.txt @@ -0,0 +1,7 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): + file Multiple conflicting paths found for librpath\.dylib: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-build/root-all/lib/rpath1/librpath\.dylib + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-build/root-all/lib/rpath2/librpath\.dylib$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-conflict.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-conflict.cmake new file mode 100644 index 0000000..a8446fe --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-conflict.cmake @@ -0,0 +1,55 @@ +enable_language(C) + +set(test1_names rpath) +set(test2_names rpath) + +file(WRITE "${CMAKE_BINARY_DIR}/rpath.c" "void rpath(void) {}\n") +add_library(rpath SHARED "${CMAKE_BINARY_DIR}/rpath.c") +set_property(TARGET rpath PROPERTY INSTALL_NAME_DIR @rpath) +install(TARGETS rpath DESTINATION lib/rpath1) +install(TARGETS rpath DESTINATION lib/rpath2) + +file(REMOVE "${CMAKE_BINARY_DIR}/test1.c") +add_library(test1 SHARED "${CMAKE_BINARY_DIR}/test1.c") +foreach(name ${test1_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "void test1(void)\n{\n") +foreach(name ${test1_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test1.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "}\n") + +target_link_libraries(test1 PRIVATE ${test1_names}) +set_property(TARGET test1 PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/lib/rpath1" + ) + +file(REMOVE "${CMAKE_BINARY_DIR}/test2.c") +add_library(test2 SHARED "${CMAKE_BINARY_DIR}/test2.c") +foreach(name ${test2_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "void test2(void)\n{\n") +foreach(name ${test2_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test2.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "}\n") + +target_link_libraries(test2 PRIVATE ${test2_names}) +set_property(TARGET test2 PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/lib/rpath2" + ) + +install(TARGETS test1 test2 DESTINATION lib) + +install(CODE [[ + file(GET_RUNTIME_DEPENDENCIES + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/lib/$" + "${CMAKE_INSTALL_PREFIX}/lib/$" + PRE_INCLUDE_REGEXES "^@rpath/librpath\\.dylib$" + PRE_EXCLUDE_REGEXES ".*" + ) + message(FATAL_ERROR "This message should not be displayed") + ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-stderr.txt new file mode 100644 index 0000000..1aac009 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): + file Failed to run otool on: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-build/root-all/bin/\.\./lib/libtest\.dylib$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-notfile.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-notfile.cmake new file mode 100644 index 0000000..3e4c434 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-notfile.cmake @@ -0,0 +1,30 @@ +enable_language(C) + +file(WRITE "${CMAKE_BINARY_DIR}/test.c" "void test(void) {}\n") +file(WRITE "${CMAKE_BINARY_DIR}/main.c" [[extern void test(void); + +int main(void) +{ + test(); + return 0; +} +]]) + +add_library(test SHARED "${CMAKE_BINARY_DIR}/test.c") +set_property(TARGET test PROPERTY INSTALL_NAME_DIR @rpath) +add_executable(exe "${CMAKE_BINARY_DIR}/main.c") +target_link_libraries(exe PRIVATE test) +set_property(TARGET exe PROPERTY INSTALL_RPATH "@loader_path/../lib") + +install(TARGETS exe DESTINATION bin) + +install(CODE [[ + file(MAKE_DIRECTORY "${CMAKE_INSTALL_PREFIX}/lib/$") + file(GET_RUNTIME_DEPENDENCIES + EXECUTABLES + "${CMAKE_INSTALL_PREFIX}/bin/$" + PRE_INCLUDE_REGEXES "^@rpath/libtest\\.dylib$" + PRE_EXCLUDE_REGEXES ".*" + ) + message(FATAL_ERROR "This message should not be displayed") + ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-stderr.txt new file mode 100644 index 0000000..01762b4 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): + file Could not resolve file @rpath/libunresolved\.dylib$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved.cmake new file mode 100644 index 0000000..c9b6c95 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved.cmake @@ -0,0 +1,18 @@ +enable_language(C) + +file(WRITE "${CMAKE_BINARY_DIR}/testlib.c" "extern void unresolved(void);\nvoid testlib(void)\n{\n unresolved();\n}\n") +add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c") +file(WRITE "${CMAKE_BINARY_DIR}/unresolved.c" "void unresolved(void) {}\n") +add_library(unresolved SHARED "${CMAKE_BINARY_DIR}/unresolved.c") +target_link_libraries(testlib PRIVATE unresolved) +install(TARGETS testlib DESTINATION lib) + +install(CODE [[ + file(GET_RUNTIME_DEPENDENCIES + PRE_INCLUDE_REGEXES "^@rpath/libunresolved\\.dylib$" + PRE_EXCLUDE_REGEXES ".*" + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/lib/$" + ) + message(FATAL_ERROR "This message should not be displayed") + ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos.cmake new file mode 100644 index 0000000..6db05b3 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos.cmake @@ -0,0 +1,216 @@ +enable_language(C) + +set(testlib_names + preexcluded + executable_path + executable_path_bundle + executable_path_postexcluded + loader_path + loader_path_unresolved + loader_path_postexcluded + rpath + rpath_unresolved + rpath_postexcluded + rpath_executable_path + rpath_executable_path_bundle + rpath_executable_path_postexcluded + rpath_loader_path + rpath_loader_path_unresolved + rpath_loader_path_postexcluded + normal + normal_unresolved + normal_postexcluded + conflict + ) + +file(REMOVE "${CMAKE_BINARY_DIR}/testlib.c") +add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c") +foreach(name ${testlib_names}) + if(name STREQUAL "normal") + file(WRITE "${CMAKE_BINARY_DIR}/normal.c" "extern void rpath(void);\nvoid normal(void)\n{\n rpath();\n}\n") + else() + file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "void ${name}(void) {}\n") + endif() + add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c") + + file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "void testlib(void)\n{\n") +foreach(name ${testlib_names}) + file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "}\n") +set_property(TARGET ${testlib_names} PROPERTY BUILD_WITH_INSTALL_NAME_DIR 1) +target_link_libraries(normal PRIVATE rpath) +set_property(TARGET normal PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/executable/lib/normal/../rpath" + ) + +file(WRITE "${CMAKE_BINARY_DIR}/testlib_conflict.c" "extern void conflict(void);\nvoid testlib_conflict(void)\n{\n conflict();\n}\n") +add_library(testlib_conflict SHARED "${CMAKE_BINARY_DIR}/testlib_conflict.c") +target_link_libraries(testlib_conflict PRIVATE conflict) + +set_property(TARGET testlib PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/executable/lib/rpath" + "${CMAKE_BINARY_DIR}/root-all/executable/lib/rpath_unresolved" + "${CMAKE_BINARY_DIR}/root-all/executable/lib/rpath_postexcluded" + "${CMAKE_BINARY_DIR}/root-all/executable/lib/conflict" + @executable_path/../lib/rpath_executable_path + @executable_path/../lib/rpath_executable_path_unresolved + @executable_path/../lib/rpath_executable_path_postexcluded + @loader_path/rpath_loader_path + @loader_path/rpath_loader_path_unresolved + @loader_path/rpath_loader_path_postexcluded + ) +set_property(TARGET testlib_conflict PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/executable/lib/conflict2" + ) + +foreach(t + executable_path + executable_path_postexcluded + loader_path + loader_path_postexcluded + rpath + rpath_postexcluded + rpath_executable_path + rpath_executable_path_postexcluded + rpath_loader_path + rpath_loader_path_postexcluded + conflict + ) + install(TARGETS ${t} DESTINATION executable/lib/${t}) +endforeach() +install(TARGETS conflict DESTINATION executable/lib/conflict2) + +foreach(t + executable_path_bundle + executable_path_postexcluded + loader_path_postexcluded + rpath_postexcluded + rpath_executable_path_bundle + rpath_executable_path_postexcluded + rpath_loader_path_postexcluded + ) + install(TARGETS ${t} DESTINATION bundle_executable/lib/${t}) +endforeach() + +foreach(t executable_path executable_path_bundle executable_path_postexcluded) + set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR @executable_path/../lib/${t}) +endforeach() + +foreach(t loader_path loader_path_unresolved loader_path_postexcluded) + set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR @loader_path/${t}) +endforeach() + +foreach(t + rpath + rpath_unresolved + rpath_postexcluded + rpath_executable_path + rpath_executable_path_bundle + rpath_executable_path_postexcluded + rpath_loader_path + rpath_loader_path_unresolved + rpath_loader_path_postexcluded + conflict + ) + set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR @rpath) +endforeach() + +foreach(t normal normal_unresolved normal_postexcluded) + set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR "${CMAKE_BINARY_DIR}/root-all/executable/lib/${t}") + if(NOT t STREQUAL "normal_unresolved") + install(TARGETS ${t} DESTINATION executable/lib/${t}) + endif() +endforeach() + +target_link_libraries(testlib PRIVATE ${testlib_names}) + +add_executable(topexe file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c) +add_library(toplib SHARED file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c) +add_library(topmod MODULE file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c) +target_link_libraries(topexe PRIVATE testlib) +target_link_libraries(toplib PRIVATE testlib) +target_link_libraries(topmod PRIVATE testlib) + +set_property(TARGET topexe toplib topmod PROPERTY INSTALL_RPATH "${CMAKE_BINARY_DIR}/root-all/executable/lib") + +install(TARGETS topexe toplib topmod testlib testlib_conflict RUNTIME DESTINATION executable/bin LIBRARY DESTINATION executable/lib) +install(TARGETS topexe toplib topmod testlib testlib_conflict RUNTIME DESTINATION bundle_executable/bin LIBRARY DESTINATION bundle_executable/lib) + +install(CODE [[ + function(exec_get_runtime_dependencies depsfile udepsfile cdepsfile) + file(GET_RUNTIME_DEPENDENCIES + RESOLVED_DEPENDENCIES_VAR deps + UNRESOLVED_DEPENDENCIES_VAR udeps + CONFLICTING_DEPENDENCIES_PREFIX cdeps + PRE_INCLUDE_REGEXES "^.*/lib(testlib|executable_path|executable_path_bundle|executable_path_postexcluded|loader_path|loader_path_unresolved|loader_path_postexcluded|rpath|rpath_unresolved|rpath_postexcluded|rpath_executable_path|rpath_executable_path_bundle|rpath_executable_path_postexcluded|rpath_loader_path|rpath_loader_path_unresolved|rpath_loader_path_postexcluded|normal|normal_unresolved|normal_postexcluded|conflict|System\\.B)\\.dylib$" + PRE_EXCLUDE_REGEXES ".*" + POST_INCLUDE_REGEXES "^.*/lib(testlib|executable_path|executable_path_bundle|loader_path|rpath|rpath_executable_path|rpath_executable_path_bundle|rpath_loader_path|normal|conflict|System\\.B)\\.dylib$" + POST_EXCLUDE_REGEXES ".*" + ${ARGN} + ) + list(SORT deps) + list(SORT udeps) + list(SORT cdeps_FILENAMES) + file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${depsfile}" "${deps}") + file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${udepsfile}" "${udeps}") + file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "") + foreach(cdep IN LISTS cdeps_FILENAMES) + set(cdep_values ${cdeps_${cdep}}) + list(SORT cdep_values) + file(APPEND "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "${cdep}:${cdep_values}\n") + endforeach() + endfunction() + + exec_get_runtime_dependencies( + deps1.txt udeps1.txt cdeps1.txt + EXECUTABLES + "${CMAKE_INSTALL_PREFIX}/executable/bin/$" + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + ) + + exec_get_runtime_dependencies( + deps2.txt udeps2.txt cdeps2.txt + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + ) + + exec_get_runtime_dependencies( + deps3.txt udeps3.txt cdeps3.txt + MODULES + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + ) + + exec_get_runtime_dependencies( + deps4.txt udeps4.txt cdeps4.txt + EXECUTABLES + "${CMAKE_INSTALL_PREFIX}/executable/bin/$" + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + BUNDLE_EXECUTABLE + "${CMAKE_INSTALL_PREFIX}/bundle_executable/bin/$" + ) + + exec_get_runtime_dependencies( + deps5.txt udeps5.txt cdeps5.txt + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + BUNDLE_EXECUTABLE "${CMAKE_INSTALL_PREFIX}/bundle_executable/bin/$" + ) + + exec_get_runtime_dependencies( + deps6.txt udeps6.txt cdeps6.txt + MODULES + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + BUNDLE_EXECUTABLE "${CMAKE_INSTALL_PREFIX}/bundle_executable/bin/$" + ) + ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c new file mode 100644 index 0000000..20c6087 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c @@ -0,0 +1,7 @@ +extern void testlib(void); + +int main(void) +{ + testlib(); + return 0; +} diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c new file mode 100644 index 0000000..cff1bff --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c @@ -0,0 +1,6 @@ +extern void testlib(void); + +void toplib(void) +{ + testlib(); +} diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-project-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-project-stderr.txt new file mode 100644 index 0000000..d506645 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-project-stderr.txt @@ -0,0 +1,13 @@ +^CMake Warning \(dev\) at file-GET_RUNTIME_DEPENDENCIES-project\.cmake:[0-9]+ \(file\): + You have used file\(GET_RUNTIME_DEPENDENCIES\) in project mode\. This is + probably not what you intended to do\. Instead, please consider using it in + an install\(CODE\) or install\(SCRIPT\) command\. For example: + + install\(CODE \[\[ + file\(GET_RUNTIME_DEPENDENCIES + # \.\.\. + \) + ]]\) +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) +This warning is for project developers\. Use -Wno-dev to suppress it\.$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-project.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-project.cmake new file mode 100644 index 0000000..842d7ab --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-project.cmake @@ -0,0 +1 @@ +file(GET_RUNTIME_DEPENDENCIES RESOLVED_DEPENDENCIES_VAR deps) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-unsupported-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-unsupported-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-unsupported-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-unsupported-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-unsupported-stderr.txt new file mode 100644 index 0000000..3db835c --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-unsupported-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at file-GET_RUNTIME_DEPENDENCIES-unsupported\.cmake:[0-9]+ \(file\): + file GET_RUNTIME_DEPENDENCIES is not supported on system "[^ + ]+" +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-unsupported.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-unsupported.cmake new file mode 100644 index 0000000..b91eefe --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-unsupported.cmake @@ -0,0 +1,2 @@ +file(GET_RUNTIME_DEPENDENCIES RESOLVED_DEPENDENCIES_VAR deps) +message(FATAL_ERROR "This message should not be displayed") diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-all-stderr.txt new file mode 100644 index 0000000..591a5e7 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-all-stderr.txt @@ -0,0 +1,6 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(message\): +.* +.*CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM: custom-platform.* +.*CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL: custom-platform-objdump.* +.*CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND: path/to/custom-objdump.* +.*CMAKE_OBJDUMP: custom-objdump.* diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-dev-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-dev-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-dev-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-dev-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-dev-stderr.txt new file mode 100644 index 0000000..591a5e7 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-dev-stderr.txt @@ -0,0 +1,6 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(message\): +.* +.*CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM: custom-platform.* +.*CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL: custom-platform-objdump.* +.*CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND: path/to/custom-objdump.* +.*CMAKE_OBJDUMP: custom-objdump.* diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation.cmake new file mode 100644 index 0000000..07bbc5e --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation.cmake @@ -0,0 +1,17 @@ +enable_language(C) + +set(CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM "custom-platform") +set(CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL "custom-platform-objdump") +set(CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND "path/to/custom-objdump") +set(CMAKE_OBJDUMP "custom-objdump") + +install(CODE [[ +message(FATAL_ERROR " + CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM: ${CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM} + CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL: ${CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL} + CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND: ${CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND} + CMAKE_OBJDUMP: ${CMAKE_OBJDUMP} +") +]] +COMPONENT dev +) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-all-check.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-all-check.cmake new file mode 100644 index 0000000..b1ba6df --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-all-check.cmake @@ -0,0 +1,38 @@ +function(check_contents filename contents_regex) + if(EXISTS "${CMAKE_INSTALL_PREFIX}/${filename}") + file(READ "${CMAKE_INSTALL_PREFIX}/${filename}" contents) + if(NOT contents MATCHES "${contents_regex}") + string(APPEND RunCMake_TEST_FAILED "File contents: + ${contents} +do not match what we expected: + ${contents_regex} +in file: + ${CMAKE_INSTALL_PREFIX}/${filename}\n") + set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) + endif() + else() + string(APPEND RunCMake_TEST_FAILED "File ${CMAKE_INSTALL_PREFIX}/${filename} does not exist") + set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) + endif() +endfunction() + +set(_check + [=[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/\.conflict/\.\./(lib)?libdir\.dll]=] + [=[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/\.search/(lib)?search\.dll]=] + [=[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/(lib)?testlib\.dll]=] + ) +check_contents(deps/deps1.txt "^${_check}$") +check_contents(deps/deps2.txt "^${_check}$") +check_contents(deps/deps3.txt "^${_check}$") +set(_check + [=[(lib)?unresolved\.dll]=] + ) +check_contents(deps/udeps1.txt "^${_check}$") +check_contents(deps/udeps2.txt "^${_check}$") +check_contents(deps/udeps3.txt "^${_check}$") +set(_check + "^(lib)?conflict\\.dll:[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/\\.conflict/(lib)?conflict\\.dll;[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/(lib)?conflict\\.dll\n$" + ) +check_contents(deps/cdeps1.txt "${_check}") +check_contents(deps/cdeps2.txt "${_check}") +check_contents(deps/cdeps3.txt "${_check}") diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-stderr.txt new file mode 100644 index 0000000..a9ca6d0 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-stderr.txt @@ -0,0 +1,7 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): + file Multiple conflicting paths found for (lib)?path\.dll: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-build/root-all/lib/test1/(lib)?path\.dll + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-build/root-all/lib/test2/(lib)?path\.dll$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-conflict.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-conflict.cmake new file mode 100644 index 0000000..d413443 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-conflict.cmake @@ -0,0 +1,47 @@ +enable_language(C) + +set(test1_names path) +set(test2_names path) + +file(WRITE "${CMAKE_BINARY_DIR}/path.c" "__declspec(dllexport) void path(void) {}\n") +add_library(path SHARED "${CMAKE_BINARY_DIR}/path.c") + +file(REMOVE "${CMAKE_BINARY_DIR}/test1.c") +add_library(test1 SHARED "${CMAKE_BINARY_DIR}/test1.c") +foreach(name ${test1_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "__declspec(dllimport) extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "__declspec(dllexport) void test1(void)\n{\n") +foreach(name ${test1_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test1.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "}\n") + +target_link_libraries(test1 PRIVATE ${test1_names}) + +file(REMOVE "${CMAKE_BINARY_DIR}/test2.c") +add_library(test2 SHARED "${CMAKE_BINARY_DIR}/test2.c") +foreach(name ${test2_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "__declspec(dllimport) extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "__declspec(dllexport) void test2(void)\n{\n") +foreach(name ${test2_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test2.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "}\n") + +target_link_libraries(test2 PRIVATE ${test2_names}) + +install(TARGETS test1 path DESTINATION lib/test1) +install(TARGETS test2 path DESTINATION lib/test2) + +install(CODE [[ + file(GET_RUNTIME_DEPENDENCIES + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/lib/test1/$" + "${CMAKE_INSTALL_PREFIX}/lib/test2/$" + PRE_INCLUDE_REGEXES "^(lib)?path\\.dll$" + PRE_EXCLUDE_REGEXES ".*" + ) + message(FATAL_ERROR "This message should not be displayed") + ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-stderr.txt new file mode 100644 index 0000000..432ac32 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): + file Failed to run (dumpbin|objdump) on: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-build/root-all/bin/(lib)?test\.dll$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-notfile.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-notfile.cmake new file mode 100644 index 0000000..6665a3b --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-notfile.cmake @@ -0,0 +1,28 @@ +enable_language(C) + +file(WRITE "${CMAKE_BINARY_DIR}/test.c" "__declspec(dllexport) void test(void) {}\n") +file(WRITE "${CMAKE_BINARY_DIR}/main.c" [[__declspec(dllimport) extern void test(void); + +int main(void) +{ + test(); + return 0; +} +]]) + +add_library(test SHARED "${CMAKE_BINARY_DIR}/test.c") +add_executable(exe "${CMAKE_BINARY_DIR}/main.c") +target_link_libraries(exe PRIVATE test) + +install(TARGETS exe DESTINATION bin) + +install(CODE [[ + file(MAKE_DIRECTORY "${CMAKE_INSTALL_PREFIX}/bin/$") + file(GET_RUNTIME_DEPENDENCIES + EXECUTABLES + "${CMAKE_INSTALL_PREFIX}/bin/$" + PRE_INCLUDE_REGEXES "^(lib)?test\\.dll$" + PRE_EXCLUDE_REGEXES ".*" + ) + message(FATAL_ERROR "This message should not be displayed") + ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-stderr.txt new file mode 100644 index 0000000..a20654c --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): + file Could not resolve file (lib)?unresolved\.dll$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved.cmake new file mode 100644 index 0000000..4cc74c7 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved.cmake @@ -0,0 +1,18 @@ +enable_language(C) + +file(WRITE "${CMAKE_BINARY_DIR}/testlib.c" "__declspec(dllimport) extern void unresolved(void);\n__declspec(dllexport) void testlib(void)\n{\n unresolved();\n}\n") +add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c") +file(WRITE "${CMAKE_BINARY_DIR}/unresolved.c" "__declspec(dllexport) void unresolved(void) {}\n") +add_library(unresolved SHARED "${CMAKE_BINARY_DIR}/unresolved.c") +target_link_libraries(testlib PRIVATE unresolved) +install(TARGETS testlib DESTINATION lib) + +install(CODE [[ + file(GET_RUNTIME_DEPENDENCIES + PRE_INCLUDE_REGEXES "^(lib)?unresolved\\.dll$" + PRE_EXCLUDE_REGEXES ".*" + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/lib/$" + ) + message(FATAL_ERROR "This message should not be displayed") + ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows.cmake new file mode 100644 index 0000000..19288d8 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows.cmake @@ -0,0 +1,114 @@ +enable_language(C) + +set(testlib_names + preexcluded + libdir_postexcluded + libdir + search_postexcluded + search + unresolved + conflict + ) + +file(REMOVE "${CMAKE_BINARY_DIR}/testlib.c") +add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c") +foreach(name ${testlib_names}) + file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "__declspec(dllexport) void ${name}(void) {}\n") + add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c") + + file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "__declspec(dllimport) extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "__declspec(dllexport) void testlib(void)\n{\n") +foreach(name ${testlib_names}) + file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "}\n") + +target_link_libraries(testlib PRIVATE ${testlib_names}) + +file(WRITE "${CMAKE_BINARY_DIR}/testlib_conflict.c" "__declspec(dllimport) extern void conflict(void);\n__declspec(dllexport) void testlib_conflict(void)\n{\n conflict();\n}\n") +add_library(testlib_conflict SHARED "${CMAKE_BINARY_DIR}/testlib_conflict.c") +target_link_libraries(testlib_conflict PRIVATE conflict) + +file(WRITE "${CMAKE_BINARY_DIR}/testlib_noconflict.c" "__declspec(dllimport) extern void libdir(void);\n__declspec(dllexport) void testlib_noconflict(void)\n{\n libdir();\n}\n") +add_library(testlib_noconflict SHARED "${CMAKE_BINARY_DIR}/testlib_noconflict.c") +target_link_libraries(testlib_noconflict PRIVATE libdir) + +install(TARGETS testlib libdir_postexcluded libdir conflict testlib_noconflict DESTINATION bin) +install(TARGETS libdir search_postexcluded search DESTINATION bin/.search) # Prefixing with "." ensures it is the first item after list(SORT) +install(TARGETS testlib_conflict conflict DESTINATION bin/.conflict) + +add_executable(topexe file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c) +add_library(toplib SHARED file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c) +add_library(topmod MODULE file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c) +target_link_libraries(topexe PRIVATE testlib) +target_link_libraries(toplib PRIVATE testlib) +target_link_libraries(topmod PRIVATE testlib) + +install(TARGETS topexe toplib topmod DESTINATION bin) + +install(CODE [[ + function(exec_get_runtime_dependencies depsfile udepsfile cdepsfile) + file(GET_RUNTIME_DEPENDENCIES + RESOLVED_DEPENDENCIES_VAR deps + UNRESOLVED_DEPENDENCIES_VAR udeps + CONFLICTING_DEPENDENCIES_PREFIX cdeps + PRE_INCLUDE_REGEXES + "^(lib)?testlib\\.dll$" + "^(lib)?libdir_postexcluded\\.dll$" + "^(lib)?libdir\\.dll$" + "^(lib)?search_postexcluded\\.dll$" + "^(lib)?search\\.dll$" + "^(lib)?unresolved\\.dll$" + "^(lib)?conflict\\.dll$" + "^kernel32\\.dll$" + PRE_EXCLUDE_REGEXES ".*" + POST_INCLUDE_REGEXES + "^.*/(lib)?testlib\\.dll$" + "^.*/(lib)?libdir\\.dll$" + "^.*/(lib)?search\\.dll$" + "^.*/(lib)?conflict\\.dll$" + POST_EXCLUDE_REGEXES ".*" + DIRECTORIES + "${CMAKE_INSTALL_PREFIX}/bin/.search" + ${ARGN} + ) + list(SORT deps) + list(SORT udeps) + list(SORT cdeps_FILENAMES) + file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${depsfile}" "${deps}") + file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${udepsfile}" "${udeps}") + file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "") + foreach(cdep IN LISTS cdeps_FILENAMES) + set(cdep_values ${cdeps_${cdep}}) + list(SORT cdep_values) + file(APPEND "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "${cdep}:${cdep_values}\n") + endforeach() + endfunction() + + exec_get_runtime_dependencies( + deps1.txt udeps1.txt cdeps1.txt + EXECUTABLES + "${CMAKE_INSTALL_PREFIX}/bin/$" + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/bin/.conflict/$" + "${CMAKE_INSTALL_PREFIX}/bin/.conflict/../$" + ) + + exec_get_runtime_dependencies( + deps2.txt udeps2.txt cdeps2.txt + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/bin/$" + "${CMAKE_INSTALL_PREFIX}/bin/.conflict/$" + "${CMAKE_INSTALL_PREFIX}/bin/.conflict/../$" + ) + + exec_get_runtime_dependencies( + deps3.txt udeps3.txt cdeps3.txt + MODULES + "${CMAKE_INSTALL_PREFIX}/bin/$" + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/bin/.conflict/$" + "${CMAKE_INSTALL_PREFIX}/bin/.conflict/../$" + ) + ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c new file mode 100644 index 0000000..713b8eb --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c @@ -0,0 +1,7 @@ +__declspec(dllimport) extern void testlib(void); + +int main(void) +{ + testlib(); + return 0; +} diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c new file mode 100644 index 0000000..6997175 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c @@ -0,0 +1,6 @@ +__declspec(dllimport) extern void testlib(void); + +__declspec(dllexport) void toplib(void) +{ + testlib(); +} diff --git a/Tests/RunCMake/install/CMakeLists.txt b/Tests/RunCMake/install/CMakeLists.txt index c7e99ad..6dd8cdf 100644 --- a/Tests/RunCMake/install/CMakeLists.txt +++ b/Tests/RunCMake/install/CMakeLists.txt @@ -1,6 +1,3 @@ cmake_minimum_required(VERSION 3.4) -if(RunCMake_TEST MATCHES "^file-GET_RUNTIME_DEPENDENCIES") - cmake_policy(SET CMP0087 NEW) -endif() project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake index c50e552..d83a07c 100644 --- a/Tests/RunCMake/install/RunCMakeTest.cmake +++ b/Tests/RunCMake/install/RunCMakeTest.cmake @@ -155,46 +155,7 @@ run_install_test(FILES-PERMISSIONS) run_install_test(TARGETS-RPATH) run_install_test(InstallRequiredSystemLibraries) -if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") - if(NOT CMake_INSTALL_NAME_TOOL_BUG) - run_install_test(file-GET_RUNTIME_DEPENDENCIES-macos) - run_install_test(file-GET_RUNTIME_DEPENDENCIES-macos-unresolved) - run_install_test(file-GET_RUNTIME_DEPENDENCIES-macos-conflict) - run_install_test(file-GET_RUNTIME_DEPENDENCIES-macos-notfile) - endif() - run_cmake(file-GET_RUNTIME_DEPENDENCIES-project) - run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs1) - run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs2) -elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") - run_install_test(file-GET_RUNTIME_DEPENDENCIES-windows) - run_install_test(file-GET_RUNTIME_DEPENDENCIES-windows-unresolved) - run_install_test(file-GET_RUNTIME_DEPENDENCIES-windows-conflict) - run_install_test(file-GET_RUNTIME_DEPENDENCIES-windows-notfile) - run_cmake(file-GET_RUNTIME_DEPENDENCIES-project) - run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs1) - run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs2) -elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") - if(DEFINED ENV{LDFLAGS}) - # Some setups prebake disable-new-dtags into LDFLAGS - string(REPLACE "-Wl,--disable-new-dtags" "" new_ldflags "$ENV{LDFLAGS}") - set(ENV{LDFLAGS} "${new_ldflags}") - endif() - - if(NOT CMAKE_C_COMPILER_ID MATCHES "^XL") - run_install_test(file-GET_RUNTIME_DEPENDENCIES-linux) - endif() - run_install_test(file-GET_RUNTIME_DEPENDENCIES-linux-unresolved) - run_install_test(file-GET_RUNTIME_DEPENDENCIES-linux-conflict) - run_install_test(file-GET_RUNTIME_DEPENDENCIES-linux-notfile) - run_cmake(file-GET_RUNTIME_DEPENDENCIES-project) - run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs1) - run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs2) -else() - run_cmake(file-GET_RUNTIME_DEPENDENCIES-unsupported) -endif() - set(run_install_test_components 1) -run_install_test(file-GET_RUNTIME_DEPENDENCIES-variable-propagation) run_install_test(FILES-EXCLUDE_FROM_ALL) run_install_test(TARGETS-EXCLUDE_FROM_ALL) run_install_test(TARGETS-NAMELINK_COMPONENT) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-stderr.txt deleted file mode 100644 index b66d1fe..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-stderr.txt +++ /dev/null @@ -1,18 +0,0 @@ -^CMake Warning \(dev\) at file-GET_RUNTIME_DEPENDENCIES-badargs1\.cmake:[0-9]+ \(file\): - You have used file\(GET_RUNTIME_DEPENDENCIES\) in project mode\. This is - probably not what you intended to do\. Instead, please consider using it in - an install\(CODE\) or install\(SCRIPT\) command\. For example: - - install\(CODE \[\[ - file\(GET_RUNTIME_DEPENDENCIES - # \.\.\. - \) - ]]\) -Call Stack \(most recent call first\): - CMakeLists\.txt:[0-9]+ \(include\) -This warning is for project developers\. Use -Wno-dev to suppress it\. - -CMake Error at file-GET_RUNTIME_DEPENDENCIES-badargs1\.cmake:[0-9]+ \(file\): - file Unrecognized argument: "invalid" -Call Stack \(most recent call first\): - CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1.cmake deleted file mode 100644 index f3b8ce4..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1.cmake +++ /dev/null @@ -1,2 +0,0 @@ -file(GET_RUNTIME_DEPENDENCIES invalid) -message(FATAL_ERROR "This message should not be displayed") diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt deleted file mode 100644 index 50fa81f..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt +++ /dev/null @@ -1,23 +0,0 @@ -^CMake Warning \(dev\) at file-GET_RUNTIME_DEPENDENCIES-badargs2\.cmake:[0-9]+ \(file\): - You have used file\(GET_RUNTIME_DEPENDENCIES\) in project mode\. This is - probably not what you intended to do\. Instead, please consider using it in - an install\(CODE\) or install\(SCRIPT\) command\. For example: - - install\(CODE \[\[ - file\(GET_RUNTIME_DEPENDENCIES - # \.\.\. - \) - ]]\) -Call Stack \(most recent call first\): - CMakeLists\.txt:[0-9]+ \(include\) -This warning is for project developers\. Use -Wno-dev to suppress it\. - -CMake Error at file-GET_RUNTIME_DEPENDENCIES-badargs2\.cmake:[0-9]+ \(file\): - file Keywords missing values: - - RESOLVED_DEPENDENCIES_VAR - UNRESOLVED_DEPENDENCIES_VAR - CONFLICTING_DEPENDENCIES_PREFIX - BUNDLE_EXECUTABLE -Call Stack \(most recent call first\): - CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake deleted file mode 100644 index ac6af85..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake +++ /dev/null @@ -1,15 +0,0 @@ -file(GET_RUNTIME_DEPENDENCIES - RESOLVED_DEPENDENCIES_VAR - UNRESOLVED_DEPENDENCIES_VAR - CONFLICTING_DEPENDENCIES_PREFIX - BUNDLE_EXECUTABLE - EXECUTABLES - LIBRARIES - MODULES - DIRECTORIES - PRE_INCLUDE_REGEXES - PRE_EXCLUDE_REGEXES - POST_INCLUDE_REGEXES - POST_EXCLUDE_REGEXES - ) -message(FATAL_ERROR "This message should not be displayed") diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-check.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-check.cmake deleted file mode 100644 index ab630f0..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-check.cmake +++ /dev/null @@ -1,44 +0,0 @@ -function(check_contents filename contents_regex) - if(EXISTS "${CMAKE_INSTALL_PREFIX}/${filename}") - file(READ "${CMAKE_INSTALL_PREFIX}/${filename}" contents) - if(NOT contents MATCHES "${contents_regex}") - string(APPEND RunCMake_TEST_FAILED "File contents: - ${contents} -do not match what we expected: - ${contents_regex} -in file: - ${CMAKE_INSTALL_PREFIX}/${filename}\n") - set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) - endif() - else() - string(APPEND RunCMake_TEST_FAILED "File ${CMAKE_INSTALL_PREFIX}/${filename} does not exist") - set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) - endif() -endfunction() - -set(_check - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/libtest_rpath\.so]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/libtest_runpath\.so]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath/librpath\.so]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_parent/librpath_parent\.so]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search/librpath_search\.so]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath/librunpath\.so]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search/librunpath_search\.so]] - ) -check_contents(deps/deps1.txt "^${_check}$") -check_contents(deps/deps2.txt "^${_check}$") -check_contents(deps/deps3.txt "^${_check}$") -set(_check - [[librpath_unresolved\.so]] - [[librunpath_parent_unresolved\.so]] - [[librunpath_unresolved\.so]] - ) -check_contents(deps/udeps1.txt "^${_check}$") -check_contents(deps/udeps2.txt "^${_check}$") -check_contents(deps/udeps3.txt "^${_check}$") -set(_check - "^libconflict\\.so:[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/conflict/libconflict\\.so;[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/conflict2/libconflict\\.so\n$" - ) -check_contents(deps/cdeps1.txt "${_check}") -check_contents(deps/cdeps2.txt "${_check}") -check_contents(deps/cdeps3.txt "${_check}") diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-stderr.txt deleted file mode 100644 index 123ae48..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-stderr.txt +++ /dev/null @@ -1,119 +0,0 @@ -^CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): - Dependency librpath_search_postexcluded\.so found in search directory: - - [^ -]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search_postexcluded - - See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. -Call Stack \(most recent call first\): - cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) - -*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): - Dependency librpath_search\.so found in search directory: - - [^ -]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search - - See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. -Call Stack \(most recent call first\): - cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) - -*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): - Dependency librunpath_search_postexcluded\.so found in search directory: - - [^ -]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search_postexcluded - - See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. -Call Stack \(most recent call first\): - cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) - -*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): - Dependency librunpath_search\.so found in search directory: - - [^ -]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search - - See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. -Call Stack \(most recent call first\): - cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) - -*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): - Dependency librpath_search_postexcluded\.so found in search directory: - - [^ -]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search_postexcluded - - See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. -Call Stack \(most recent call first\): - cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) - -*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): - Dependency librpath_search\.so found in search directory: - - [^ -]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search - - See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. -Call Stack \(most recent call first\): - cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) - -*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): - Dependency librunpath_search_postexcluded\.so found in search directory: - - [^ -]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search_postexcluded - - See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. -Call Stack \(most recent call first\): - cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) - -*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): - Dependency librunpath_search\.so found in search directory: - - [^ -]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search - - See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. -Call Stack \(most recent call first\): - cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) - -*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): - Dependency librpath_search_postexcluded\.so found in search directory: - - [^ -]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search_postexcluded - - See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. -Call Stack \(most recent call first\): - cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) - -*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): - Dependency librpath_search\.so found in search directory: - - [^ -]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search - - See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. -Call Stack \(most recent call first\): - cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) - -*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): - Dependency librunpath_search_postexcluded\.so found in search directory: - - [^ -]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search_postexcluded - - See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. -Call Stack \(most recent call first\): - cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) - -*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): - Dependency librunpath_search\.so found in search directory: - - [^ -]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search - - See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. -Call Stack \(most recent call first\): - cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)$ diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-stderr.txt deleted file mode 100644 index 1692348..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-stderr.txt +++ /dev/null @@ -1,7 +0,0 @@ -^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): - file Multiple conflicting paths found for librpath\.so: - - [^ -]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-build/root-all/lib/rpath1/librpath\.so - [^ -]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-build/root-all/lib/rpath2/librpath\.so$ diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict.cmake deleted file mode 100644 index f719499..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict.cmake +++ /dev/null @@ -1,54 +0,0 @@ -enable_language(C) - -set(test1_names rpath) -set(test2_names rpath) - -file(WRITE "${CMAKE_BINARY_DIR}/rpath.c" "void rpath(void) {}\n") -add_library(rpath SHARED "${CMAKE_BINARY_DIR}/rpath.c") -install(TARGETS rpath DESTINATION lib/rpath1) -install(TARGETS rpath DESTINATION lib/rpath2) - -file(REMOVE "${CMAKE_BINARY_DIR}/test1.c") -add_library(test1 SHARED "${CMAKE_BINARY_DIR}/test1.c") -foreach(name ${test1_names}) - file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "extern void ${name}(void);\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "void test1(void)\n{\n") -foreach(name ${test1_names}) - file(APPEND "${CMAKE_BINARY_DIR}/test1.c" " ${name}();\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "}\n") - -target_link_libraries(test1 PRIVATE ${test1_names}) -set_property(TARGET test1 PROPERTY INSTALL_RPATH - "${CMAKE_BINARY_DIR}/root-all/lib/rpath1" - ) - -file(REMOVE "${CMAKE_BINARY_DIR}/test2.c") -add_library(test2 SHARED "${CMAKE_BINARY_DIR}/test2.c") -foreach(name ${test2_names}) - file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "extern void ${name}(void);\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "void test2(void)\n{\n") -foreach(name ${test2_names}) - file(APPEND "${CMAKE_BINARY_DIR}/test2.c" " ${name}();\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "}\n") - -target_link_libraries(test2 PRIVATE ${test2_names}) -set_property(TARGET test2 PROPERTY INSTALL_RPATH - "${CMAKE_BINARY_DIR}/root-all/lib/rpath2" - ) - -install(TARGETS test1 test2 DESTINATION lib) - -install(CODE [[ - file(GET_RUNTIME_DEPENDENCIES - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/lib/$" - "${CMAKE_INSTALL_PREFIX}/lib/$" - PRE_INCLUDE_REGEXES "^librpath\\.so$" - PRE_EXCLUDE_REGEXES ".*" - ) - message(FATAL_ERROR "This message should not be displayed") - ]]) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-stderr.txt deleted file mode 100644 index 83a87c9..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): - file Failed to run objdump on: - - [^ -]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-build/root-all/bin/\.\./lib/libtest\.so$ diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake deleted file mode 100644 index 6567438..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake +++ /dev/null @@ -1,30 +0,0 @@ -enable_language(C) -cmake_policy(SET CMP0095 NEW) - -file(WRITE "${CMAKE_BINARY_DIR}/test.c" "void test(void) {}\n") -file(WRITE "${CMAKE_BINARY_DIR}/main.c" [[extern void test(void); - -int main(void) -{ - test(); - return 0; -} -]]) - -add_library(test SHARED "${CMAKE_BINARY_DIR}/test.c") -add_executable(exe "${CMAKE_BINARY_DIR}/main.c") -target_link_libraries(exe PRIVATE test) -set_property(TARGET exe PROPERTY INSTALL_RPATH "\${ORIGIN}/../lib") - -install(TARGETS exe DESTINATION bin) - -install(CODE [[ - file(MAKE_DIRECTORY "${CMAKE_INSTALL_PREFIX}/lib/$") - file(GET_RUNTIME_DEPENDENCIES - EXECUTABLES - "${CMAKE_INSTALL_PREFIX}/bin/$" - PRE_INCLUDE_REGEXES "^libtest\\.so$" - PRE_EXCLUDE_REGEXES ".*" - ) - message(FATAL_ERROR "This message should not be displayed") - ]]) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-stderr.txt deleted file mode 100644 index eaca512..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-stderr.txt +++ /dev/null @@ -1,2 +0,0 @@ -^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): - file Could not resolve file libunresolved\.so$ diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved.cmake deleted file mode 100644 index 3efa305..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved.cmake +++ /dev/null @@ -1,18 +0,0 @@ -enable_language(C) - -file(WRITE "${CMAKE_BINARY_DIR}/testlib.c" "extern void unresolved(void);\nvoid testlib(void)\n{\n unresolved();\n}\n") -add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c") -file(WRITE "${CMAKE_BINARY_DIR}/unresolved.c" "void unresolved(void) {}\n") -add_library(unresolved SHARED "${CMAKE_BINARY_DIR}/unresolved.c") -target_link_libraries(testlib PRIVATE unresolved) -install(TARGETS testlib DESTINATION lib) - -install(CODE [[ - file(GET_RUNTIME_DEPENDENCIES - PRE_INCLUDE_REGEXES "^libunresolved\\.so$" - PRE_EXCLUDE_REGEXES ".*" - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/lib/$" - ) - message(FATAL_ERROR "This message should not be displayed") - ]]) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux.cmake deleted file mode 100644 index bd0f9f1..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux.cmake +++ /dev/null @@ -1,169 +0,0 @@ -enable_language(C) -cmake_policy(SET CMP0095 NEW) - -set(test_rpath_names - preexcluded - rpath_postexcluded - rpath - rpath_parent_postexcluded - rpath_parent - rpath_origin_postexcluded - rpath_origin - rpath_search_postexcluded - rpath_search - rpath_unresolved - conflict - ) -set(test_runpath_names - runpath_postexcluded - runpath - runpath_origin_postexcluded - runpath_origin - runpath_parent_unresolved - runpath_search_postexcluded - runpath_search - runpath_unresolved - ) - -file(REMOVE "${CMAKE_BINARY_DIR}/test_rpath.c") -add_library(test_rpath SHARED "${CMAKE_BINARY_DIR}/test_rpath.c") -foreach(name ${test_rpath_names}) - file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "void ${name}(void) {}\n") - add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c") - - file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" "extern void ${name}(void);\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" "void test_rpath(void)\n{\n") -foreach(name ${test_rpath_names}) - file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" " ${name}();\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" "}\n") - -install(TARGETS rpath_postexcluded DESTINATION lib/rpath_postexcluded) -install(TARGETS rpath DESTINATION lib/rpath) -install(TARGETS rpath_origin_postexcluded DESTINATION lib/rpath_origin_postexcluded) -install(TARGETS rpath_origin DESTINATION lib/rpath_origin) -install(TARGETS rpath_parent_postexcluded DESTINATION lib/rpath_parent_postexcluded) -install(TARGETS rpath rpath_origin rpath_parent DESTINATION lib/rpath_parent) -install(TARGETS rpath_search_postexcluded DESTINATION lib/rpath_search_postexcluded) -install(TARGETS rpath rpath_origin rpath_parent rpath_search DESTINATION lib/rpath_search) -install(TARGETS conflict DESTINATION lib/conflict) - -target_link_libraries(test_rpath PRIVATE ${test_rpath_names}) -set_property(TARGET test_rpath PROPERTY INSTALL_RPATH - "${CMAKE_BINARY_DIR}/root-all/lib/rpath_postexcluded" - "${CMAKE_BINARY_DIR}/root-all/lib/rpath" - "\$ORIGIN/rpath_origin_postexcluded" - "\${ORIGIN}/rpath_origin" - "${CMAKE_BINARY_DIR}/root-all/lib/conflict" - ) -target_link_options(test_rpath PRIVATE -Wl,--disable-new-dtags) - -file(REMOVE "${CMAKE_BINARY_DIR}/test_runpath.c") -add_library(test_runpath SHARED "${CMAKE_BINARY_DIR}/test_runpath.c") -foreach(name ${test_runpath_names} rpath conflict) - file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "void ${name}(void) {}\n") - if(NOT name MATCHES "^(rpath|conflict)$") - add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c") - endif() - - file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" "extern void ${name}(void);\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" "void test_runpath(void)\n{\n") -foreach(name ${test_runpath_names} rpath conflict) - file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" " ${name}();\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" "}\n") - -install(TARGETS runpath_postexcluded DESTINATION lib/runpath_postexcluded) -install(TARGETS runpath DESTINATION lib/runpath) -install(TARGETS runpath_origin_postexcluded DESTINATION lib/runpath_origin_postexcluded) -install(TARGETS runpath_origin DESTINATION lib/runpath_origin) -install(TARGETS runpath_parent_unresolved DESTINATION lib/runpath_parent_unresolved) -install(TARGETS runpath_search_postexcluded DESTINATION lib/runpath_search_postexcluded) -install(TARGETS runpath runpath_origin runpath_search DESTINATION lib/runpath_search) -install(TARGETS conflict DESTINATION lib/conflict2) - -target_link_libraries(test_runpath PRIVATE ${test_runpath_names} rpath conflict) -set_property(TARGET test_runpath PROPERTY INSTALL_RPATH - "${CMAKE_BINARY_DIR}/root-all/lib/runpath/../rpath" # Ensure that files that don't conflict are treated correctly - "${CMAKE_BINARY_DIR}/root-all/lib/runpath_postexcluded" - "${CMAKE_BINARY_DIR}/root-all/lib/runpath" - "\${ORIGIN}/runpath_origin_postexcluded" - "\$ORIGIN/runpath_origin" - "${CMAKE_BINARY_DIR}/root-all/lib/conflict2" - ) -target_link_options(test_runpath PRIVATE -Wl,--enable-new-dtags) - -set_property(TARGET test_rpath ${test_rpath_names} test_runpath ${test_runpath_names} PROPERTY LIBRARY_OUTPUT_DIRECTORY lib) -install(TARGETS test_rpath test_runpath DESTINATION lib) - -add_executable(topexe file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c) -add_library(toplib SHARED file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c) -add_library(topmod MODULE file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c) -target_link_libraries(topexe PRIVATE test_rpath test_runpath) -target_link_libraries(toplib PRIVATE test_rpath test_runpath) -target_link_libraries(topmod PRIVATE test_rpath test_runpath) -set_property(TARGET topexe toplib topmod PROPERTY INSTALL_RPATH - "${CMAKE_BINARY_DIR}/root-all/lib" - "${CMAKE_BINARY_DIR}/root-all/lib/rpath_parent_postexcluded" - "${CMAKE_BINARY_DIR}/root-all/lib/rpath_parent" - "${CMAKE_BINARY_DIR}/root-all/lib/runpath_parent_unresolved" - ) -target_link_options(topexe PRIVATE -Wl,--disable-new-dtags) -target_link_options(toplib PRIVATE -Wl,--disable-new-dtags) -target_link_options(topmod PRIVATE -Wl,--disable-new-dtags) - -install(TARGETS topexe toplib RUNTIME DESTINATION bin LIBRARY DESTINATION lib) -install(TARGETS topmod LIBRARY DESTINATION lib/modules) - -install(CODE [[ - function(exec_get_runtime_dependencies depsfile udepsfile cdepsfile) - file(GET_RUNTIME_DEPENDENCIES - RESOLVED_DEPENDENCIES_VAR deps - UNRESOLVED_DEPENDENCIES_VAR udeps - CONFLICTING_DEPENDENCIES_PREFIX cdeps - PRE_INCLUDE_REGEXES - "^lib(test_rpath|rpath_postexcluded|rpath|rpath_parent_postexcluded|rpath_parent|rpath_origin_postexcluded|rpath_origin|rpath_search_postexcluded|rpath_search|rpath_unresolved|test_runpath|runpath_postexcluded|runpath|runpath_origin_postexcluded|runpath_origin|runpath_parent_unresolved|runpath_search_postexcluded|runpath_search|runpath_unresolved|conflict)\\.so$" - "^libc\\.so" - PRE_EXCLUDE_REGEXES ".*" - POST_INCLUDE_REGEXES "^.*/(libtest_rpath|rpath/librpath|rpath_parent/librpath_parent|rpath_search/librpath_search|libtest_runpath|runpath/librunpath|runpath_origin_postexcluded|runpath_origin|runpath_search/librunpath_search|conflict2?/libconflict)\\.so$" - POST_EXCLUDE_REGEXES ".*" - DIRECTORIES - "${CMAKE_INSTALL_PREFIX}/lib/rpath_search_postexcluded" - "${CMAKE_INSTALL_PREFIX}/lib/rpath_search" - "${CMAKE_INSTALL_PREFIX}/lib/runpath_search_postexcluded" - "${CMAKE_INSTALL_PREFIX}/lib/runpath_search" - ${ARGN} - ) - list(SORT deps) - list(SORT udeps) - list(SORT cdeps_FILENAMES) - file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${depsfile}" "${deps}") - file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${udepsfile}" "${udeps}") - file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "") - foreach(cdep IN LISTS cdeps_FILENAMES) - set(cdep_values ${cdeps_${cdep}}) - list(SORT cdep_values) - file(APPEND "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "${cdep}:${cdep_values}\n") - endforeach() - endfunction() - - exec_get_runtime_dependencies( - deps1.txt udeps1.txt cdeps1.txt - EXECUTABLES - "${CMAKE_INSTALL_PREFIX}/bin/$" - ) - - exec_get_runtime_dependencies( - deps2.txt udeps2.txt cdeps2.txt - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/lib/$" - ) - - exec_get_runtime_dependencies( - deps3.txt udeps3.txt cdeps3.txt - MODULES - "${CMAKE_INSTALL_PREFIX}/lib/modules/$" - ) - ]]) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c deleted file mode 100644 index d196afe..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c +++ /dev/null @@ -1,9 +0,0 @@ -extern void test_rpath(void); -extern void test_runpath(void); - -int main(void) -{ - test_rpath(); - test_runpath(); - return 0; -} diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c deleted file mode 100644 index 040e591..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c +++ /dev/null @@ -1,8 +0,0 @@ -extern void test_rpath(void); -extern void test_runpath(void); - -void toplib(void) -{ - test_rpath(); - test_runpath(); -} diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-all-check.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-all-check.cmake deleted file mode 100644 index 4d6dde1..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-all-check.cmake +++ /dev/null @@ -1,157 +0,0 @@ -function(check_contents filename contents_regex) - if(EXISTS "${CMAKE_INSTALL_PREFIX}/${filename}") - file(READ "${CMAKE_INSTALL_PREFIX}/${filename}" contents) - if(NOT contents MATCHES "${contents_regex}") - string(APPEND RunCMake_TEST_FAILED "File contents: - ${contents} -do not match what we expected: - ${contents_regex} -in file: - ${CMAKE_INSTALL_PREFIX}/${filename}\n") - set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) - endif() - else() - string(APPEND RunCMake_TEST_FAILED "File ${CMAKE_INSTALL_PREFIX}/${filename} does not exist") - set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) - endif() -endfunction() - -set(_check - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/bin/../lib/executable_path/libexecutable_path\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/bin/../lib/rpath_executable_path/librpath_executable_path\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] - [[/usr/lib/libSystem\.B\.dylib]] - ) -check_contents(deps/deps1.txt "^${_check}$") - -set(_check - [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] - [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] - [[@rpath/librpath_executable_path_bundle\.dylib]] - [[@rpath/librpath_loader_path_unresolved\.dylib]] - [[@rpath/librpath_unresolved\.dylib]] - ) -check_contents(deps/udeps1.txt "^${_check}$") - -set(_check - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] - [[/usr/lib/libSystem\.B\.dylib]] - ) -check_contents(deps/deps2.txt "^${_check}$") - -set(_check - [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]] - [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] - [[@executable_path/../lib/executable_path_postexcluded/libexecutable_path_postexcluded\.dylib]] - [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] - [[@rpath/librpath_executable_path\.dylib]] - [[@rpath/librpath_executable_path_bundle\.dylib]] - [[@rpath/librpath_executable_path_postexcluded\.dylib]] - [[@rpath/librpath_loader_path_unresolved\.dylib]] - [[@rpath/librpath_unresolved\.dylib]] - ) -check_contents(deps/udeps2.txt "^${_check}$") - -set(_check - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] - [[/usr/lib/libSystem\.B\.dylib]] - ) -check_contents(deps/deps3.txt "^${_check}$") - -set(_check - [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]] - [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] - [[@executable_path/../lib/executable_path_postexcluded/libexecutable_path_postexcluded\.dylib]] - [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] - [[@rpath/librpath_executable_path\.dylib]] - [[@rpath/librpath_executable_path_bundle\.dylib]] - [[@rpath/librpath_executable_path_postexcluded\.dylib]] - [[@rpath/librpath_loader_path_unresolved\.dylib]] - [[@rpath/librpath_unresolved\.dylib]] - ) -check_contents(deps/udeps3.txt "^${_check}$") - -set(_check - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/bin/../lib/executable_path/libexecutable_path\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/bin/../lib/rpath_executable_path/librpath_executable_path\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] - [[/usr/lib/libSystem\.B\.dylib]] - ) -check_contents(deps/deps4.txt "^${_check}$") - -set(_check - [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] - [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] - [[@rpath/librpath_executable_path_bundle\.dylib]] - [[@rpath/librpath_loader_path_unresolved\.dylib]] - [[@rpath/librpath_unresolved\.dylib]] - ) -check_contents(deps/udeps4.txt "^${_check}$") - -set(_check - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/bundle_executable/bin/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] - [[/usr/lib/libSystem\.B\.dylib]] - ) -check_contents(deps/deps5.txt "^${_check}$") - -set(_check - [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]] - [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] - [[@rpath/librpath_executable_path\.dylib]] - [[@rpath/librpath_executable_path_bundle\.dylib]] - [[@rpath/librpath_loader_path_unresolved\.dylib]] - [[@rpath/librpath_unresolved\.dylib]] - ) -check_contents(deps/udeps5.txt "^${_check}$") - -set(_check - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/bundle_executable/bin/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]] - [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] - [[/usr/lib/libSystem\.B\.dylib]] - ) -check_contents(deps/deps6.txt "^${_check}$") - -set(_check - [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]] - [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] - [[@rpath/librpath_executable_path\.dylib]] - [[@rpath/librpath_executable_path_bundle\.dylib]] - [[@rpath/librpath_loader_path_unresolved\.dylib]] - [[@rpath/librpath_unresolved\.dylib]] - ) -check_contents(deps/udeps6.txt "^${_check}$") - -set(_check - "^libconflict\\.dylib:[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/conflict/libconflict\\.dylib;[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/conflict2/libconflict\\.dylib\n$" - ) -check_contents(deps/cdeps1.txt "${_check}") -check_contents(deps/cdeps2.txt "${_check}") -check_contents(deps/cdeps3.txt "${_check}") -check_contents(deps/cdeps4.txt "${_check}") -check_contents(deps/cdeps5.txt "${_check}") -check_contents(deps/cdeps6.txt "${_check}") diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-stderr.txt deleted file mode 100644 index bc9e97a..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-stderr.txt +++ /dev/null @@ -1,7 +0,0 @@ -^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): - file Multiple conflicting paths found for librpath\.dylib: - - [^ -]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-build/root-all/lib/rpath1/librpath\.dylib - [^ -]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-build/root-all/lib/rpath2/librpath\.dylib$ diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict.cmake deleted file mode 100644 index a8446fe..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict.cmake +++ /dev/null @@ -1,55 +0,0 @@ -enable_language(C) - -set(test1_names rpath) -set(test2_names rpath) - -file(WRITE "${CMAKE_BINARY_DIR}/rpath.c" "void rpath(void) {}\n") -add_library(rpath SHARED "${CMAKE_BINARY_DIR}/rpath.c") -set_property(TARGET rpath PROPERTY INSTALL_NAME_DIR @rpath) -install(TARGETS rpath DESTINATION lib/rpath1) -install(TARGETS rpath DESTINATION lib/rpath2) - -file(REMOVE "${CMAKE_BINARY_DIR}/test1.c") -add_library(test1 SHARED "${CMAKE_BINARY_DIR}/test1.c") -foreach(name ${test1_names}) - file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "extern void ${name}(void);\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "void test1(void)\n{\n") -foreach(name ${test1_names}) - file(APPEND "${CMAKE_BINARY_DIR}/test1.c" " ${name}();\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "}\n") - -target_link_libraries(test1 PRIVATE ${test1_names}) -set_property(TARGET test1 PROPERTY INSTALL_RPATH - "${CMAKE_BINARY_DIR}/root-all/lib/rpath1" - ) - -file(REMOVE "${CMAKE_BINARY_DIR}/test2.c") -add_library(test2 SHARED "${CMAKE_BINARY_DIR}/test2.c") -foreach(name ${test2_names}) - file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "extern void ${name}(void);\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "void test2(void)\n{\n") -foreach(name ${test2_names}) - file(APPEND "${CMAKE_BINARY_DIR}/test2.c" " ${name}();\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "}\n") - -target_link_libraries(test2 PRIVATE ${test2_names}) -set_property(TARGET test2 PROPERTY INSTALL_RPATH - "${CMAKE_BINARY_DIR}/root-all/lib/rpath2" - ) - -install(TARGETS test1 test2 DESTINATION lib) - -install(CODE [[ - file(GET_RUNTIME_DEPENDENCIES - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/lib/$" - "${CMAKE_INSTALL_PREFIX}/lib/$" - PRE_INCLUDE_REGEXES "^@rpath/librpath\\.dylib$" - PRE_EXCLUDE_REGEXES ".*" - ) - message(FATAL_ERROR "This message should not be displayed") - ]]) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-stderr.txt deleted file mode 100644 index 73ab9f1..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): - file Failed to run otool on: - - [^ -]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-build/root-all/bin/\.\./lib/libtest\.dylib$ diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile.cmake deleted file mode 100644 index 3e4c434..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile.cmake +++ /dev/null @@ -1,30 +0,0 @@ -enable_language(C) - -file(WRITE "${CMAKE_BINARY_DIR}/test.c" "void test(void) {}\n") -file(WRITE "${CMAKE_BINARY_DIR}/main.c" [[extern void test(void); - -int main(void) -{ - test(); - return 0; -} -]]) - -add_library(test SHARED "${CMAKE_BINARY_DIR}/test.c") -set_property(TARGET test PROPERTY INSTALL_NAME_DIR @rpath) -add_executable(exe "${CMAKE_BINARY_DIR}/main.c") -target_link_libraries(exe PRIVATE test) -set_property(TARGET exe PROPERTY INSTALL_RPATH "@loader_path/../lib") - -install(TARGETS exe DESTINATION bin) - -install(CODE [[ - file(MAKE_DIRECTORY "${CMAKE_INSTALL_PREFIX}/lib/$") - file(GET_RUNTIME_DEPENDENCIES - EXECUTABLES - "${CMAKE_INSTALL_PREFIX}/bin/$" - PRE_INCLUDE_REGEXES "^@rpath/libtest\\.dylib$" - PRE_EXCLUDE_REGEXES ".*" - ) - message(FATAL_ERROR "This message should not be displayed") - ]]) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-stderr.txt deleted file mode 100644 index 01762b4..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-stderr.txt +++ /dev/null @@ -1,2 +0,0 @@ -^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): - file Could not resolve file @rpath/libunresolved\.dylib$ diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved.cmake deleted file mode 100644 index c9b6c95..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved.cmake +++ /dev/null @@ -1,18 +0,0 @@ -enable_language(C) - -file(WRITE "${CMAKE_BINARY_DIR}/testlib.c" "extern void unresolved(void);\nvoid testlib(void)\n{\n unresolved();\n}\n") -add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c") -file(WRITE "${CMAKE_BINARY_DIR}/unresolved.c" "void unresolved(void) {}\n") -add_library(unresolved SHARED "${CMAKE_BINARY_DIR}/unresolved.c") -target_link_libraries(testlib PRIVATE unresolved) -install(TARGETS testlib DESTINATION lib) - -install(CODE [[ - file(GET_RUNTIME_DEPENDENCIES - PRE_INCLUDE_REGEXES "^@rpath/libunresolved\\.dylib$" - PRE_EXCLUDE_REGEXES ".*" - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/lib/$" - ) - message(FATAL_ERROR "This message should not be displayed") - ]]) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos.cmake deleted file mode 100644 index 6db05b3..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos.cmake +++ /dev/null @@ -1,216 +0,0 @@ -enable_language(C) - -set(testlib_names - preexcluded - executable_path - executable_path_bundle - executable_path_postexcluded - loader_path - loader_path_unresolved - loader_path_postexcluded - rpath - rpath_unresolved - rpath_postexcluded - rpath_executable_path - rpath_executable_path_bundle - rpath_executable_path_postexcluded - rpath_loader_path - rpath_loader_path_unresolved - rpath_loader_path_postexcluded - normal - normal_unresolved - normal_postexcluded - conflict - ) - -file(REMOVE "${CMAKE_BINARY_DIR}/testlib.c") -add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c") -foreach(name ${testlib_names}) - if(name STREQUAL "normal") - file(WRITE "${CMAKE_BINARY_DIR}/normal.c" "extern void rpath(void);\nvoid normal(void)\n{\n rpath();\n}\n") - else() - file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "void ${name}(void) {}\n") - endif() - add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c") - - file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "extern void ${name}(void);\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "void testlib(void)\n{\n") -foreach(name ${testlib_names}) - file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" " ${name}();\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "}\n") -set_property(TARGET ${testlib_names} PROPERTY BUILD_WITH_INSTALL_NAME_DIR 1) -target_link_libraries(normal PRIVATE rpath) -set_property(TARGET normal PROPERTY INSTALL_RPATH - "${CMAKE_BINARY_DIR}/root-all/executable/lib/normal/../rpath" - ) - -file(WRITE "${CMAKE_BINARY_DIR}/testlib_conflict.c" "extern void conflict(void);\nvoid testlib_conflict(void)\n{\n conflict();\n}\n") -add_library(testlib_conflict SHARED "${CMAKE_BINARY_DIR}/testlib_conflict.c") -target_link_libraries(testlib_conflict PRIVATE conflict) - -set_property(TARGET testlib PROPERTY INSTALL_RPATH - "${CMAKE_BINARY_DIR}/root-all/executable/lib/rpath" - "${CMAKE_BINARY_DIR}/root-all/executable/lib/rpath_unresolved" - "${CMAKE_BINARY_DIR}/root-all/executable/lib/rpath_postexcluded" - "${CMAKE_BINARY_DIR}/root-all/executable/lib/conflict" - @executable_path/../lib/rpath_executable_path - @executable_path/../lib/rpath_executable_path_unresolved - @executable_path/../lib/rpath_executable_path_postexcluded - @loader_path/rpath_loader_path - @loader_path/rpath_loader_path_unresolved - @loader_path/rpath_loader_path_postexcluded - ) -set_property(TARGET testlib_conflict PROPERTY INSTALL_RPATH - "${CMAKE_BINARY_DIR}/root-all/executable/lib/conflict2" - ) - -foreach(t - executable_path - executable_path_postexcluded - loader_path - loader_path_postexcluded - rpath - rpath_postexcluded - rpath_executable_path - rpath_executable_path_postexcluded - rpath_loader_path - rpath_loader_path_postexcluded - conflict - ) - install(TARGETS ${t} DESTINATION executable/lib/${t}) -endforeach() -install(TARGETS conflict DESTINATION executable/lib/conflict2) - -foreach(t - executable_path_bundle - executable_path_postexcluded - loader_path_postexcluded - rpath_postexcluded - rpath_executable_path_bundle - rpath_executable_path_postexcluded - rpath_loader_path_postexcluded - ) - install(TARGETS ${t} DESTINATION bundle_executable/lib/${t}) -endforeach() - -foreach(t executable_path executable_path_bundle executable_path_postexcluded) - set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR @executable_path/../lib/${t}) -endforeach() - -foreach(t loader_path loader_path_unresolved loader_path_postexcluded) - set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR @loader_path/${t}) -endforeach() - -foreach(t - rpath - rpath_unresolved - rpath_postexcluded - rpath_executable_path - rpath_executable_path_bundle - rpath_executable_path_postexcluded - rpath_loader_path - rpath_loader_path_unresolved - rpath_loader_path_postexcluded - conflict - ) - set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR @rpath) -endforeach() - -foreach(t normal normal_unresolved normal_postexcluded) - set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR "${CMAKE_BINARY_DIR}/root-all/executable/lib/${t}") - if(NOT t STREQUAL "normal_unresolved") - install(TARGETS ${t} DESTINATION executable/lib/${t}) - endif() -endforeach() - -target_link_libraries(testlib PRIVATE ${testlib_names}) - -add_executable(topexe file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c) -add_library(toplib SHARED file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c) -add_library(topmod MODULE file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c) -target_link_libraries(topexe PRIVATE testlib) -target_link_libraries(toplib PRIVATE testlib) -target_link_libraries(topmod PRIVATE testlib) - -set_property(TARGET topexe toplib topmod PROPERTY INSTALL_RPATH "${CMAKE_BINARY_DIR}/root-all/executable/lib") - -install(TARGETS topexe toplib topmod testlib testlib_conflict RUNTIME DESTINATION executable/bin LIBRARY DESTINATION executable/lib) -install(TARGETS topexe toplib topmod testlib testlib_conflict RUNTIME DESTINATION bundle_executable/bin LIBRARY DESTINATION bundle_executable/lib) - -install(CODE [[ - function(exec_get_runtime_dependencies depsfile udepsfile cdepsfile) - file(GET_RUNTIME_DEPENDENCIES - RESOLVED_DEPENDENCIES_VAR deps - UNRESOLVED_DEPENDENCIES_VAR udeps - CONFLICTING_DEPENDENCIES_PREFIX cdeps - PRE_INCLUDE_REGEXES "^.*/lib(testlib|executable_path|executable_path_bundle|executable_path_postexcluded|loader_path|loader_path_unresolved|loader_path_postexcluded|rpath|rpath_unresolved|rpath_postexcluded|rpath_executable_path|rpath_executable_path_bundle|rpath_executable_path_postexcluded|rpath_loader_path|rpath_loader_path_unresolved|rpath_loader_path_postexcluded|normal|normal_unresolved|normal_postexcluded|conflict|System\\.B)\\.dylib$" - PRE_EXCLUDE_REGEXES ".*" - POST_INCLUDE_REGEXES "^.*/lib(testlib|executable_path|executable_path_bundle|loader_path|rpath|rpath_executable_path|rpath_executable_path_bundle|rpath_loader_path|normal|conflict|System\\.B)\\.dylib$" - POST_EXCLUDE_REGEXES ".*" - ${ARGN} - ) - list(SORT deps) - list(SORT udeps) - list(SORT cdeps_FILENAMES) - file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${depsfile}" "${deps}") - file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${udepsfile}" "${udeps}") - file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "") - foreach(cdep IN LISTS cdeps_FILENAMES) - set(cdep_values ${cdeps_${cdep}}) - list(SORT cdep_values) - file(APPEND "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "${cdep}:${cdep_values}\n") - endforeach() - endfunction() - - exec_get_runtime_dependencies( - deps1.txt udeps1.txt cdeps1.txt - EXECUTABLES - "${CMAKE_INSTALL_PREFIX}/executable/bin/$" - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/executable/lib/$" - ) - - exec_get_runtime_dependencies( - deps2.txt udeps2.txt cdeps2.txt - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/executable/lib/$" - "${CMAKE_INSTALL_PREFIX}/executable/lib/$" - ) - - exec_get_runtime_dependencies( - deps3.txt udeps3.txt cdeps3.txt - MODULES - "${CMAKE_INSTALL_PREFIX}/executable/lib/$" - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/executable/lib/$" - ) - - exec_get_runtime_dependencies( - deps4.txt udeps4.txt cdeps4.txt - EXECUTABLES - "${CMAKE_INSTALL_PREFIX}/executable/bin/$" - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/executable/lib/$" - BUNDLE_EXECUTABLE - "${CMAKE_INSTALL_PREFIX}/bundle_executable/bin/$" - ) - - exec_get_runtime_dependencies( - deps5.txt udeps5.txt cdeps5.txt - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/executable/lib/$" - "${CMAKE_INSTALL_PREFIX}/executable/lib/$" - BUNDLE_EXECUTABLE "${CMAKE_INSTALL_PREFIX}/bundle_executable/bin/$" - ) - - exec_get_runtime_dependencies( - deps6.txt udeps6.txt cdeps6.txt - MODULES - "${CMAKE_INSTALL_PREFIX}/executable/lib/$" - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/executable/lib/$" - BUNDLE_EXECUTABLE "${CMAKE_INSTALL_PREFIX}/bundle_executable/bin/$" - ) - ]]) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c deleted file mode 100644 index 20c6087..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c +++ /dev/null @@ -1,7 +0,0 @@ -extern void testlib(void); - -int main(void) -{ - testlib(); - return 0; -} diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c deleted file mode 100644 index cff1bff..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c +++ /dev/null @@ -1,6 +0,0 @@ -extern void testlib(void); - -void toplib(void) -{ - testlib(); -} diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project-stderr.txt deleted file mode 100644 index d506645..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project-stderr.txt +++ /dev/null @@ -1,13 +0,0 @@ -^CMake Warning \(dev\) at file-GET_RUNTIME_DEPENDENCIES-project\.cmake:[0-9]+ \(file\): - You have used file\(GET_RUNTIME_DEPENDENCIES\) in project mode\. This is - probably not what you intended to do\. Instead, please consider using it in - an install\(CODE\) or install\(SCRIPT\) command\. For example: - - install\(CODE \[\[ - file\(GET_RUNTIME_DEPENDENCIES - # \.\.\. - \) - ]]\) -Call Stack \(most recent call first\): - CMakeLists\.txt:[0-9]+ \(include\) -This warning is for project developers\. Use -Wno-dev to suppress it\.$ diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project.cmake deleted file mode 100644 index 842d7ab..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project.cmake +++ /dev/null @@ -1 +0,0 @@ -file(GET_RUNTIME_DEPENDENCIES RESOLVED_DEPENDENCIES_VAR deps) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-stderr.txt deleted file mode 100644 index 3db835c..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -^CMake Error at file-GET_RUNTIME_DEPENDENCIES-unsupported\.cmake:[0-9]+ \(file\): - file GET_RUNTIME_DEPENDENCIES is not supported on system "[^ - ]+" -Call Stack \(most recent call first\): - CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported.cmake deleted file mode 100644 index b91eefe..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported.cmake +++ /dev/null @@ -1,2 +0,0 @@ -file(GET_RUNTIME_DEPENDENCIES RESOLVED_DEPENDENCIES_VAR deps) -message(FATAL_ERROR "This message should not be displayed") diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-all-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-all-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-all-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-all-stderr.txt deleted file mode 100644 index 591a5e7..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-all-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -^CMake Error at cmake_install\.cmake:[0-9]+ \(message\): -.* -.*CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM: custom-platform.* -.*CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL: custom-platform-objdump.* -.*CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND: path/to/custom-objdump.* -.*CMAKE_OBJDUMP: custom-objdump.* diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-dev-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-dev-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-dev-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-dev-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-dev-stderr.txt deleted file mode 100644 index 591a5e7..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-dev-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -^CMake Error at cmake_install\.cmake:[0-9]+ \(message\): -.* -.*CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM: custom-platform.* -.*CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL: custom-platform-objdump.* -.*CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND: path/to/custom-objdump.* -.*CMAKE_OBJDUMP: custom-objdump.* diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-variable-propagation.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-variable-propagation.cmake deleted file mode 100644 index 07bbc5e..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-variable-propagation.cmake +++ /dev/null @@ -1,17 +0,0 @@ -enable_language(C) - -set(CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM "custom-platform") -set(CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL "custom-platform-objdump") -set(CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND "path/to/custom-objdump") -set(CMAKE_OBJDUMP "custom-objdump") - -install(CODE [[ -message(FATAL_ERROR " - CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM: ${CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM} - CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL: ${CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL} - CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND: ${CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND} - CMAKE_OBJDUMP: ${CMAKE_OBJDUMP} -") -]] -COMPONENT dev -) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-all-check.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-all-check.cmake deleted file mode 100644 index c120ce4..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-all-check.cmake +++ /dev/null @@ -1,38 +0,0 @@ -function(check_contents filename contents_regex) - if(EXISTS "${CMAKE_INSTALL_PREFIX}/${filename}") - file(READ "${CMAKE_INSTALL_PREFIX}/${filename}" contents) - if(NOT contents MATCHES "${contents_regex}") - string(APPEND RunCMake_TEST_FAILED "File contents: - ${contents} -do not match what we expected: - ${contents_regex} -in file: - ${CMAKE_INSTALL_PREFIX}/${filename}\n") - set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) - endif() - else() - string(APPEND RunCMake_TEST_FAILED "File ${CMAKE_INSTALL_PREFIX}/${filename} does not exist") - set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) - endif() -endfunction() - -set(_check - [=[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/\.conflict/\.\./(lib)?libdir\.dll]=] - [=[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/\.search/(lib)?search\.dll]=] - [=[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/(lib)?testlib\.dll]=] - ) -check_contents(deps/deps1.txt "^${_check}$") -check_contents(deps/deps2.txt "^${_check}$") -check_contents(deps/deps3.txt "^${_check}$") -set(_check - [=[(lib)?unresolved\.dll]=] - ) -check_contents(deps/udeps1.txt "^${_check}$") -check_contents(deps/udeps2.txt "^${_check}$") -check_contents(deps/udeps3.txt "^${_check}$") -set(_check - "^(lib)?conflict\\.dll:[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/\\.conflict/(lib)?conflict\\.dll;[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/(lib)?conflict\\.dll\n$" - ) -check_contents(deps/cdeps1.txt "${_check}") -check_contents(deps/cdeps2.txt "${_check}") -check_contents(deps/cdeps3.txt "${_check}") diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-stderr.txt deleted file mode 100644 index 66ecb93..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-stderr.txt +++ /dev/null @@ -1,7 +0,0 @@ -^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): - file Multiple conflicting paths found for (lib)?path\.dll: - - [^ -]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-build/root-all/lib/test1/(lib)?path\.dll - [^ -]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-build/root-all/lib/test2/(lib)?path\.dll$ diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict.cmake deleted file mode 100644 index d413443..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict.cmake +++ /dev/null @@ -1,47 +0,0 @@ -enable_language(C) - -set(test1_names path) -set(test2_names path) - -file(WRITE "${CMAKE_BINARY_DIR}/path.c" "__declspec(dllexport) void path(void) {}\n") -add_library(path SHARED "${CMAKE_BINARY_DIR}/path.c") - -file(REMOVE "${CMAKE_BINARY_DIR}/test1.c") -add_library(test1 SHARED "${CMAKE_BINARY_DIR}/test1.c") -foreach(name ${test1_names}) - file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "__declspec(dllimport) extern void ${name}(void);\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "__declspec(dllexport) void test1(void)\n{\n") -foreach(name ${test1_names}) - file(APPEND "${CMAKE_BINARY_DIR}/test1.c" " ${name}();\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "}\n") - -target_link_libraries(test1 PRIVATE ${test1_names}) - -file(REMOVE "${CMAKE_BINARY_DIR}/test2.c") -add_library(test2 SHARED "${CMAKE_BINARY_DIR}/test2.c") -foreach(name ${test2_names}) - file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "__declspec(dllimport) extern void ${name}(void);\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "__declspec(dllexport) void test2(void)\n{\n") -foreach(name ${test2_names}) - file(APPEND "${CMAKE_BINARY_DIR}/test2.c" " ${name}();\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "}\n") - -target_link_libraries(test2 PRIVATE ${test2_names}) - -install(TARGETS test1 path DESTINATION lib/test1) -install(TARGETS test2 path DESTINATION lib/test2) - -install(CODE [[ - file(GET_RUNTIME_DEPENDENCIES - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/lib/test1/$" - "${CMAKE_INSTALL_PREFIX}/lib/test2/$" - PRE_INCLUDE_REGEXES "^(lib)?path\\.dll$" - PRE_EXCLUDE_REGEXES ".*" - ) - message(FATAL_ERROR "This message should not be displayed") - ]]) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-stderr.txt deleted file mode 100644 index f921409..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): - file Failed to run (dumpbin|objdump) on: - - [^ -]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-build/root-all/bin/(lib)?test\.dll$ diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile.cmake deleted file mode 100644 index 6665a3b..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile.cmake +++ /dev/null @@ -1,28 +0,0 @@ -enable_language(C) - -file(WRITE "${CMAKE_BINARY_DIR}/test.c" "__declspec(dllexport) void test(void) {}\n") -file(WRITE "${CMAKE_BINARY_DIR}/main.c" [[__declspec(dllimport) extern void test(void); - -int main(void) -{ - test(); - return 0; -} -]]) - -add_library(test SHARED "${CMAKE_BINARY_DIR}/test.c") -add_executable(exe "${CMAKE_BINARY_DIR}/main.c") -target_link_libraries(exe PRIVATE test) - -install(TARGETS exe DESTINATION bin) - -install(CODE [[ - file(MAKE_DIRECTORY "${CMAKE_INSTALL_PREFIX}/bin/$") - file(GET_RUNTIME_DEPENDENCIES - EXECUTABLES - "${CMAKE_INSTALL_PREFIX}/bin/$" - PRE_INCLUDE_REGEXES "^(lib)?test\\.dll$" - PRE_EXCLUDE_REGEXES ".*" - ) - message(FATAL_ERROR "This message should not be displayed") - ]]) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-stderr.txt deleted file mode 100644 index a20654c..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-stderr.txt +++ /dev/null @@ -1,2 +0,0 @@ -^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): - file Could not resolve file (lib)?unresolved\.dll$ diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved.cmake deleted file mode 100644 index 4cc74c7..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved.cmake +++ /dev/null @@ -1,18 +0,0 @@ -enable_language(C) - -file(WRITE "${CMAKE_BINARY_DIR}/testlib.c" "__declspec(dllimport) extern void unresolved(void);\n__declspec(dllexport) void testlib(void)\n{\n unresolved();\n}\n") -add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c") -file(WRITE "${CMAKE_BINARY_DIR}/unresolved.c" "__declspec(dllexport) void unresolved(void) {}\n") -add_library(unresolved SHARED "${CMAKE_BINARY_DIR}/unresolved.c") -target_link_libraries(testlib PRIVATE unresolved) -install(TARGETS testlib DESTINATION lib) - -install(CODE [[ - file(GET_RUNTIME_DEPENDENCIES - PRE_INCLUDE_REGEXES "^(lib)?unresolved\\.dll$" - PRE_EXCLUDE_REGEXES ".*" - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/lib/$" - ) - message(FATAL_ERROR "This message should not be displayed") - ]]) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows.cmake deleted file mode 100644 index 19288d8..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows.cmake +++ /dev/null @@ -1,114 +0,0 @@ -enable_language(C) - -set(testlib_names - preexcluded - libdir_postexcluded - libdir - search_postexcluded - search - unresolved - conflict - ) - -file(REMOVE "${CMAKE_BINARY_DIR}/testlib.c") -add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c") -foreach(name ${testlib_names}) - file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "__declspec(dllexport) void ${name}(void) {}\n") - add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c") - - file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "__declspec(dllimport) extern void ${name}(void);\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "__declspec(dllexport) void testlib(void)\n{\n") -foreach(name ${testlib_names}) - file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" " ${name}();\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "}\n") - -target_link_libraries(testlib PRIVATE ${testlib_names}) - -file(WRITE "${CMAKE_BINARY_DIR}/testlib_conflict.c" "__declspec(dllimport) extern void conflict(void);\n__declspec(dllexport) void testlib_conflict(void)\n{\n conflict();\n}\n") -add_library(testlib_conflict SHARED "${CMAKE_BINARY_DIR}/testlib_conflict.c") -target_link_libraries(testlib_conflict PRIVATE conflict) - -file(WRITE "${CMAKE_BINARY_DIR}/testlib_noconflict.c" "__declspec(dllimport) extern void libdir(void);\n__declspec(dllexport) void testlib_noconflict(void)\n{\n libdir();\n}\n") -add_library(testlib_noconflict SHARED "${CMAKE_BINARY_DIR}/testlib_noconflict.c") -target_link_libraries(testlib_noconflict PRIVATE libdir) - -install(TARGETS testlib libdir_postexcluded libdir conflict testlib_noconflict DESTINATION bin) -install(TARGETS libdir search_postexcluded search DESTINATION bin/.search) # Prefixing with "." ensures it is the first item after list(SORT) -install(TARGETS testlib_conflict conflict DESTINATION bin/.conflict) - -add_executable(topexe file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c) -add_library(toplib SHARED file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c) -add_library(topmod MODULE file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c) -target_link_libraries(topexe PRIVATE testlib) -target_link_libraries(toplib PRIVATE testlib) -target_link_libraries(topmod PRIVATE testlib) - -install(TARGETS topexe toplib topmod DESTINATION bin) - -install(CODE [[ - function(exec_get_runtime_dependencies depsfile udepsfile cdepsfile) - file(GET_RUNTIME_DEPENDENCIES - RESOLVED_DEPENDENCIES_VAR deps - UNRESOLVED_DEPENDENCIES_VAR udeps - CONFLICTING_DEPENDENCIES_PREFIX cdeps - PRE_INCLUDE_REGEXES - "^(lib)?testlib\\.dll$" - "^(lib)?libdir_postexcluded\\.dll$" - "^(lib)?libdir\\.dll$" - "^(lib)?search_postexcluded\\.dll$" - "^(lib)?search\\.dll$" - "^(lib)?unresolved\\.dll$" - "^(lib)?conflict\\.dll$" - "^kernel32\\.dll$" - PRE_EXCLUDE_REGEXES ".*" - POST_INCLUDE_REGEXES - "^.*/(lib)?testlib\\.dll$" - "^.*/(lib)?libdir\\.dll$" - "^.*/(lib)?search\\.dll$" - "^.*/(lib)?conflict\\.dll$" - POST_EXCLUDE_REGEXES ".*" - DIRECTORIES - "${CMAKE_INSTALL_PREFIX}/bin/.search" - ${ARGN} - ) - list(SORT deps) - list(SORT udeps) - list(SORT cdeps_FILENAMES) - file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${depsfile}" "${deps}") - file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${udepsfile}" "${udeps}") - file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "") - foreach(cdep IN LISTS cdeps_FILENAMES) - set(cdep_values ${cdeps_${cdep}}) - list(SORT cdep_values) - file(APPEND "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "${cdep}:${cdep_values}\n") - endforeach() - endfunction() - - exec_get_runtime_dependencies( - deps1.txt udeps1.txt cdeps1.txt - EXECUTABLES - "${CMAKE_INSTALL_PREFIX}/bin/$" - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/bin/.conflict/$" - "${CMAKE_INSTALL_PREFIX}/bin/.conflict/../$" - ) - - exec_get_runtime_dependencies( - deps2.txt udeps2.txt cdeps2.txt - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/bin/$" - "${CMAKE_INSTALL_PREFIX}/bin/.conflict/$" - "${CMAKE_INSTALL_PREFIX}/bin/.conflict/../$" - ) - - exec_get_runtime_dependencies( - deps3.txt udeps3.txt cdeps3.txt - MODULES - "${CMAKE_INSTALL_PREFIX}/bin/$" - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/bin/.conflict/$" - "${CMAKE_INSTALL_PREFIX}/bin/.conflict/../$" - ) - ]]) diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c deleted file mode 100644 index 713b8eb..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c +++ /dev/null @@ -1,7 +0,0 @@ -__declspec(dllimport) extern void testlib(void); - -int main(void) -{ - testlib(); - return 0; -} diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c deleted file mode 100644 index 6997175..0000000 --- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c +++ /dev/null @@ -1,6 +0,0 @@ -__declspec(dllimport) extern void testlib(void); - -__declspec(dllexport) void toplib(void) -{ - testlib(); -} -- cgit v0.12 From 9ae33828553597c22a71ad64938a7a4d66d4ebc7 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 16 Jun 2020 11:02:53 -0400 Subject: Tests: Shorten case names in RunCMake.file-GET_RUNTIME_DEPENDENCIES test Now that these cases are in a dedicated test we can drop the `file-GET_RUNTIME_DEPENDENCIES-` prefix from their name. --- .../RunCMakeTest.cmake | 46 ++--- .../badargs1-result.txt | 1 + .../badargs1-stderr.txt | 18 ++ .../file-GET_RUNTIME_DEPENDENCIES/badargs1.cmake | 2 + .../badargs2-result.txt | 1 + .../badargs2-stderr.txt | 23 +++ .../file-GET_RUNTIME_DEPENDENCIES/badargs2.cmake | 15 ++ ...le-GET_RUNTIME_DEPENDENCIES-badargs1-result.txt | 1 - ...le-GET_RUNTIME_DEPENDENCIES-badargs1-stderr.txt | 18 -- .../file-GET_RUNTIME_DEPENDENCIES-badargs1.cmake | 2 - ...le-GET_RUNTIME_DEPENDENCIES-badargs2-result.txt | 1 - ...le-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt | 23 --- .../file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake | 15 -- ...-GET_RUNTIME_DEPENDENCIES-linux-all-check.cmake | 44 ----- ...e-GET_RUNTIME_DEPENDENCIES-linux-all-stderr.txt | 119 ------------ ...TIME_DEPENDENCIES-linux-conflict-all-result.txt | 1 - ...TIME_DEPENDENCIES-linux-conflict-all-stderr.txt | 7 - ...e-GET_RUNTIME_DEPENDENCIES-linux-conflict.cmake | 54 ------ ...NTIME_DEPENDENCIES-linux-notfile-all-result.txt | 1 - ...NTIME_DEPENDENCIES-linux-notfile-all-stderr.txt | 5 - ...le-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake | 30 --- ...ME_DEPENDENCIES-linux-unresolved-all-result.txt | 1 - ...ME_DEPENDENCIES-linux-unresolved-all-stderr.txt | 2 - ...GET_RUNTIME_DEPENDENCIES-linux-unresolved.cmake | 18 -- .../file-GET_RUNTIME_DEPENDENCIES-linux.cmake | 169 ---------------- .../file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c | 9 - .../file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c | 8 - ...-GET_RUNTIME_DEPENDENCIES-macos-all-check.cmake | 157 --------------- ...TIME_DEPENDENCIES-macos-conflict-all-result.txt | 1 - ...TIME_DEPENDENCIES-macos-conflict-all-stderr.txt | 7 - ...e-GET_RUNTIME_DEPENDENCIES-macos-conflict.cmake | 55 ------ ...NTIME_DEPENDENCIES-macos-notfile-all-result.txt | 1 - ...NTIME_DEPENDENCIES-macos-notfile-all-stderr.txt | 5 - ...le-GET_RUNTIME_DEPENDENCIES-macos-notfile.cmake | 30 --- ...ME_DEPENDENCIES-macos-unresolved-all-result.txt | 1 - ...ME_DEPENDENCIES-macos-unresolved-all-stderr.txt | 2 - ...GET_RUNTIME_DEPENDENCIES-macos-unresolved.cmake | 18 -- .../file-GET_RUNTIME_DEPENDENCIES-macos.cmake | 216 --------------------- .../file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c | 7 - .../file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c | 6 - ...ile-GET_RUNTIME_DEPENDENCIES-project-stderr.txt | 13 -- .../file-GET_RUNTIME_DEPENDENCIES-project.cmake | 1 - ...GET_RUNTIME_DEPENDENCIES-unsupported-result.txt | 1 - ...GET_RUNTIME_DEPENDENCIES-unsupported-stderr.txt | 5 - ...file-GET_RUNTIME_DEPENDENCIES-unsupported.cmake | 2 - ...EPENDENCIES-variable-propagation-all-result.txt | 1 - ...EPENDENCIES-variable-propagation-all-stderr.txt | 6 - ...EPENDENCIES-variable-propagation-dev-result.txt | 1 - ...EPENDENCIES-variable-propagation-dev-stderr.txt | 6 - ...RUNTIME_DEPENDENCIES-variable-propagation.cmake | 17 -- ...ET_RUNTIME_DEPENDENCIES-windows-all-check.cmake | 38 ---- ...ME_DEPENDENCIES-windows-conflict-all-result.txt | 1 - ...ME_DEPENDENCIES-windows-conflict-all-stderr.txt | 7 - ...GET_RUNTIME_DEPENDENCIES-windows-conflict.cmake | 47 ----- ...IME_DEPENDENCIES-windows-notfile-all-result.txt | 1 - ...IME_DEPENDENCIES-windows-notfile-all-stderr.txt | 5 - ...-GET_RUNTIME_DEPENDENCIES-windows-notfile.cmake | 28 --- ..._DEPENDENCIES-windows-unresolved-all-result.txt | 1 - ..._DEPENDENCIES-windows-unresolved-all-stderr.txt | 2 - ...T_RUNTIME_DEPENDENCIES-windows-unresolved.cmake | 18 -- .../file-GET_RUNTIME_DEPENDENCIES-windows.cmake | 114 ----------- .../file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c | 7 - .../file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c | 6 - .../linux-all-check.cmake | 44 +++++ .../linux-all-stderr.txt | 119 ++++++++++++ .../linux-conflict-all-result.txt | 1 + .../linux-conflict-all-stderr.txt | 7 + .../linux-conflict.cmake | 54 ++++++ .../linux-notfile-all-result.txt | 1 + .../linux-notfile-all-stderr.txt | 5 + .../linux-notfile.cmake | 30 +++ .../linux-unresolved-all-result.txt | 1 + .../linux-unresolved-all-stderr.txt | 2 + .../linux-unresolved.cmake | 18 ++ .../file-GET_RUNTIME_DEPENDENCIES/linux.cmake | 169 ++++++++++++++++ .../file-GET_RUNTIME_DEPENDENCIES/linux/topexe.c | 9 + .../file-GET_RUNTIME_DEPENDENCIES/linux/toplib.c | 8 + .../macos-all-check.cmake | 157 +++++++++++++++ .../macos-conflict-all-result.txt | 1 + .../macos-conflict-all-stderr.txt | 7 + .../macos-conflict.cmake | 55 ++++++ .../macos-notfile-all-result.txt | 1 + .../macos-notfile-all-stderr.txt | 5 + .../macos-notfile.cmake | 30 +++ .../macos-unresolved-all-result.txt | 1 + .../macos-unresolved-all-stderr.txt | 2 + .../macos-unresolved.cmake | 18 ++ .../file-GET_RUNTIME_DEPENDENCIES/macos.cmake | 216 +++++++++++++++++++++ .../file-GET_RUNTIME_DEPENDENCIES/macos/topexe.c | 7 + .../file-GET_RUNTIME_DEPENDENCIES/macos/toplib.c | 6 + .../project-stderr.txt | 13 ++ .../file-GET_RUNTIME_DEPENDENCIES/project.cmake | 1 + .../unsupported-result.txt | 1 + .../unsupported-stderr.txt | 5 + .../unsupported.cmake | 2 + .../variable-propagation-all-result.txt | 1 + .../variable-propagation-all-stderr.txt | 6 + .../variable-propagation-dev-result.txt | 1 + .../variable-propagation-dev-stderr.txt | 6 + .../variable-propagation.cmake | 17 ++ .../windows-all-check.cmake | 38 ++++ .../windows-conflict-all-result.txt | 1 + .../windows-conflict-all-stderr.txt | 7 + .../windows-conflict.cmake | 47 +++++ .../windows-notfile-all-result.txt | 1 + .../windows-notfile-all-stderr.txt | 5 + .../windows-notfile.cmake | 28 +++ .../windows-unresolved-all-result.txt | 1 + .../windows-unresolved-all-stderr.txt | 2 + .../windows-unresolved.cmake | 18 ++ .../file-GET_RUNTIME_DEPENDENCIES/windows.cmake | 114 +++++++++++ .../file-GET_RUNTIME_DEPENDENCIES/windows/topexe.c | 7 + .../file-GET_RUNTIME_DEPENDENCIES/windows/toplib.c | 6 + 113 files changed, 1385 insertions(+), 1385 deletions(-) create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs1-result.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs1-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs1.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs2-result.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs2-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs2.cmake delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs1-result.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs1-stderr.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs1.cmake delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs2-result.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-all-check.cmake delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-all-stderr.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-result.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-stderr.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-conflict.cmake delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-result.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-stderr.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-result.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-stderr.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved.cmake delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux.cmake delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-all-check.cmake delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-result.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-stderr.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-conflict.cmake delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-result.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-stderr.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-notfile.cmake delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-result.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-stderr.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved.cmake delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos.cmake delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-project-stderr.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-project.cmake delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-unsupported-result.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-unsupported-stderr.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-unsupported.cmake delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-all-result.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-all-stderr.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-dev-result.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-dev-stderr.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation.cmake delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-all-check.cmake delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-result.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-stderr.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-conflict.cmake delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-result.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-stderr.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-notfile.cmake delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-result.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-stderr.txt delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved.cmake delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows.cmake delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c delete mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-check.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-conflict-all-result.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-conflict-all-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-conflict.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile-all-result.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile-all-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-unresolved-all-result.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-unresolved-all-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-unresolved.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux/topexe.c create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux/toplib.c create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-all-check.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-conflict-all-result.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-conflict-all-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-conflict.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-notfile-all-result.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-notfile-all-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-notfile.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-unresolved-all-result.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-unresolved-all-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-unresolved.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos/topexe.c create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos/toplib.c create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/project-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/project.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/unsupported-result.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/unsupported-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/unsupported.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-all-result.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-all-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-dev-result.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-dev-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-all-check.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict-all-result.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict-all-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-notfile-all-result.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-notfile-all-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-notfile.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved-all-result.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved-all-stderr.txt create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows.cmake create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows/topexe.c create mode 100644 Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows/toplib.c diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/RunCMakeTest.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/RunCMakeTest.cmake index da5069c..763d57c 100644 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/RunCMakeTest.cmake +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/RunCMakeTest.cmake @@ -16,22 +16,22 @@ endfunction() if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") if(NOT CMake_INSTALL_NAME_TOOL_BUG) - run_install_test(file-GET_RUNTIME_DEPENDENCIES-macos) - run_install_test(file-GET_RUNTIME_DEPENDENCIES-macos-unresolved) - run_install_test(file-GET_RUNTIME_DEPENDENCIES-macos-conflict) - run_install_test(file-GET_RUNTIME_DEPENDENCIES-macos-notfile) + run_install_test(macos) + run_install_test(macos-unresolved) + run_install_test(macos-conflict) + run_install_test(macos-notfile) endif() - run_cmake(file-GET_RUNTIME_DEPENDENCIES-project) - run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs1) - run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs2) + run_cmake(project) + run_cmake(badargs1) + run_cmake(badargs2) elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") - run_install_test(file-GET_RUNTIME_DEPENDENCIES-windows) - run_install_test(file-GET_RUNTIME_DEPENDENCIES-windows-unresolved) - run_install_test(file-GET_RUNTIME_DEPENDENCIES-windows-conflict) - run_install_test(file-GET_RUNTIME_DEPENDENCIES-windows-notfile) - run_cmake(file-GET_RUNTIME_DEPENDENCIES-project) - run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs1) - run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs2) + run_install_test(windows) + run_install_test(windows-unresolved) + run_install_test(windows-conflict) + run_install_test(windows-notfile) + run_cmake(project) + run_cmake(badargs1) + run_cmake(badargs2) elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") if(DEFINED ENV{LDFLAGS}) # Some setups prebake disable-new-dtags into LDFLAGS @@ -40,16 +40,16 @@ elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") endif() if(NOT CMAKE_C_COMPILER_ID MATCHES "^XL") - run_install_test(file-GET_RUNTIME_DEPENDENCIES-linux) + run_install_test(linux) endif() - run_install_test(file-GET_RUNTIME_DEPENDENCIES-linux-unresolved) - run_install_test(file-GET_RUNTIME_DEPENDENCIES-linux-conflict) - run_install_test(file-GET_RUNTIME_DEPENDENCIES-linux-notfile) - run_cmake(file-GET_RUNTIME_DEPENDENCIES-project) - run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs1) - run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs2) + run_install_test(linux-unresolved) + run_install_test(linux-conflict) + run_install_test(linux-notfile) + run_cmake(project) + run_cmake(badargs1) + run_cmake(badargs2) else() - run_cmake(file-GET_RUNTIME_DEPENDENCIES-unsupported) + run_cmake(unsupported) endif() -run_install_test(file-GET_RUNTIME_DEPENDENCIES-variable-propagation) +run_install_test(variable-propagation) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs1-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs1-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs1-stderr.txt new file mode 100644 index 0000000..0874473 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs1-stderr.txt @@ -0,0 +1,18 @@ +^CMake Warning \(dev\) at badargs1\.cmake:[0-9]+ \(file\): + You have used file\(GET_RUNTIME_DEPENDENCIES\) in project mode\. This is + probably not what you intended to do\. Instead, please consider using it in + an install\(CODE\) or install\(SCRIPT\) command\. For example: + + install\(CODE \[\[ + file\(GET_RUNTIME_DEPENDENCIES + # \.\.\. + \) + ]]\) +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) +This warning is for project developers\. Use -Wno-dev to suppress it\. + +CMake Error at badargs1\.cmake:[0-9]+ \(file\): + file Unrecognized argument: "invalid" +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs1.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs1.cmake new file mode 100644 index 0000000..f3b8ce4 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs1.cmake @@ -0,0 +1,2 @@ +file(GET_RUNTIME_DEPENDENCIES invalid) +message(FATAL_ERROR "This message should not be displayed") diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs2-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs2-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs2-stderr.txt new file mode 100644 index 0000000..c6ad3d0 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs2-stderr.txt @@ -0,0 +1,23 @@ +^CMake Warning \(dev\) at badargs2\.cmake:[0-9]+ \(file\): + You have used file\(GET_RUNTIME_DEPENDENCIES\) in project mode\. This is + probably not what you intended to do\. Instead, please consider using it in + an install\(CODE\) or install\(SCRIPT\) command\. For example: + + install\(CODE \[\[ + file\(GET_RUNTIME_DEPENDENCIES + # \.\.\. + \) + ]]\) +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) +This warning is for project developers\. Use -Wno-dev to suppress it\. + +CMake Error at badargs2\.cmake:[0-9]+ \(file\): + file Keywords missing values: + + RESOLVED_DEPENDENCIES_VAR + UNRESOLVED_DEPENDENCIES_VAR + CONFLICTING_DEPENDENCIES_PREFIX + BUNDLE_EXECUTABLE +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs2.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs2.cmake new file mode 100644 index 0000000..ac6af85 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs2.cmake @@ -0,0 +1,15 @@ +file(GET_RUNTIME_DEPENDENCIES + RESOLVED_DEPENDENCIES_VAR + UNRESOLVED_DEPENDENCIES_VAR + CONFLICTING_DEPENDENCIES_PREFIX + BUNDLE_EXECUTABLE + EXECUTABLES + LIBRARIES + MODULES + DIRECTORIES + PRE_INCLUDE_REGEXES + PRE_EXCLUDE_REGEXES + POST_INCLUDE_REGEXES + POST_EXCLUDE_REGEXES + ) +message(FATAL_ERROR "This message should not be displayed") diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs1-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs1-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs1-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs1-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs1-stderr.txt deleted file mode 100644 index b66d1fe..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs1-stderr.txt +++ /dev/null @@ -1,18 +0,0 @@ -^CMake Warning \(dev\) at file-GET_RUNTIME_DEPENDENCIES-badargs1\.cmake:[0-9]+ \(file\): - You have used file\(GET_RUNTIME_DEPENDENCIES\) in project mode\. This is - probably not what you intended to do\. Instead, please consider using it in - an install\(CODE\) or install\(SCRIPT\) command\. For example: - - install\(CODE \[\[ - file\(GET_RUNTIME_DEPENDENCIES - # \.\.\. - \) - ]]\) -Call Stack \(most recent call first\): - CMakeLists\.txt:[0-9]+ \(include\) -This warning is for project developers\. Use -Wno-dev to suppress it\. - -CMake Error at file-GET_RUNTIME_DEPENDENCIES-badargs1\.cmake:[0-9]+ \(file\): - file Unrecognized argument: "invalid" -Call Stack \(most recent call first\): - CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs1.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs1.cmake deleted file mode 100644 index f3b8ce4..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs1.cmake +++ /dev/null @@ -1,2 +0,0 @@ -file(GET_RUNTIME_DEPENDENCIES invalid) -message(FATAL_ERROR "This message should not be displayed") diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs2-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs2-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs2-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt deleted file mode 100644 index 50fa81f..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt +++ /dev/null @@ -1,23 +0,0 @@ -^CMake Warning \(dev\) at file-GET_RUNTIME_DEPENDENCIES-badargs2\.cmake:[0-9]+ \(file\): - You have used file\(GET_RUNTIME_DEPENDENCIES\) in project mode\. This is - probably not what you intended to do\. Instead, please consider using it in - an install\(CODE\) or install\(SCRIPT\) command\. For example: - - install\(CODE \[\[ - file\(GET_RUNTIME_DEPENDENCIES - # \.\.\. - \) - ]]\) -Call Stack \(most recent call first\): - CMakeLists\.txt:[0-9]+ \(include\) -This warning is for project developers\. Use -Wno-dev to suppress it\. - -CMake Error at file-GET_RUNTIME_DEPENDENCIES-badargs2\.cmake:[0-9]+ \(file\): - file Keywords missing values: - - RESOLVED_DEPENDENCIES_VAR - UNRESOLVED_DEPENDENCIES_VAR - CONFLICTING_DEPENDENCIES_PREFIX - BUNDLE_EXECUTABLE -Call Stack \(most recent call first\): - CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake deleted file mode 100644 index ac6af85..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake +++ /dev/null @@ -1,15 +0,0 @@ -file(GET_RUNTIME_DEPENDENCIES - RESOLVED_DEPENDENCIES_VAR - UNRESOLVED_DEPENDENCIES_VAR - CONFLICTING_DEPENDENCIES_PREFIX - BUNDLE_EXECUTABLE - EXECUTABLES - LIBRARIES - MODULES - DIRECTORIES - PRE_INCLUDE_REGEXES - PRE_EXCLUDE_REGEXES - POST_INCLUDE_REGEXES - POST_EXCLUDE_REGEXES - ) -message(FATAL_ERROR "This message should not be displayed") diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-all-check.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-all-check.cmake deleted file mode 100644 index ab482f2..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-all-check.cmake +++ /dev/null @@ -1,44 +0,0 @@ -function(check_contents filename contents_regex) - if(EXISTS "${CMAKE_INSTALL_PREFIX}/${filename}") - file(READ "${CMAKE_INSTALL_PREFIX}/${filename}" contents) - if(NOT contents MATCHES "${contents_regex}") - string(APPEND RunCMake_TEST_FAILED "File contents: - ${contents} -do not match what we expected: - ${contents_regex} -in file: - ${CMAKE_INSTALL_PREFIX}/${filename}\n") - set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) - endif() - else() - string(APPEND RunCMake_TEST_FAILED "File ${CMAKE_INSTALL_PREFIX}/${filename} does not exist") - set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) - endif() -endfunction() - -set(_check - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/libtest_rpath\.so]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/libtest_runpath\.so]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath/librpath\.so]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_parent/librpath_parent\.so]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search/librpath_search\.so]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath/librunpath\.so]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search/librunpath_search\.so]] - ) -check_contents(deps/deps1.txt "^${_check}$") -check_contents(deps/deps2.txt "^${_check}$") -check_contents(deps/deps3.txt "^${_check}$") -set(_check - [[librpath_unresolved\.so]] - [[librunpath_parent_unresolved\.so]] - [[librunpath_unresolved\.so]] - ) -check_contents(deps/udeps1.txt "^${_check}$") -check_contents(deps/udeps2.txt "^${_check}$") -check_contents(deps/udeps3.txt "^${_check}$") -set(_check - "^libconflict\\.so:[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/conflict/libconflict\\.so;[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/conflict2/libconflict\\.so\n$" - ) -check_contents(deps/cdeps1.txt "${_check}") -check_contents(deps/cdeps2.txt "${_check}") -check_contents(deps/cdeps3.txt "${_check}") diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-all-stderr.txt deleted file mode 100644 index 7ba3033..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-all-stderr.txt +++ /dev/null @@ -1,119 +0,0 @@ -^CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): - Dependency librpath_search_postexcluded\.so found in search directory: - - [^ -]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search_postexcluded - - See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. -Call Stack \(most recent call first\): - cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) - -*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): - Dependency librpath_search\.so found in search directory: - - [^ -]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search - - See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. -Call Stack \(most recent call first\): - cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) - -*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): - Dependency librunpath_search_postexcluded\.so found in search directory: - - [^ -]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search_postexcluded - - See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. -Call Stack \(most recent call first\): - cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) - -*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): - Dependency librunpath_search\.so found in search directory: - - [^ -]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search - - See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. -Call Stack \(most recent call first\): - cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) - -*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): - Dependency librpath_search_postexcluded\.so found in search directory: - - [^ -]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search_postexcluded - - See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. -Call Stack \(most recent call first\): - cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) - -*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): - Dependency librpath_search\.so found in search directory: - - [^ -]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search - - See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. -Call Stack \(most recent call first\): - cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) - -*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): - Dependency librunpath_search_postexcluded\.so found in search directory: - - [^ -]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search_postexcluded - - See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. -Call Stack \(most recent call first\): - cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) - -*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): - Dependency librunpath_search\.so found in search directory: - - [^ -]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search - - See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. -Call Stack \(most recent call first\): - cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) - -*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): - Dependency librpath_search_postexcluded\.so found in search directory: - - [^ -]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search_postexcluded - - See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. -Call Stack \(most recent call first\): - cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) - -*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): - Dependency librpath_search\.so found in search directory: - - [^ -]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search - - See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. -Call Stack \(most recent call first\): - cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) - -*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): - Dependency librunpath_search_postexcluded\.so found in search directory: - - [^ -]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search_postexcluded - - See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. -Call Stack \(most recent call first\): - cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) - -*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): - Dependency librunpath_search\.so found in search directory: - - [^ -]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search - - See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. -Call Stack \(most recent call first\): - cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-stderr.txt deleted file mode 100644 index 37f283a..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-stderr.txt +++ /dev/null @@ -1,7 +0,0 @@ -^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): - file Multiple conflicting paths found for librpath\.so: - - [^ -]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-build/root-all/lib/rpath1/librpath\.so - [^ -]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-build/root-all/lib/rpath2/librpath\.so$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-conflict.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-conflict.cmake deleted file mode 100644 index f719499..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-conflict.cmake +++ /dev/null @@ -1,54 +0,0 @@ -enable_language(C) - -set(test1_names rpath) -set(test2_names rpath) - -file(WRITE "${CMAKE_BINARY_DIR}/rpath.c" "void rpath(void) {}\n") -add_library(rpath SHARED "${CMAKE_BINARY_DIR}/rpath.c") -install(TARGETS rpath DESTINATION lib/rpath1) -install(TARGETS rpath DESTINATION lib/rpath2) - -file(REMOVE "${CMAKE_BINARY_DIR}/test1.c") -add_library(test1 SHARED "${CMAKE_BINARY_DIR}/test1.c") -foreach(name ${test1_names}) - file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "extern void ${name}(void);\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "void test1(void)\n{\n") -foreach(name ${test1_names}) - file(APPEND "${CMAKE_BINARY_DIR}/test1.c" " ${name}();\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "}\n") - -target_link_libraries(test1 PRIVATE ${test1_names}) -set_property(TARGET test1 PROPERTY INSTALL_RPATH - "${CMAKE_BINARY_DIR}/root-all/lib/rpath1" - ) - -file(REMOVE "${CMAKE_BINARY_DIR}/test2.c") -add_library(test2 SHARED "${CMAKE_BINARY_DIR}/test2.c") -foreach(name ${test2_names}) - file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "extern void ${name}(void);\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "void test2(void)\n{\n") -foreach(name ${test2_names}) - file(APPEND "${CMAKE_BINARY_DIR}/test2.c" " ${name}();\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "}\n") - -target_link_libraries(test2 PRIVATE ${test2_names}) -set_property(TARGET test2 PROPERTY INSTALL_RPATH - "${CMAKE_BINARY_DIR}/root-all/lib/rpath2" - ) - -install(TARGETS test1 test2 DESTINATION lib) - -install(CODE [[ - file(GET_RUNTIME_DEPENDENCIES - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/lib/$" - "${CMAKE_INSTALL_PREFIX}/lib/$" - PRE_INCLUDE_REGEXES "^librpath\\.so$" - PRE_EXCLUDE_REGEXES ".*" - ) - message(FATAL_ERROR "This message should not be displayed") - ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-stderr.txt deleted file mode 100644 index 4e56787..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): - file Failed to run objdump on: - - [^ -]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-build/root-all/bin/\.\./lib/libtest\.so$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake deleted file mode 100644 index 6567438..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake +++ /dev/null @@ -1,30 +0,0 @@ -enable_language(C) -cmake_policy(SET CMP0095 NEW) - -file(WRITE "${CMAKE_BINARY_DIR}/test.c" "void test(void) {}\n") -file(WRITE "${CMAKE_BINARY_DIR}/main.c" [[extern void test(void); - -int main(void) -{ - test(); - return 0; -} -]]) - -add_library(test SHARED "${CMAKE_BINARY_DIR}/test.c") -add_executable(exe "${CMAKE_BINARY_DIR}/main.c") -target_link_libraries(exe PRIVATE test) -set_property(TARGET exe PROPERTY INSTALL_RPATH "\${ORIGIN}/../lib") - -install(TARGETS exe DESTINATION bin) - -install(CODE [[ - file(MAKE_DIRECTORY "${CMAKE_INSTALL_PREFIX}/lib/$") - file(GET_RUNTIME_DEPENDENCIES - EXECUTABLES - "${CMAKE_INSTALL_PREFIX}/bin/$" - PRE_INCLUDE_REGEXES "^libtest\\.so$" - PRE_EXCLUDE_REGEXES ".*" - ) - message(FATAL_ERROR "This message should not be displayed") - ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-stderr.txt deleted file mode 100644 index eaca512..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-stderr.txt +++ /dev/null @@ -1,2 +0,0 @@ -^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): - file Could not resolve file libunresolved\.so$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved.cmake deleted file mode 100644 index 3efa305..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved.cmake +++ /dev/null @@ -1,18 +0,0 @@ -enable_language(C) - -file(WRITE "${CMAKE_BINARY_DIR}/testlib.c" "extern void unresolved(void);\nvoid testlib(void)\n{\n unresolved();\n}\n") -add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c") -file(WRITE "${CMAKE_BINARY_DIR}/unresolved.c" "void unresolved(void) {}\n") -add_library(unresolved SHARED "${CMAKE_BINARY_DIR}/unresolved.c") -target_link_libraries(testlib PRIVATE unresolved) -install(TARGETS testlib DESTINATION lib) - -install(CODE [[ - file(GET_RUNTIME_DEPENDENCIES - PRE_INCLUDE_REGEXES "^libunresolved\\.so$" - PRE_EXCLUDE_REGEXES ".*" - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/lib/$" - ) - message(FATAL_ERROR "This message should not be displayed") - ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux.cmake deleted file mode 100644 index bd0f9f1..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux.cmake +++ /dev/null @@ -1,169 +0,0 @@ -enable_language(C) -cmake_policy(SET CMP0095 NEW) - -set(test_rpath_names - preexcluded - rpath_postexcluded - rpath - rpath_parent_postexcluded - rpath_parent - rpath_origin_postexcluded - rpath_origin - rpath_search_postexcluded - rpath_search - rpath_unresolved - conflict - ) -set(test_runpath_names - runpath_postexcluded - runpath - runpath_origin_postexcluded - runpath_origin - runpath_parent_unresolved - runpath_search_postexcluded - runpath_search - runpath_unresolved - ) - -file(REMOVE "${CMAKE_BINARY_DIR}/test_rpath.c") -add_library(test_rpath SHARED "${CMAKE_BINARY_DIR}/test_rpath.c") -foreach(name ${test_rpath_names}) - file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "void ${name}(void) {}\n") - add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c") - - file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" "extern void ${name}(void);\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" "void test_rpath(void)\n{\n") -foreach(name ${test_rpath_names}) - file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" " ${name}();\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" "}\n") - -install(TARGETS rpath_postexcluded DESTINATION lib/rpath_postexcluded) -install(TARGETS rpath DESTINATION lib/rpath) -install(TARGETS rpath_origin_postexcluded DESTINATION lib/rpath_origin_postexcluded) -install(TARGETS rpath_origin DESTINATION lib/rpath_origin) -install(TARGETS rpath_parent_postexcluded DESTINATION lib/rpath_parent_postexcluded) -install(TARGETS rpath rpath_origin rpath_parent DESTINATION lib/rpath_parent) -install(TARGETS rpath_search_postexcluded DESTINATION lib/rpath_search_postexcluded) -install(TARGETS rpath rpath_origin rpath_parent rpath_search DESTINATION lib/rpath_search) -install(TARGETS conflict DESTINATION lib/conflict) - -target_link_libraries(test_rpath PRIVATE ${test_rpath_names}) -set_property(TARGET test_rpath PROPERTY INSTALL_RPATH - "${CMAKE_BINARY_DIR}/root-all/lib/rpath_postexcluded" - "${CMAKE_BINARY_DIR}/root-all/lib/rpath" - "\$ORIGIN/rpath_origin_postexcluded" - "\${ORIGIN}/rpath_origin" - "${CMAKE_BINARY_DIR}/root-all/lib/conflict" - ) -target_link_options(test_rpath PRIVATE -Wl,--disable-new-dtags) - -file(REMOVE "${CMAKE_BINARY_DIR}/test_runpath.c") -add_library(test_runpath SHARED "${CMAKE_BINARY_DIR}/test_runpath.c") -foreach(name ${test_runpath_names} rpath conflict) - file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "void ${name}(void) {}\n") - if(NOT name MATCHES "^(rpath|conflict)$") - add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c") - endif() - - file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" "extern void ${name}(void);\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" "void test_runpath(void)\n{\n") -foreach(name ${test_runpath_names} rpath conflict) - file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" " ${name}();\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" "}\n") - -install(TARGETS runpath_postexcluded DESTINATION lib/runpath_postexcluded) -install(TARGETS runpath DESTINATION lib/runpath) -install(TARGETS runpath_origin_postexcluded DESTINATION lib/runpath_origin_postexcluded) -install(TARGETS runpath_origin DESTINATION lib/runpath_origin) -install(TARGETS runpath_parent_unresolved DESTINATION lib/runpath_parent_unresolved) -install(TARGETS runpath_search_postexcluded DESTINATION lib/runpath_search_postexcluded) -install(TARGETS runpath runpath_origin runpath_search DESTINATION lib/runpath_search) -install(TARGETS conflict DESTINATION lib/conflict2) - -target_link_libraries(test_runpath PRIVATE ${test_runpath_names} rpath conflict) -set_property(TARGET test_runpath PROPERTY INSTALL_RPATH - "${CMAKE_BINARY_DIR}/root-all/lib/runpath/../rpath" # Ensure that files that don't conflict are treated correctly - "${CMAKE_BINARY_DIR}/root-all/lib/runpath_postexcluded" - "${CMAKE_BINARY_DIR}/root-all/lib/runpath" - "\${ORIGIN}/runpath_origin_postexcluded" - "\$ORIGIN/runpath_origin" - "${CMAKE_BINARY_DIR}/root-all/lib/conflict2" - ) -target_link_options(test_runpath PRIVATE -Wl,--enable-new-dtags) - -set_property(TARGET test_rpath ${test_rpath_names} test_runpath ${test_runpath_names} PROPERTY LIBRARY_OUTPUT_DIRECTORY lib) -install(TARGETS test_rpath test_runpath DESTINATION lib) - -add_executable(topexe file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c) -add_library(toplib SHARED file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c) -add_library(topmod MODULE file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c) -target_link_libraries(topexe PRIVATE test_rpath test_runpath) -target_link_libraries(toplib PRIVATE test_rpath test_runpath) -target_link_libraries(topmod PRIVATE test_rpath test_runpath) -set_property(TARGET topexe toplib topmod PROPERTY INSTALL_RPATH - "${CMAKE_BINARY_DIR}/root-all/lib" - "${CMAKE_BINARY_DIR}/root-all/lib/rpath_parent_postexcluded" - "${CMAKE_BINARY_DIR}/root-all/lib/rpath_parent" - "${CMAKE_BINARY_DIR}/root-all/lib/runpath_parent_unresolved" - ) -target_link_options(topexe PRIVATE -Wl,--disable-new-dtags) -target_link_options(toplib PRIVATE -Wl,--disable-new-dtags) -target_link_options(topmod PRIVATE -Wl,--disable-new-dtags) - -install(TARGETS topexe toplib RUNTIME DESTINATION bin LIBRARY DESTINATION lib) -install(TARGETS topmod LIBRARY DESTINATION lib/modules) - -install(CODE [[ - function(exec_get_runtime_dependencies depsfile udepsfile cdepsfile) - file(GET_RUNTIME_DEPENDENCIES - RESOLVED_DEPENDENCIES_VAR deps - UNRESOLVED_DEPENDENCIES_VAR udeps - CONFLICTING_DEPENDENCIES_PREFIX cdeps - PRE_INCLUDE_REGEXES - "^lib(test_rpath|rpath_postexcluded|rpath|rpath_parent_postexcluded|rpath_parent|rpath_origin_postexcluded|rpath_origin|rpath_search_postexcluded|rpath_search|rpath_unresolved|test_runpath|runpath_postexcluded|runpath|runpath_origin_postexcluded|runpath_origin|runpath_parent_unresolved|runpath_search_postexcluded|runpath_search|runpath_unresolved|conflict)\\.so$" - "^libc\\.so" - PRE_EXCLUDE_REGEXES ".*" - POST_INCLUDE_REGEXES "^.*/(libtest_rpath|rpath/librpath|rpath_parent/librpath_parent|rpath_search/librpath_search|libtest_runpath|runpath/librunpath|runpath_origin_postexcluded|runpath_origin|runpath_search/librunpath_search|conflict2?/libconflict)\\.so$" - POST_EXCLUDE_REGEXES ".*" - DIRECTORIES - "${CMAKE_INSTALL_PREFIX}/lib/rpath_search_postexcluded" - "${CMAKE_INSTALL_PREFIX}/lib/rpath_search" - "${CMAKE_INSTALL_PREFIX}/lib/runpath_search_postexcluded" - "${CMAKE_INSTALL_PREFIX}/lib/runpath_search" - ${ARGN} - ) - list(SORT deps) - list(SORT udeps) - list(SORT cdeps_FILENAMES) - file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${depsfile}" "${deps}") - file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${udepsfile}" "${udeps}") - file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "") - foreach(cdep IN LISTS cdeps_FILENAMES) - set(cdep_values ${cdeps_${cdep}}) - list(SORT cdep_values) - file(APPEND "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "${cdep}:${cdep_values}\n") - endforeach() - endfunction() - - exec_get_runtime_dependencies( - deps1.txt udeps1.txt cdeps1.txt - EXECUTABLES - "${CMAKE_INSTALL_PREFIX}/bin/$" - ) - - exec_get_runtime_dependencies( - deps2.txt udeps2.txt cdeps2.txt - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/lib/$" - ) - - exec_get_runtime_dependencies( - deps3.txt udeps3.txt cdeps3.txt - MODULES - "${CMAKE_INSTALL_PREFIX}/lib/modules/$" - ) - ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c deleted file mode 100644 index d196afe..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c +++ /dev/null @@ -1,9 +0,0 @@ -extern void test_rpath(void); -extern void test_runpath(void); - -int main(void) -{ - test_rpath(); - test_runpath(); - return 0; -} diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c deleted file mode 100644 index 040e591..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c +++ /dev/null @@ -1,8 +0,0 @@ -extern void test_rpath(void); -extern void test_runpath(void); - -void toplib(void) -{ - test_rpath(); - test_runpath(); -} diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-all-check.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-all-check.cmake deleted file mode 100644 index d2f79ed..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-all-check.cmake +++ /dev/null @@ -1,157 +0,0 @@ -function(check_contents filename contents_regex) - if(EXISTS "${CMAKE_INSTALL_PREFIX}/${filename}") - file(READ "${CMAKE_INSTALL_PREFIX}/${filename}" contents) - if(NOT contents MATCHES "${contents_regex}") - string(APPEND RunCMake_TEST_FAILED "File contents: - ${contents} -do not match what we expected: - ${contents_regex} -in file: - ${CMAKE_INSTALL_PREFIX}/${filename}\n") - set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) - endif() - else() - string(APPEND RunCMake_TEST_FAILED "File ${CMAKE_INSTALL_PREFIX}/${filename} does not exist") - set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) - endif() -endfunction() - -set(_check - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/bin/../lib/executable_path/libexecutable_path\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/bin/../lib/rpath_executable_path/librpath_executable_path\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] - [[/usr/lib/libSystem\.B\.dylib]] - ) -check_contents(deps/deps1.txt "^${_check}$") - -set(_check - [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] - [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] - [[@rpath/librpath_executable_path_bundle\.dylib]] - [[@rpath/librpath_loader_path_unresolved\.dylib]] - [[@rpath/librpath_unresolved\.dylib]] - ) -check_contents(deps/udeps1.txt "^${_check}$") - -set(_check - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] - [[/usr/lib/libSystem\.B\.dylib]] - ) -check_contents(deps/deps2.txt "^${_check}$") - -set(_check - [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]] - [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] - [[@executable_path/../lib/executable_path_postexcluded/libexecutable_path_postexcluded\.dylib]] - [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] - [[@rpath/librpath_executable_path\.dylib]] - [[@rpath/librpath_executable_path_bundle\.dylib]] - [[@rpath/librpath_executable_path_postexcluded\.dylib]] - [[@rpath/librpath_loader_path_unresolved\.dylib]] - [[@rpath/librpath_unresolved\.dylib]] - ) -check_contents(deps/udeps2.txt "^${_check}$") - -set(_check - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] - [[/usr/lib/libSystem\.B\.dylib]] - ) -check_contents(deps/deps3.txt "^${_check}$") - -set(_check - [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]] - [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] - [[@executable_path/../lib/executable_path_postexcluded/libexecutable_path_postexcluded\.dylib]] - [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] - [[@rpath/librpath_executable_path\.dylib]] - [[@rpath/librpath_executable_path_bundle\.dylib]] - [[@rpath/librpath_executable_path_postexcluded\.dylib]] - [[@rpath/librpath_loader_path_unresolved\.dylib]] - [[@rpath/librpath_unresolved\.dylib]] - ) -check_contents(deps/udeps3.txt "^${_check}$") - -set(_check - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/bin/../lib/executable_path/libexecutable_path\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/bin/../lib/rpath_executable_path/librpath_executable_path\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] - [[/usr/lib/libSystem\.B\.dylib]] - ) -check_contents(deps/deps4.txt "^${_check}$") - -set(_check - [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] - [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] - [[@rpath/librpath_executable_path_bundle\.dylib]] - [[@rpath/librpath_loader_path_unresolved\.dylib]] - [[@rpath/librpath_unresolved\.dylib]] - ) -check_contents(deps/udeps4.txt "^${_check}$") - -set(_check - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/bundle_executable/bin/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] - [[/usr/lib/libSystem\.B\.dylib]] - ) -check_contents(deps/deps5.txt "^${_check}$") - -set(_check - [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]] - [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] - [[@rpath/librpath_executable_path\.dylib]] - [[@rpath/librpath_executable_path_bundle\.dylib]] - [[@rpath/librpath_loader_path_unresolved\.dylib]] - [[@rpath/librpath_unresolved\.dylib]] - ) -check_contents(deps/udeps5.txt "^${_check}$") - -set(_check - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/bundle_executable/bin/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]] - [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] - [[/usr/lib/libSystem\.B\.dylib]] - ) -check_contents(deps/deps6.txt "^${_check}$") - -set(_check - [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]] - [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] - [[@rpath/librpath_executable_path\.dylib]] - [[@rpath/librpath_executable_path_bundle\.dylib]] - [[@rpath/librpath_loader_path_unresolved\.dylib]] - [[@rpath/librpath_unresolved\.dylib]] - ) -check_contents(deps/udeps6.txt "^${_check}$") - -set(_check - "^libconflict\\.dylib:[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/conflict/libconflict\\.dylib;[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/conflict2/libconflict\\.dylib\n$" - ) -check_contents(deps/cdeps1.txt "${_check}") -check_contents(deps/cdeps2.txt "${_check}") -check_contents(deps/cdeps3.txt "${_check}") -check_contents(deps/cdeps4.txt "${_check}") -check_contents(deps/cdeps5.txt "${_check}") -check_contents(deps/cdeps6.txt "${_check}") diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-stderr.txt deleted file mode 100644 index 7f36f71..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-stderr.txt +++ /dev/null @@ -1,7 +0,0 @@ -^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): - file Multiple conflicting paths found for librpath\.dylib: - - [^ -]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-build/root-all/lib/rpath1/librpath\.dylib - [^ -]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-build/root-all/lib/rpath2/librpath\.dylib$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-conflict.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-conflict.cmake deleted file mode 100644 index a8446fe..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-conflict.cmake +++ /dev/null @@ -1,55 +0,0 @@ -enable_language(C) - -set(test1_names rpath) -set(test2_names rpath) - -file(WRITE "${CMAKE_BINARY_DIR}/rpath.c" "void rpath(void) {}\n") -add_library(rpath SHARED "${CMAKE_BINARY_DIR}/rpath.c") -set_property(TARGET rpath PROPERTY INSTALL_NAME_DIR @rpath) -install(TARGETS rpath DESTINATION lib/rpath1) -install(TARGETS rpath DESTINATION lib/rpath2) - -file(REMOVE "${CMAKE_BINARY_DIR}/test1.c") -add_library(test1 SHARED "${CMAKE_BINARY_DIR}/test1.c") -foreach(name ${test1_names}) - file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "extern void ${name}(void);\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "void test1(void)\n{\n") -foreach(name ${test1_names}) - file(APPEND "${CMAKE_BINARY_DIR}/test1.c" " ${name}();\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "}\n") - -target_link_libraries(test1 PRIVATE ${test1_names}) -set_property(TARGET test1 PROPERTY INSTALL_RPATH - "${CMAKE_BINARY_DIR}/root-all/lib/rpath1" - ) - -file(REMOVE "${CMAKE_BINARY_DIR}/test2.c") -add_library(test2 SHARED "${CMAKE_BINARY_DIR}/test2.c") -foreach(name ${test2_names}) - file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "extern void ${name}(void);\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "void test2(void)\n{\n") -foreach(name ${test2_names}) - file(APPEND "${CMAKE_BINARY_DIR}/test2.c" " ${name}();\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "}\n") - -target_link_libraries(test2 PRIVATE ${test2_names}) -set_property(TARGET test2 PROPERTY INSTALL_RPATH - "${CMAKE_BINARY_DIR}/root-all/lib/rpath2" - ) - -install(TARGETS test1 test2 DESTINATION lib) - -install(CODE [[ - file(GET_RUNTIME_DEPENDENCIES - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/lib/$" - "${CMAKE_INSTALL_PREFIX}/lib/$" - PRE_INCLUDE_REGEXES "^@rpath/librpath\\.dylib$" - PRE_EXCLUDE_REGEXES ".*" - ) - message(FATAL_ERROR "This message should not be displayed") - ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-stderr.txt deleted file mode 100644 index 1aac009..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): - file Failed to run otool on: - - [^ -]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-build/root-all/bin/\.\./lib/libtest\.dylib$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-notfile.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-notfile.cmake deleted file mode 100644 index 3e4c434..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-notfile.cmake +++ /dev/null @@ -1,30 +0,0 @@ -enable_language(C) - -file(WRITE "${CMAKE_BINARY_DIR}/test.c" "void test(void) {}\n") -file(WRITE "${CMAKE_BINARY_DIR}/main.c" [[extern void test(void); - -int main(void) -{ - test(); - return 0; -} -]]) - -add_library(test SHARED "${CMAKE_BINARY_DIR}/test.c") -set_property(TARGET test PROPERTY INSTALL_NAME_DIR @rpath) -add_executable(exe "${CMAKE_BINARY_DIR}/main.c") -target_link_libraries(exe PRIVATE test) -set_property(TARGET exe PROPERTY INSTALL_RPATH "@loader_path/../lib") - -install(TARGETS exe DESTINATION bin) - -install(CODE [[ - file(MAKE_DIRECTORY "${CMAKE_INSTALL_PREFIX}/lib/$") - file(GET_RUNTIME_DEPENDENCIES - EXECUTABLES - "${CMAKE_INSTALL_PREFIX}/bin/$" - PRE_INCLUDE_REGEXES "^@rpath/libtest\\.dylib$" - PRE_EXCLUDE_REGEXES ".*" - ) - message(FATAL_ERROR "This message should not be displayed") - ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-stderr.txt deleted file mode 100644 index 01762b4..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-stderr.txt +++ /dev/null @@ -1,2 +0,0 @@ -^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): - file Could not resolve file @rpath/libunresolved\.dylib$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved.cmake deleted file mode 100644 index c9b6c95..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved.cmake +++ /dev/null @@ -1,18 +0,0 @@ -enable_language(C) - -file(WRITE "${CMAKE_BINARY_DIR}/testlib.c" "extern void unresolved(void);\nvoid testlib(void)\n{\n unresolved();\n}\n") -add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c") -file(WRITE "${CMAKE_BINARY_DIR}/unresolved.c" "void unresolved(void) {}\n") -add_library(unresolved SHARED "${CMAKE_BINARY_DIR}/unresolved.c") -target_link_libraries(testlib PRIVATE unresolved) -install(TARGETS testlib DESTINATION lib) - -install(CODE [[ - file(GET_RUNTIME_DEPENDENCIES - PRE_INCLUDE_REGEXES "^@rpath/libunresolved\\.dylib$" - PRE_EXCLUDE_REGEXES ".*" - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/lib/$" - ) - message(FATAL_ERROR "This message should not be displayed") - ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos.cmake deleted file mode 100644 index 6db05b3..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos.cmake +++ /dev/null @@ -1,216 +0,0 @@ -enable_language(C) - -set(testlib_names - preexcluded - executable_path - executable_path_bundle - executable_path_postexcluded - loader_path - loader_path_unresolved - loader_path_postexcluded - rpath - rpath_unresolved - rpath_postexcluded - rpath_executable_path - rpath_executable_path_bundle - rpath_executable_path_postexcluded - rpath_loader_path - rpath_loader_path_unresolved - rpath_loader_path_postexcluded - normal - normal_unresolved - normal_postexcluded - conflict - ) - -file(REMOVE "${CMAKE_BINARY_DIR}/testlib.c") -add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c") -foreach(name ${testlib_names}) - if(name STREQUAL "normal") - file(WRITE "${CMAKE_BINARY_DIR}/normal.c" "extern void rpath(void);\nvoid normal(void)\n{\n rpath();\n}\n") - else() - file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "void ${name}(void) {}\n") - endif() - add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c") - - file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "extern void ${name}(void);\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "void testlib(void)\n{\n") -foreach(name ${testlib_names}) - file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" " ${name}();\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "}\n") -set_property(TARGET ${testlib_names} PROPERTY BUILD_WITH_INSTALL_NAME_DIR 1) -target_link_libraries(normal PRIVATE rpath) -set_property(TARGET normal PROPERTY INSTALL_RPATH - "${CMAKE_BINARY_DIR}/root-all/executable/lib/normal/../rpath" - ) - -file(WRITE "${CMAKE_BINARY_DIR}/testlib_conflict.c" "extern void conflict(void);\nvoid testlib_conflict(void)\n{\n conflict();\n}\n") -add_library(testlib_conflict SHARED "${CMAKE_BINARY_DIR}/testlib_conflict.c") -target_link_libraries(testlib_conflict PRIVATE conflict) - -set_property(TARGET testlib PROPERTY INSTALL_RPATH - "${CMAKE_BINARY_DIR}/root-all/executable/lib/rpath" - "${CMAKE_BINARY_DIR}/root-all/executable/lib/rpath_unresolved" - "${CMAKE_BINARY_DIR}/root-all/executable/lib/rpath_postexcluded" - "${CMAKE_BINARY_DIR}/root-all/executable/lib/conflict" - @executable_path/../lib/rpath_executable_path - @executable_path/../lib/rpath_executable_path_unresolved - @executable_path/../lib/rpath_executable_path_postexcluded - @loader_path/rpath_loader_path - @loader_path/rpath_loader_path_unresolved - @loader_path/rpath_loader_path_postexcluded - ) -set_property(TARGET testlib_conflict PROPERTY INSTALL_RPATH - "${CMAKE_BINARY_DIR}/root-all/executable/lib/conflict2" - ) - -foreach(t - executable_path - executable_path_postexcluded - loader_path - loader_path_postexcluded - rpath - rpath_postexcluded - rpath_executable_path - rpath_executable_path_postexcluded - rpath_loader_path - rpath_loader_path_postexcluded - conflict - ) - install(TARGETS ${t} DESTINATION executable/lib/${t}) -endforeach() -install(TARGETS conflict DESTINATION executable/lib/conflict2) - -foreach(t - executable_path_bundle - executable_path_postexcluded - loader_path_postexcluded - rpath_postexcluded - rpath_executable_path_bundle - rpath_executable_path_postexcluded - rpath_loader_path_postexcluded - ) - install(TARGETS ${t} DESTINATION bundle_executable/lib/${t}) -endforeach() - -foreach(t executable_path executable_path_bundle executable_path_postexcluded) - set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR @executable_path/../lib/${t}) -endforeach() - -foreach(t loader_path loader_path_unresolved loader_path_postexcluded) - set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR @loader_path/${t}) -endforeach() - -foreach(t - rpath - rpath_unresolved - rpath_postexcluded - rpath_executable_path - rpath_executable_path_bundle - rpath_executable_path_postexcluded - rpath_loader_path - rpath_loader_path_unresolved - rpath_loader_path_postexcluded - conflict - ) - set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR @rpath) -endforeach() - -foreach(t normal normal_unresolved normal_postexcluded) - set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR "${CMAKE_BINARY_DIR}/root-all/executable/lib/${t}") - if(NOT t STREQUAL "normal_unresolved") - install(TARGETS ${t} DESTINATION executable/lib/${t}) - endif() -endforeach() - -target_link_libraries(testlib PRIVATE ${testlib_names}) - -add_executable(topexe file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c) -add_library(toplib SHARED file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c) -add_library(topmod MODULE file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c) -target_link_libraries(topexe PRIVATE testlib) -target_link_libraries(toplib PRIVATE testlib) -target_link_libraries(topmod PRIVATE testlib) - -set_property(TARGET topexe toplib topmod PROPERTY INSTALL_RPATH "${CMAKE_BINARY_DIR}/root-all/executable/lib") - -install(TARGETS topexe toplib topmod testlib testlib_conflict RUNTIME DESTINATION executable/bin LIBRARY DESTINATION executable/lib) -install(TARGETS topexe toplib topmod testlib testlib_conflict RUNTIME DESTINATION bundle_executable/bin LIBRARY DESTINATION bundle_executable/lib) - -install(CODE [[ - function(exec_get_runtime_dependencies depsfile udepsfile cdepsfile) - file(GET_RUNTIME_DEPENDENCIES - RESOLVED_DEPENDENCIES_VAR deps - UNRESOLVED_DEPENDENCIES_VAR udeps - CONFLICTING_DEPENDENCIES_PREFIX cdeps - PRE_INCLUDE_REGEXES "^.*/lib(testlib|executable_path|executable_path_bundle|executable_path_postexcluded|loader_path|loader_path_unresolved|loader_path_postexcluded|rpath|rpath_unresolved|rpath_postexcluded|rpath_executable_path|rpath_executable_path_bundle|rpath_executable_path_postexcluded|rpath_loader_path|rpath_loader_path_unresolved|rpath_loader_path_postexcluded|normal|normal_unresolved|normal_postexcluded|conflict|System\\.B)\\.dylib$" - PRE_EXCLUDE_REGEXES ".*" - POST_INCLUDE_REGEXES "^.*/lib(testlib|executable_path|executable_path_bundle|loader_path|rpath|rpath_executable_path|rpath_executable_path_bundle|rpath_loader_path|normal|conflict|System\\.B)\\.dylib$" - POST_EXCLUDE_REGEXES ".*" - ${ARGN} - ) - list(SORT deps) - list(SORT udeps) - list(SORT cdeps_FILENAMES) - file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${depsfile}" "${deps}") - file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${udepsfile}" "${udeps}") - file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "") - foreach(cdep IN LISTS cdeps_FILENAMES) - set(cdep_values ${cdeps_${cdep}}) - list(SORT cdep_values) - file(APPEND "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "${cdep}:${cdep_values}\n") - endforeach() - endfunction() - - exec_get_runtime_dependencies( - deps1.txt udeps1.txt cdeps1.txt - EXECUTABLES - "${CMAKE_INSTALL_PREFIX}/executable/bin/$" - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/executable/lib/$" - ) - - exec_get_runtime_dependencies( - deps2.txt udeps2.txt cdeps2.txt - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/executable/lib/$" - "${CMAKE_INSTALL_PREFIX}/executable/lib/$" - ) - - exec_get_runtime_dependencies( - deps3.txt udeps3.txt cdeps3.txt - MODULES - "${CMAKE_INSTALL_PREFIX}/executable/lib/$" - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/executable/lib/$" - ) - - exec_get_runtime_dependencies( - deps4.txt udeps4.txt cdeps4.txt - EXECUTABLES - "${CMAKE_INSTALL_PREFIX}/executable/bin/$" - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/executable/lib/$" - BUNDLE_EXECUTABLE - "${CMAKE_INSTALL_PREFIX}/bundle_executable/bin/$" - ) - - exec_get_runtime_dependencies( - deps5.txt udeps5.txt cdeps5.txt - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/executable/lib/$" - "${CMAKE_INSTALL_PREFIX}/executable/lib/$" - BUNDLE_EXECUTABLE "${CMAKE_INSTALL_PREFIX}/bundle_executable/bin/$" - ) - - exec_get_runtime_dependencies( - deps6.txt udeps6.txt cdeps6.txt - MODULES - "${CMAKE_INSTALL_PREFIX}/executable/lib/$" - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/executable/lib/$" - BUNDLE_EXECUTABLE "${CMAKE_INSTALL_PREFIX}/bundle_executable/bin/$" - ) - ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c deleted file mode 100644 index 20c6087..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c +++ /dev/null @@ -1,7 +0,0 @@ -extern void testlib(void); - -int main(void) -{ - testlib(); - return 0; -} diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c deleted file mode 100644 index cff1bff..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c +++ /dev/null @@ -1,6 +0,0 @@ -extern void testlib(void); - -void toplib(void) -{ - testlib(); -} diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-project-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-project-stderr.txt deleted file mode 100644 index d506645..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-project-stderr.txt +++ /dev/null @@ -1,13 +0,0 @@ -^CMake Warning \(dev\) at file-GET_RUNTIME_DEPENDENCIES-project\.cmake:[0-9]+ \(file\): - You have used file\(GET_RUNTIME_DEPENDENCIES\) in project mode\. This is - probably not what you intended to do\. Instead, please consider using it in - an install\(CODE\) or install\(SCRIPT\) command\. For example: - - install\(CODE \[\[ - file\(GET_RUNTIME_DEPENDENCIES - # \.\.\. - \) - ]]\) -Call Stack \(most recent call first\): - CMakeLists\.txt:[0-9]+ \(include\) -This warning is for project developers\. Use -Wno-dev to suppress it\.$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-project.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-project.cmake deleted file mode 100644 index 842d7ab..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-project.cmake +++ /dev/null @@ -1 +0,0 @@ -file(GET_RUNTIME_DEPENDENCIES RESOLVED_DEPENDENCIES_VAR deps) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-unsupported-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-unsupported-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-unsupported-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-unsupported-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-unsupported-stderr.txt deleted file mode 100644 index 3db835c..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-unsupported-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -^CMake Error at file-GET_RUNTIME_DEPENDENCIES-unsupported\.cmake:[0-9]+ \(file\): - file GET_RUNTIME_DEPENDENCIES is not supported on system "[^ - ]+" -Call Stack \(most recent call first\): - CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-unsupported.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-unsupported.cmake deleted file mode 100644 index b91eefe..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-unsupported.cmake +++ /dev/null @@ -1,2 +0,0 @@ -file(GET_RUNTIME_DEPENDENCIES RESOLVED_DEPENDENCIES_VAR deps) -message(FATAL_ERROR "This message should not be displayed") diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-all-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-all-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-all-stderr.txt deleted file mode 100644 index 591a5e7..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-all-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -^CMake Error at cmake_install\.cmake:[0-9]+ \(message\): -.* -.*CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM: custom-platform.* -.*CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL: custom-platform-objdump.* -.*CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND: path/to/custom-objdump.* -.*CMAKE_OBJDUMP: custom-objdump.* diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-dev-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-dev-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-dev-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-dev-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-dev-stderr.txt deleted file mode 100644 index 591a5e7..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation-dev-stderr.txt +++ /dev/null @@ -1,6 +0,0 @@ -^CMake Error at cmake_install\.cmake:[0-9]+ \(message\): -.* -.*CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM: custom-platform.* -.*CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL: custom-platform-objdump.* -.*CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND: path/to/custom-objdump.* -.*CMAKE_OBJDUMP: custom-objdump.* diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation.cmake deleted file mode 100644 index 07bbc5e..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-variable-propagation.cmake +++ /dev/null @@ -1,17 +0,0 @@ -enable_language(C) - -set(CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM "custom-platform") -set(CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL "custom-platform-objdump") -set(CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND "path/to/custom-objdump") -set(CMAKE_OBJDUMP "custom-objdump") - -install(CODE [[ -message(FATAL_ERROR " - CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM: ${CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM} - CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL: ${CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL} - CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND: ${CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND} - CMAKE_OBJDUMP: ${CMAKE_OBJDUMP} -") -]] -COMPONENT dev -) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-all-check.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-all-check.cmake deleted file mode 100644 index b1ba6df..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-all-check.cmake +++ /dev/null @@ -1,38 +0,0 @@ -function(check_contents filename contents_regex) - if(EXISTS "${CMAKE_INSTALL_PREFIX}/${filename}") - file(READ "${CMAKE_INSTALL_PREFIX}/${filename}" contents) - if(NOT contents MATCHES "${contents_regex}") - string(APPEND RunCMake_TEST_FAILED "File contents: - ${contents} -do not match what we expected: - ${contents_regex} -in file: - ${CMAKE_INSTALL_PREFIX}/${filename}\n") - set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) - endif() - else() - string(APPEND RunCMake_TEST_FAILED "File ${CMAKE_INSTALL_PREFIX}/${filename} does not exist") - set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) - endif() -endfunction() - -set(_check - [=[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/\.conflict/\.\./(lib)?libdir\.dll]=] - [=[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/\.search/(lib)?search\.dll]=] - [=[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/(lib)?testlib\.dll]=] - ) -check_contents(deps/deps1.txt "^${_check}$") -check_contents(deps/deps2.txt "^${_check}$") -check_contents(deps/deps3.txt "^${_check}$") -set(_check - [=[(lib)?unresolved\.dll]=] - ) -check_contents(deps/udeps1.txt "^${_check}$") -check_contents(deps/udeps2.txt "^${_check}$") -check_contents(deps/udeps3.txt "^${_check}$") -set(_check - "^(lib)?conflict\\.dll:[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/\\.conflict/(lib)?conflict\\.dll;[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/(lib)?conflict\\.dll\n$" - ) -check_contents(deps/cdeps1.txt "${_check}") -check_contents(deps/cdeps2.txt "${_check}") -check_contents(deps/cdeps3.txt "${_check}") diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-stderr.txt deleted file mode 100644 index a9ca6d0..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-stderr.txt +++ /dev/null @@ -1,7 +0,0 @@ -^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): - file Multiple conflicting paths found for (lib)?path\.dll: - - [^ -]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-build/root-all/lib/test1/(lib)?path\.dll - [^ -]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-build/root-all/lib/test2/(lib)?path\.dll$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-conflict.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-conflict.cmake deleted file mode 100644 index d413443..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-conflict.cmake +++ /dev/null @@ -1,47 +0,0 @@ -enable_language(C) - -set(test1_names path) -set(test2_names path) - -file(WRITE "${CMAKE_BINARY_DIR}/path.c" "__declspec(dllexport) void path(void) {}\n") -add_library(path SHARED "${CMAKE_BINARY_DIR}/path.c") - -file(REMOVE "${CMAKE_BINARY_DIR}/test1.c") -add_library(test1 SHARED "${CMAKE_BINARY_DIR}/test1.c") -foreach(name ${test1_names}) - file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "__declspec(dllimport) extern void ${name}(void);\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "__declspec(dllexport) void test1(void)\n{\n") -foreach(name ${test1_names}) - file(APPEND "${CMAKE_BINARY_DIR}/test1.c" " ${name}();\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "}\n") - -target_link_libraries(test1 PRIVATE ${test1_names}) - -file(REMOVE "${CMAKE_BINARY_DIR}/test2.c") -add_library(test2 SHARED "${CMAKE_BINARY_DIR}/test2.c") -foreach(name ${test2_names}) - file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "__declspec(dllimport) extern void ${name}(void);\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "__declspec(dllexport) void test2(void)\n{\n") -foreach(name ${test2_names}) - file(APPEND "${CMAKE_BINARY_DIR}/test2.c" " ${name}();\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "}\n") - -target_link_libraries(test2 PRIVATE ${test2_names}) - -install(TARGETS test1 path DESTINATION lib/test1) -install(TARGETS test2 path DESTINATION lib/test2) - -install(CODE [[ - file(GET_RUNTIME_DEPENDENCIES - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/lib/test1/$" - "${CMAKE_INSTALL_PREFIX}/lib/test2/$" - PRE_INCLUDE_REGEXES "^(lib)?path\\.dll$" - PRE_EXCLUDE_REGEXES ".*" - ) - message(FATAL_ERROR "This message should not be displayed") - ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-stderr.txt deleted file mode 100644 index 432ac32..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): - file Failed to run (dumpbin|objdump) on: - - [^ -]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-build/root-all/bin/(lib)?test\.dll$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-notfile.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-notfile.cmake deleted file mode 100644 index 6665a3b..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-notfile.cmake +++ /dev/null @@ -1,28 +0,0 @@ -enable_language(C) - -file(WRITE "${CMAKE_BINARY_DIR}/test.c" "__declspec(dllexport) void test(void) {}\n") -file(WRITE "${CMAKE_BINARY_DIR}/main.c" [[__declspec(dllimport) extern void test(void); - -int main(void) -{ - test(); - return 0; -} -]]) - -add_library(test SHARED "${CMAKE_BINARY_DIR}/test.c") -add_executable(exe "${CMAKE_BINARY_DIR}/main.c") -target_link_libraries(exe PRIVATE test) - -install(TARGETS exe DESTINATION bin) - -install(CODE [[ - file(MAKE_DIRECTORY "${CMAKE_INSTALL_PREFIX}/bin/$") - file(GET_RUNTIME_DEPENDENCIES - EXECUTABLES - "${CMAKE_INSTALL_PREFIX}/bin/$" - PRE_INCLUDE_REGEXES "^(lib)?test\\.dll$" - PRE_EXCLUDE_REGEXES ".*" - ) - message(FATAL_ERROR "This message should not be displayed") - ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-stderr.txt deleted file mode 100644 index a20654c..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-stderr.txt +++ /dev/null @@ -1,2 +0,0 @@ -^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): - file Could not resolve file (lib)?unresolved\.dll$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved.cmake deleted file mode 100644 index 4cc74c7..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved.cmake +++ /dev/null @@ -1,18 +0,0 @@ -enable_language(C) - -file(WRITE "${CMAKE_BINARY_DIR}/testlib.c" "__declspec(dllimport) extern void unresolved(void);\n__declspec(dllexport) void testlib(void)\n{\n unresolved();\n}\n") -add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c") -file(WRITE "${CMAKE_BINARY_DIR}/unresolved.c" "__declspec(dllexport) void unresolved(void) {}\n") -add_library(unresolved SHARED "${CMAKE_BINARY_DIR}/unresolved.c") -target_link_libraries(testlib PRIVATE unresolved) -install(TARGETS testlib DESTINATION lib) - -install(CODE [[ - file(GET_RUNTIME_DEPENDENCIES - PRE_INCLUDE_REGEXES "^(lib)?unresolved\\.dll$" - PRE_EXCLUDE_REGEXES ".*" - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/lib/$" - ) - message(FATAL_ERROR "This message should not be displayed") - ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows.cmake deleted file mode 100644 index 19288d8..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows.cmake +++ /dev/null @@ -1,114 +0,0 @@ -enable_language(C) - -set(testlib_names - preexcluded - libdir_postexcluded - libdir - search_postexcluded - search - unresolved - conflict - ) - -file(REMOVE "${CMAKE_BINARY_DIR}/testlib.c") -add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c") -foreach(name ${testlib_names}) - file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "__declspec(dllexport) void ${name}(void) {}\n") - add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c") - - file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "__declspec(dllimport) extern void ${name}(void);\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "__declspec(dllexport) void testlib(void)\n{\n") -foreach(name ${testlib_names}) - file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" " ${name}();\n") -endforeach() -file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "}\n") - -target_link_libraries(testlib PRIVATE ${testlib_names}) - -file(WRITE "${CMAKE_BINARY_DIR}/testlib_conflict.c" "__declspec(dllimport) extern void conflict(void);\n__declspec(dllexport) void testlib_conflict(void)\n{\n conflict();\n}\n") -add_library(testlib_conflict SHARED "${CMAKE_BINARY_DIR}/testlib_conflict.c") -target_link_libraries(testlib_conflict PRIVATE conflict) - -file(WRITE "${CMAKE_BINARY_DIR}/testlib_noconflict.c" "__declspec(dllimport) extern void libdir(void);\n__declspec(dllexport) void testlib_noconflict(void)\n{\n libdir();\n}\n") -add_library(testlib_noconflict SHARED "${CMAKE_BINARY_DIR}/testlib_noconflict.c") -target_link_libraries(testlib_noconflict PRIVATE libdir) - -install(TARGETS testlib libdir_postexcluded libdir conflict testlib_noconflict DESTINATION bin) -install(TARGETS libdir search_postexcluded search DESTINATION bin/.search) # Prefixing with "." ensures it is the first item after list(SORT) -install(TARGETS testlib_conflict conflict DESTINATION bin/.conflict) - -add_executable(topexe file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c) -add_library(toplib SHARED file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c) -add_library(topmod MODULE file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c) -target_link_libraries(topexe PRIVATE testlib) -target_link_libraries(toplib PRIVATE testlib) -target_link_libraries(topmod PRIVATE testlib) - -install(TARGETS topexe toplib topmod DESTINATION bin) - -install(CODE [[ - function(exec_get_runtime_dependencies depsfile udepsfile cdepsfile) - file(GET_RUNTIME_DEPENDENCIES - RESOLVED_DEPENDENCIES_VAR deps - UNRESOLVED_DEPENDENCIES_VAR udeps - CONFLICTING_DEPENDENCIES_PREFIX cdeps - PRE_INCLUDE_REGEXES - "^(lib)?testlib\\.dll$" - "^(lib)?libdir_postexcluded\\.dll$" - "^(lib)?libdir\\.dll$" - "^(lib)?search_postexcluded\\.dll$" - "^(lib)?search\\.dll$" - "^(lib)?unresolved\\.dll$" - "^(lib)?conflict\\.dll$" - "^kernel32\\.dll$" - PRE_EXCLUDE_REGEXES ".*" - POST_INCLUDE_REGEXES - "^.*/(lib)?testlib\\.dll$" - "^.*/(lib)?libdir\\.dll$" - "^.*/(lib)?search\\.dll$" - "^.*/(lib)?conflict\\.dll$" - POST_EXCLUDE_REGEXES ".*" - DIRECTORIES - "${CMAKE_INSTALL_PREFIX}/bin/.search" - ${ARGN} - ) - list(SORT deps) - list(SORT udeps) - list(SORT cdeps_FILENAMES) - file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${depsfile}" "${deps}") - file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${udepsfile}" "${udeps}") - file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "") - foreach(cdep IN LISTS cdeps_FILENAMES) - set(cdep_values ${cdeps_${cdep}}) - list(SORT cdep_values) - file(APPEND "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "${cdep}:${cdep_values}\n") - endforeach() - endfunction() - - exec_get_runtime_dependencies( - deps1.txt udeps1.txt cdeps1.txt - EXECUTABLES - "${CMAKE_INSTALL_PREFIX}/bin/$" - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/bin/.conflict/$" - "${CMAKE_INSTALL_PREFIX}/bin/.conflict/../$" - ) - - exec_get_runtime_dependencies( - deps2.txt udeps2.txt cdeps2.txt - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/bin/$" - "${CMAKE_INSTALL_PREFIX}/bin/.conflict/$" - "${CMAKE_INSTALL_PREFIX}/bin/.conflict/../$" - ) - - exec_get_runtime_dependencies( - deps3.txt udeps3.txt cdeps3.txt - MODULES - "${CMAKE_INSTALL_PREFIX}/bin/$" - LIBRARIES - "${CMAKE_INSTALL_PREFIX}/bin/.conflict/$" - "${CMAKE_INSTALL_PREFIX}/bin/.conflict/../$" - ) - ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c deleted file mode 100644 index 713b8eb..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c +++ /dev/null @@ -1,7 +0,0 @@ -__declspec(dllimport) extern void testlib(void); - -int main(void) -{ - testlib(); - return 0; -} diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c deleted file mode 100644 index 6997175..0000000 --- a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c +++ /dev/null @@ -1,6 +0,0 @@ -__declspec(dllimport) extern void testlib(void); - -__declspec(dllexport) void toplib(void) -{ - testlib(); -} diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-check.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-check.cmake new file mode 100644 index 0000000..381b602 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-check.cmake @@ -0,0 +1,44 @@ +function(check_contents filename contents_regex) + if(EXISTS "${CMAKE_INSTALL_PREFIX}/${filename}") + file(READ "${CMAKE_INSTALL_PREFIX}/${filename}" contents) + if(NOT contents MATCHES "${contents_regex}") + string(APPEND RunCMake_TEST_FAILED "File contents: + ${contents} +do not match what we expected: + ${contents_regex} +in file: + ${CMAKE_INSTALL_PREFIX}/${filename}\n") + set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) + endif() + else() + string(APPEND RunCMake_TEST_FAILED "File ${CMAKE_INSTALL_PREFIX}/${filename} does not exist") + set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) + endif() +endfunction() + +set(_check + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/libtest_rpath\.so]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/libtest_runpath\.so]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/rpath/librpath\.so]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/rpath_parent/librpath_parent\.so]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/rpath_search/librpath_search\.so]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/runpath/librunpath\.so]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/runpath_search/librunpath_search\.so]] + ) +check_contents(deps/deps1.txt "^${_check}$") +check_contents(deps/deps2.txt "^${_check}$") +check_contents(deps/deps3.txt "^${_check}$") +set(_check + [[librpath_unresolved\.so]] + [[librunpath_parent_unresolved\.so]] + [[librunpath_unresolved\.so]] + ) +check_contents(deps/udeps1.txt "^${_check}$") +check_contents(deps/udeps2.txt "^${_check}$") +check_contents(deps/udeps3.txt "^${_check}$") +set(_check + "^libconflict\\.so:[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/conflict/libconflict\\.so;[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/conflict2/libconflict\\.so\n$" + ) +check_contents(deps/cdeps1.txt "${_check}") +check_contents(deps/cdeps2.txt "${_check}") +check_contents(deps/cdeps3.txt "${_check}") diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-stderr.txt new file mode 100644 index 0000000..aeb5736 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-stderr.txt @@ -0,0 +1,119 @@ +^CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librpath_search_postexcluded\.so found in search directory: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/rpath_search_postexcluded + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librpath_search\.so found in search directory: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/rpath_search + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librunpath_search_postexcluded\.so found in search directory: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/runpath_search_postexcluded + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librunpath_search\.so found in search directory: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/runpath_search + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librpath_search_postexcluded\.so found in search directory: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/rpath_search_postexcluded + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librpath_search\.so found in search directory: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/rpath_search + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librunpath_search_postexcluded\.so found in search directory: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/runpath_search_postexcluded + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librunpath_search\.so found in search directory: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/runpath_search + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librpath_search_postexcluded\.so found in search directory: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/rpath_search_postexcluded + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librpath_search\.so found in search directory: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/rpath_search + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librunpath_search_postexcluded\.so found in search directory: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/runpath_search_postexcluded + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\) + +*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\): + Dependency librunpath_search\.so found in search directory: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/runpath_search + + See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\. +Call Stack \(most recent call first\): + cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-conflict-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-conflict-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-conflict-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-conflict-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-conflict-all-stderr.txt new file mode 100644 index 0000000..a6b65df --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-conflict-all-stderr.txt @@ -0,0 +1,7 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): + file Multiple conflicting paths found for librpath\.so: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-conflict-build/root-all/lib/rpath1/librpath\.so + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-conflict-build/root-all/lib/rpath2/librpath\.so$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-conflict.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-conflict.cmake new file mode 100644 index 0000000..f719499 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-conflict.cmake @@ -0,0 +1,54 @@ +enable_language(C) + +set(test1_names rpath) +set(test2_names rpath) + +file(WRITE "${CMAKE_BINARY_DIR}/rpath.c" "void rpath(void) {}\n") +add_library(rpath SHARED "${CMAKE_BINARY_DIR}/rpath.c") +install(TARGETS rpath DESTINATION lib/rpath1) +install(TARGETS rpath DESTINATION lib/rpath2) + +file(REMOVE "${CMAKE_BINARY_DIR}/test1.c") +add_library(test1 SHARED "${CMAKE_BINARY_DIR}/test1.c") +foreach(name ${test1_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "void test1(void)\n{\n") +foreach(name ${test1_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test1.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "}\n") + +target_link_libraries(test1 PRIVATE ${test1_names}) +set_property(TARGET test1 PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/lib/rpath1" + ) + +file(REMOVE "${CMAKE_BINARY_DIR}/test2.c") +add_library(test2 SHARED "${CMAKE_BINARY_DIR}/test2.c") +foreach(name ${test2_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "void test2(void)\n{\n") +foreach(name ${test2_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test2.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "}\n") + +target_link_libraries(test2 PRIVATE ${test2_names}) +set_property(TARGET test2 PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/lib/rpath2" + ) + +install(TARGETS test1 test2 DESTINATION lib) + +install(CODE [[ + file(GET_RUNTIME_DEPENDENCIES + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/lib/$" + "${CMAKE_INSTALL_PREFIX}/lib/$" + PRE_INCLUDE_REGEXES "^librpath\\.so$" + PRE_EXCLUDE_REGEXES ".*" + ) + message(FATAL_ERROR "This message should not be displayed") + ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile-all-stderr.txt new file mode 100644 index 0000000..d9758c5 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile-all-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): + file Failed to run objdump on: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile-build/root-all/bin/\.\./lib/libtest\.so$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile.cmake new file mode 100644 index 0000000..6567438 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile.cmake @@ -0,0 +1,30 @@ +enable_language(C) +cmake_policy(SET CMP0095 NEW) + +file(WRITE "${CMAKE_BINARY_DIR}/test.c" "void test(void) {}\n") +file(WRITE "${CMAKE_BINARY_DIR}/main.c" [[extern void test(void); + +int main(void) +{ + test(); + return 0; +} +]]) + +add_library(test SHARED "${CMAKE_BINARY_DIR}/test.c") +add_executable(exe "${CMAKE_BINARY_DIR}/main.c") +target_link_libraries(exe PRIVATE test) +set_property(TARGET exe PROPERTY INSTALL_RPATH "\${ORIGIN}/../lib") + +install(TARGETS exe DESTINATION bin) + +install(CODE [[ + file(MAKE_DIRECTORY "${CMAKE_INSTALL_PREFIX}/lib/$") + file(GET_RUNTIME_DEPENDENCIES + EXECUTABLES + "${CMAKE_INSTALL_PREFIX}/bin/$" + PRE_INCLUDE_REGEXES "^libtest\\.so$" + PRE_EXCLUDE_REGEXES ".*" + ) + message(FATAL_ERROR "This message should not be displayed") + ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-unresolved-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-unresolved-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-unresolved-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-unresolved-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-unresolved-all-stderr.txt new file mode 100644 index 0000000..eaca512 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-unresolved-all-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): + file Could not resolve file libunresolved\.so$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-unresolved.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-unresolved.cmake new file mode 100644 index 0000000..3efa305 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-unresolved.cmake @@ -0,0 +1,18 @@ +enable_language(C) + +file(WRITE "${CMAKE_BINARY_DIR}/testlib.c" "extern void unresolved(void);\nvoid testlib(void)\n{\n unresolved();\n}\n") +add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c") +file(WRITE "${CMAKE_BINARY_DIR}/unresolved.c" "void unresolved(void) {}\n") +add_library(unresolved SHARED "${CMAKE_BINARY_DIR}/unresolved.c") +target_link_libraries(testlib PRIVATE unresolved) +install(TARGETS testlib DESTINATION lib) + +install(CODE [[ + file(GET_RUNTIME_DEPENDENCIES + PRE_INCLUDE_REGEXES "^libunresolved\\.so$" + PRE_EXCLUDE_REGEXES ".*" + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/lib/$" + ) + message(FATAL_ERROR "This message should not be displayed") + ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux.cmake new file mode 100644 index 0000000..d82d8fb --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux.cmake @@ -0,0 +1,169 @@ +enable_language(C) +cmake_policy(SET CMP0095 NEW) + +set(test_rpath_names + preexcluded + rpath_postexcluded + rpath + rpath_parent_postexcluded + rpath_parent + rpath_origin_postexcluded + rpath_origin + rpath_search_postexcluded + rpath_search + rpath_unresolved + conflict + ) +set(test_runpath_names + runpath_postexcluded + runpath + runpath_origin_postexcluded + runpath_origin + runpath_parent_unresolved + runpath_search_postexcluded + runpath_search + runpath_unresolved + ) + +file(REMOVE "${CMAKE_BINARY_DIR}/test_rpath.c") +add_library(test_rpath SHARED "${CMAKE_BINARY_DIR}/test_rpath.c") +foreach(name ${test_rpath_names}) + file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "void ${name}(void) {}\n") + add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c") + + file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" "extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" "void test_rpath(void)\n{\n") +foreach(name ${test_rpath_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" "}\n") + +install(TARGETS rpath_postexcluded DESTINATION lib/rpath_postexcluded) +install(TARGETS rpath DESTINATION lib/rpath) +install(TARGETS rpath_origin_postexcluded DESTINATION lib/rpath_origin_postexcluded) +install(TARGETS rpath_origin DESTINATION lib/rpath_origin) +install(TARGETS rpath_parent_postexcluded DESTINATION lib/rpath_parent_postexcluded) +install(TARGETS rpath rpath_origin rpath_parent DESTINATION lib/rpath_parent) +install(TARGETS rpath_search_postexcluded DESTINATION lib/rpath_search_postexcluded) +install(TARGETS rpath rpath_origin rpath_parent rpath_search DESTINATION lib/rpath_search) +install(TARGETS conflict DESTINATION lib/conflict) + +target_link_libraries(test_rpath PRIVATE ${test_rpath_names}) +set_property(TARGET test_rpath PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/lib/rpath_postexcluded" + "${CMAKE_BINARY_DIR}/root-all/lib/rpath" + "\$ORIGIN/rpath_origin_postexcluded" + "\${ORIGIN}/rpath_origin" + "${CMAKE_BINARY_DIR}/root-all/lib/conflict" + ) +target_link_options(test_rpath PRIVATE -Wl,--disable-new-dtags) + +file(REMOVE "${CMAKE_BINARY_DIR}/test_runpath.c") +add_library(test_runpath SHARED "${CMAKE_BINARY_DIR}/test_runpath.c") +foreach(name ${test_runpath_names} rpath conflict) + file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "void ${name}(void) {}\n") + if(NOT name MATCHES "^(rpath|conflict)$") + add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c") + endif() + + file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" "extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" "void test_runpath(void)\n{\n") +foreach(name ${test_runpath_names} rpath conflict) + file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" "}\n") + +install(TARGETS runpath_postexcluded DESTINATION lib/runpath_postexcluded) +install(TARGETS runpath DESTINATION lib/runpath) +install(TARGETS runpath_origin_postexcluded DESTINATION lib/runpath_origin_postexcluded) +install(TARGETS runpath_origin DESTINATION lib/runpath_origin) +install(TARGETS runpath_parent_unresolved DESTINATION lib/runpath_parent_unresolved) +install(TARGETS runpath_search_postexcluded DESTINATION lib/runpath_search_postexcluded) +install(TARGETS runpath runpath_origin runpath_search DESTINATION lib/runpath_search) +install(TARGETS conflict DESTINATION lib/conflict2) + +target_link_libraries(test_runpath PRIVATE ${test_runpath_names} rpath conflict) +set_property(TARGET test_runpath PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/lib/runpath/../rpath" # Ensure that files that don't conflict are treated correctly + "${CMAKE_BINARY_DIR}/root-all/lib/runpath_postexcluded" + "${CMAKE_BINARY_DIR}/root-all/lib/runpath" + "\${ORIGIN}/runpath_origin_postexcluded" + "\$ORIGIN/runpath_origin" + "${CMAKE_BINARY_DIR}/root-all/lib/conflict2" + ) +target_link_options(test_runpath PRIVATE -Wl,--enable-new-dtags) + +set_property(TARGET test_rpath ${test_rpath_names} test_runpath ${test_runpath_names} PROPERTY LIBRARY_OUTPUT_DIRECTORY lib) +install(TARGETS test_rpath test_runpath DESTINATION lib) + +add_executable(topexe linux/topexe.c) +add_library(toplib SHARED linux/toplib.c) +add_library(topmod MODULE linux/toplib.c) +target_link_libraries(topexe PRIVATE test_rpath test_runpath) +target_link_libraries(toplib PRIVATE test_rpath test_runpath) +target_link_libraries(topmod PRIVATE test_rpath test_runpath) +set_property(TARGET topexe toplib topmod PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/lib" + "${CMAKE_BINARY_DIR}/root-all/lib/rpath_parent_postexcluded" + "${CMAKE_BINARY_DIR}/root-all/lib/rpath_parent" + "${CMAKE_BINARY_DIR}/root-all/lib/runpath_parent_unresolved" + ) +target_link_options(topexe PRIVATE -Wl,--disable-new-dtags) +target_link_options(toplib PRIVATE -Wl,--disable-new-dtags) +target_link_options(topmod PRIVATE -Wl,--disable-new-dtags) + +install(TARGETS topexe toplib RUNTIME DESTINATION bin LIBRARY DESTINATION lib) +install(TARGETS topmod LIBRARY DESTINATION lib/modules) + +install(CODE [[ + function(exec_get_runtime_dependencies depsfile udepsfile cdepsfile) + file(GET_RUNTIME_DEPENDENCIES + RESOLVED_DEPENDENCIES_VAR deps + UNRESOLVED_DEPENDENCIES_VAR udeps + CONFLICTING_DEPENDENCIES_PREFIX cdeps + PRE_INCLUDE_REGEXES + "^lib(test_rpath|rpath_postexcluded|rpath|rpath_parent_postexcluded|rpath_parent|rpath_origin_postexcluded|rpath_origin|rpath_search_postexcluded|rpath_search|rpath_unresolved|test_runpath|runpath_postexcluded|runpath|runpath_origin_postexcluded|runpath_origin|runpath_parent_unresolved|runpath_search_postexcluded|runpath_search|runpath_unresolved|conflict)\\.so$" + "^libc\\.so" + PRE_EXCLUDE_REGEXES ".*" + POST_INCLUDE_REGEXES "^.*/(libtest_rpath|rpath/librpath|rpath_parent/librpath_parent|rpath_search/librpath_search|libtest_runpath|runpath/librunpath|runpath_origin_postexcluded|runpath_origin|runpath_search/librunpath_search|conflict2?/libconflict)\\.so$" + POST_EXCLUDE_REGEXES ".*" + DIRECTORIES + "${CMAKE_INSTALL_PREFIX}/lib/rpath_search_postexcluded" + "${CMAKE_INSTALL_PREFIX}/lib/rpath_search" + "${CMAKE_INSTALL_PREFIX}/lib/runpath_search_postexcluded" + "${CMAKE_INSTALL_PREFIX}/lib/runpath_search" + ${ARGN} + ) + list(SORT deps) + list(SORT udeps) + list(SORT cdeps_FILENAMES) + file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${depsfile}" "${deps}") + file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${udepsfile}" "${udeps}") + file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "") + foreach(cdep IN LISTS cdeps_FILENAMES) + set(cdep_values ${cdeps_${cdep}}) + list(SORT cdep_values) + file(APPEND "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "${cdep}:${cdep_values}\n") + endforeach() + endfunction() + + exec_get_runtime_dependencies( + deps1.txt udeps1.txt cdeps1.txt + EXECUTABLES + "${CMAKE_INSTALL_PREFIX}/bin/$" + ) + + exec_get_runtime_dependencies( + deps2.txt udeps2.txt cdeps2.txt + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/lib/$" + ) + + exec_get_runtime_dependencies( + deps3.txt udeps3.txt cdeps3.txt + MODULES + "${CMAKE_INSTALL_PREFIX}/lib/modules/$" + ) + ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux/topexe.c b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux/topexe.c new file mode 100644 index 0000000..d196afe --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux/topexe.c @@ -0,0 +1,9 @@ +extern void test_rpath(void); +extern void test_runpath(void); + +int main(void) +{ + test_rpath(); + test_runpath(); + return 0; +} diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux/toplib.c b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux/toplib.c new file mode 100644 index 0000000..040e591 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux/toplib.c @@ -0,0 +1,8 @@ +extern void test_rpath(void); +extern void test_runpath(void); + +void toplib(void) +{ + test_rpath(); + test_runpath(); +} diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-all-check.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-all-check.cmake new file mode 100644 index 0000000..7f68398 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-all-check.cmake @@ -0,0 +1,157 @@ +function(check_contents filename contents_regex) + if(EXISTS "${CMAKE_INSTALL_PREFIX}/${filename}") + file(READ "${CMAKE_INSTALL_PREFIX}/${filename}" contents) + if(NOT contents MATCHES "${contents_regex}") + string(APPEND RunCMake_TEST_FAILED "File contents: + ${contents} +do not match what we expected: + ${contents_regex} +in file: + ${CMAKE_INSTALL_PREFIX}/${filename}\n") + set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) + endif() + else() + string(APPEND RunCMake_TEST_FAILED "File ${CMAKE_INSTALL_PREFIX}/${filename} does not exist") + set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) + endif() +endfunction() + +set(_check + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/bin/../lib/executable_path/libexecutable_path\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/bin/../lib/rpath_executable_path/librpath_executable_path\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/libtestlib\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/normal/libnormal\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] + [[/usr/lib/libSystem\.B\.dylib]] + ) +check_contents(deps/deps1.txt "^${_check}$") + +set(_check + [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] + [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] + [[@rpath/librpath_executable_path_bundle\.dylib]] + [[@rpath/librpath_loader_path_unresolved\.dylib]] + [[@rpath/librpath_unresolved\.dylib]] + ) +check_contents(deps/udeps1.txt "^${_check}$") + +set(_check + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/libtestlib\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/normal/libnormal\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] + [[/usr/lib/libSystem\.B\.dylib]] + ) +check_contents(deps/deps2.txt "^${_check}$") + +set(_check + [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]] + [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] + [[@executable_path/../lib/executable_path_postexcluded/libexecutable_path_postexcluded\.dylib]] + [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] + [[@rpath/librpath_executable_path\.dylib]] + [[@rpath/librpath_executable_path_bundle\.dylib]] + [[@rpath/librpath_executable_path_postexcluded\.dylib]] + [[@rpath/librpath_loader_path_unresolved\.dylib]] + [[@rpath/librpath_unresolved\.dylib]] + ) +check_contents(deps/udeps2.txt "^${_check}$") + +set(_check + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/libtestlib\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/normal/libnormal\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] + [[/usr/lib/libSystem\.B\.dylib]] + ) +check_contents(deps/deps3.txt "^${_check}$") + +set(_check + [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]] + [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] + [[@executable_path/../lib/executable_path_postexcluded/libexecutable_path_postexcluded\.dylib]] + [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] + [[@rpath/librpath_executable_path\.dylib]] + [[@rpath/librpath_executable_path_bundle\.dylib]] + [[@rpath/librpath_executable_path_postexcluded\.dylib]] + [[@rpath/librpath_loader_path_unresolved\.dylib]] + [[@rpath/librpath_unresolved\.dylib]] + ) +check_contents(deps/udeps3.txt "^${_check}$") + +set(_check + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/bin/../lib/executable_path/libexecutable_path\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/bin/../lib/rpath_executable_path/librpath_executable_path\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/libtestlib\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/normal/libnormal\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] + [[/usr/lib/libSystem\.B\.dylib]] + ) +check_contents(deps/deps4.txt "^${_check}$") + +set(_check + [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] + [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] + [[@rpath/librpath_executable_path_bundle\.dylib]] + [[@rpath/librpath_loader_path_unresolved\.dylib]] + [[@rpath/librpath_unresolved\.dylib]] + ) +check_contents(deps/udeps4.txt "^${_check}$") + +set(_check + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/bundle_executable/bin/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/libtestlib\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/normal/libnormal\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] + [[/usr/lib/libSystem\.B\.dylib]] + ) +check_contents(deps/deps5.txt "^${_check}$") + +set(_check + [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]] + [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] + [[@rpath/librpath_executable_path\.dylib]] + [[@rpath/librpath_executable_path_bundle\.dylib]] + [[@rpath/librpath_loader_path_unresolved\.dylib]] + [[@rpath/librpath_unresolved\.dylib]] + ) +check_contents(deps/udeps5.txt "^${_check}$") + +set(_check + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/bundle_executable/bin/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/libtestlib\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/normal/libnormal\.dylib]] + [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]] + [[/usr/lib/libSystem\.B\.dylib]] + ) +check_contents(deps/deps6.txt "^${_check}$") + +set(_check + [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]] + [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]] + [[@rpath/librpath_executable_path\.dylib]] + [[@rpath/librpath_executable_path_bundle\.dylib]] + [[@rpath/librpath_loader_path_unresolved\.dylib]] + [[@rpath/librpath_unresolved\.dylib]] + ) +check_contents(deps/udeps6.txt "^${_check}$") + +set(_check + "^libconflict\\.dylib:[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/conflict/libconflict\\.dylib;[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/conflict2/libconflict\\.dylib\n$" + ) +check_contents(deps/cdeps1.txt "${_check}") +check_contents(deps/cdeps2.txt "${_check}") +check_contents(deps/cdeps3.txt "${_check}") +check_contents(deps/cdeps4.txt "${_check}") +check_contents(deps/cdeps5.txt "${_check}") +check_contents(deps/cdeps6.txt "${_check}") diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-conflict-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-conflict-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-conflict-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-conflict-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-conflict-all-stderr.txt new file mode 100644 index 0000000..d8323a8 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-conflict-all-stderr.txt @@ -0,0 +1,7 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): + file Multiple conflicting paths found for librpath\.dylib: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-conflict-build/root-all/lib/rpath1/librpath\.dylib + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-conflict-build/root-all/lib/rpath2/librpath\.dylib$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-conflict.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-conflict.cmake new file mode 100644 index 0000000..a8446fe --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-conflict.cmake @@ -0,0 +1,55 @@ +enable_language(C) + +set(test1_names rpath) +set(test2_names rpath) + +file(WRITE "${CMAKE_BINARY_DIR}/rpath.c" "void rpath(void) {}\n") +add_library(rpath SHARED "${CMAKE_BINARY_DIR}/rpath.c") +set_property(TARGET rpath PROPERTY INSTALL_NAME_DIR @rpath) +install(TARGETS rpath DESTINATION lib/rpath1) +install(TARGETS rpath DESTINATION lib/rpath2) + +file(REMOVE "${CMAKE_BINARY_DIR}/test1.c") +add_library(test1 SHARED "${CMAKE_BINARY_DIR}/test1.c") +foreach(name ${test1_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "void test1(void)\n{\n") +foreach(name ${test1_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test1.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "}\n") + +target_link_libraries(test1 PRIVATE ${test1_names}) +set_property(TARGET test1 PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/lib/rpath1" + ) + +file(REMOVE "${CMAKE_BINARY_DIR}/test2.c") +add_library(test2 SHARED "${CMAKE_BINARY_DIR}/test2.c") +foreach(name ${test2_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "void test2(void)\n{\n") +foreach(name ${test2_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test2.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "}\n") + +target_link_libraries(test2 PRIVATE ${test2_names}) +set_property(TARGET test2 PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/lib/rpath2" + ) + +install(TARGETS test1 test2 DESTINATION lib) + +install(CODE [[ + file(GET_RUNTIME_DEPENDENCIES + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/lib/$" + "${CMAKE_INSTALL_PREFIX}/lib/$" + PRE_INCLUDE_REGEXES "^@rpath/librpath\\.dylib$" + PRE_EXCLUDE_REGEXES ".*" + ) + message(FATAL_ERROR "This message should not be displayed") + ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-notfile-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-notfile-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-notfile-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-notfile-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-notfile-all-stderr.txt new file mode 100644 index 0000000..1afc1b1 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-notfile-all-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): + file Failed to run otool on: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-notfile-build/root-all/bin/\.\./lib/libtest\.dylib$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-notfile.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-notfile.cmake new file mode 100644 index 0000000..3e4c434 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-notfile.cmake @@ -0,0 +1,30 @@ +enable_language(C) + +file(WRITE "${CMAKE_BINARY_DIR}/test.c" "void test(void) {}\n") +file(WRITE "${CMAKE_BINARY_DIR}/main.c" [[extern void test(void); + +int main(void) +{ + test(); + return 0; +} +]]) + +add_library(test SHARED "${CMAKE_BINARY_DIR}/test.c") +set_property(TARGET test PROPERTY INSTALL_NAME_DIR @rpath) +add_executable(exe "${CMAKE_BINARY_DIR}/main.c") +target_link_libraries(exe PRIVATE test) +set_property(TARGET exe PROPERTY INSTALL_RPATH "@loader_path/../lib") + +install(TARGETS exe DESTINATION bin) + +install(CODE [[ + file(MAKE_DIRECTORY "${CMAKE_INSTALL_PREFIX}/lib/$") + file(GET_RUNTIME_DEPENDENCIES + EXECUTABLES + "${CMAKE_INSTALL_PREFIX}/bin/$" + PRE_INCLUDE_REGEXES "^@rpath/libtest\\.dylib$" + PRE_EXCLUDE_REGEXES ".*" + ) + message(FATAL_ERROR "This message should not be displayed") + ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-unresolved-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-unresolved-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-unresolved-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-unresolved-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-unresolved-all-stderr.txt new file mode 100644 index 0000000..01762b4 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-unresolved-all-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): + file Could not resolve file @rpath/libunresolved\.dylib$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-unresolved.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-unresolved.cmake new file mode 100644 index 0000000..c9b6c95 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-unresolved.cmake @@ -0,0 +1,18 @@ +enable_language(C) + +file(WRITE "${CMAKE_BINARY_DIR}/testlib.c" "extern void unresolved(void);\nvoid testlib(void)\n{\n unresolved();\n}\n") +add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c") +file(WRITE "${CMAKE_BINARY_DIR}/unresolved.c" "void unresolved(void) {}\n") +add_library(unresolved SHARED "${CMAKE_BINARY_DIR}/unresolved.c") +target_link_libraries(testlib PRIVATE unresolved) +install(TARGETS testlib DESTINATION lib) + +install(CODE [[ + file(GET_RUNTIME_DEPENDENCIES + PRE_INCLUDE_REGEXES "^@rpath/libunresolved\\.dylib$" + PRE_EXCLUDE_REGEXES ".*" + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/lib/$" + ) + message(FATAL_ERROR "This message should not be displayed") + ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos.cmake new file mode 100644 index 0000000..c56a14b --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos.cmake @@ -0,0 +1,216 @@ +enable_language(C) + +set(testlib_names + preexcluded + executable_path + executable_path_bundle + executable_path_postexcluded + loader_path + loader_path_unresolved + loader_path_postexcluded + rpath + rpath_unresolved + rpath_postexcluded + rpath_executable_path + rpath_executable_path_bundle + rpath_executable_path_postexcluded + rpath_loader_path + rpath_loader_path_unresolved + rpath_loader_path_postexcluded + normal + normal_unresolved + normal_postexcluded + conflict + ) + +file(REMOVE "${CMAKE_BINARY_DIR}/testlib.c") +add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c") +foreach(name ${testlib_names}) + if(name STREQUAL "normal") + file(WRITE "${CMAKE_BINARY_DIR}/normal.c" "extern void rpath(void);\nvoid normal(void)\n{\n rpath();\n}\n") + else() + file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "void ${name}(void) {}\n") + endif() + add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c") + + file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "void testlib(void)\n{\n") +foreach(name ${testlib_names}) + file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "}\n") +set_property(TARGET ${testlib_names} PROPERTY BUILD_WITH_INSTALL_NAME_DIR 1) +target_link_libraries(normal PRIVATE rpath) +set_property(TARGET normal PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/executable/lib/normal/../rpath" + ) + +file(WRITE "${CMAKE_BINARY_DIR}/testlib_conflict.c" "extern void conflict(void);\nvoid testlib_conflict(void)\n{\n conflict();\n}\n") +add_library(testlib_conflict SHARED "${CMAKE_BINARY_DIR}/testlib_conflict.c") +target_link_libraries(testlib_conflict PRIVATE conflict) + +set_property(TARGET testlib PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/executable/lib/rpath" + "${CMAKE_BINARY_DIR}/root-all/executable/lib/rpath_unresolved" + "${CMAKE_BINARY_DIR}/root-all/executable/lib/rpath_postexcluded" + "${CMAKE_BINARY_DIR}/root-all/executable/lib/conflict" + @executable_path/../lib/rpath_executable_path + @executable_path/../lib/rpath_executable_path_unresolved + @executable_path/../lib/rpath_executable_path_postexcluded + @loader_path/rpath_loader_path + @loader_path/rpath_loader_path_unresolved + @loader_path/rpath_loader_path_postexcluded + ) +set_property(TARGET testlib_conflict PROPERTY INSTALL_RPATH + "${CMAKE_BINARY_DIR}/root-all/executable/lib/conflict2" + ) + +foreach(t + executable_path + executable_path_postexcluded + loader_path + loader_path_postexcluded + rpath + rpath_postexcluded + rpath_executable_path + rpath_executable_path_postexcluded + rpath_loader_path + rpath_loader_path_postexcluded + conflict + ) + install(TARGETS ${t} DESTINATION executable/lib/${t}) +endforeach() +install(TARGETS conflict DESTINATION executable/lib/conflict2) + +foreach(t + executable_path_bundle + executable_path_postexcluded + loader_path_postexcluded + rpath_postexcluded + rpath_executable_path_bundle + rpath_executable_path_postexcluded + rpath_loader_path_postexcluded + ) + install(TARGETS ${t} DESTINATION bundle_executable/lib/${t}) +endforeach() + +foreach(t executable_path executable_path_bundle executable_path_postexcluded) + set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR @executable_path/../lib/${t}) +endforeach() + +foreach(t loader_path loader_path_unresolved loader_path_postexcluded) + set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR @loader_path/${t}) +endforeach() + +foreach(t + rpath + rpath_unresolved + rpath_postexcluded + rpath_executable_path + rpath_executable_path_bundle + rpath_executable_path_postexcluded + rpath_loader_path + rpath_loader_path_unresolved + rpath_loader_path_postexcluded + conflict + ) + set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR @rpath) +endforeach() + +foreach(t normal normal_unresolved normal_postexcluded) + set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR "${CMAKE_BINARY_DIR}/root-all/executable/lib/${t}") + if(NOT t STREQUAL "normal_unresolved") + install(TARGETS ${t} DESTINATION executable/lib/${t}) + endif() +endforeach() + +target_link_libraries(testlib PRIVATE ${testlib_names}) + +add_executable(topexe macos/topexe.c) +add_library(toplib SHARED macos/toplib.c) +add_library(topmod MODULE macos/toplib.c) +target_link_libraries(topexe PRIVATE testlib) +target_link_libraries(toplib PRIVATE testlib) +target_link_libraries(topmod PRIVATE testlib) + +set_property(TARGET topexe toplib topmod PROPERTY INSTALL_RPATH "${CMAKE_BINARY_DIR}/root-all/executable/lib") + +install(TARGETS topexe toplib topmod testlib testlib_conflict RUNTIME DESTINATION executable/bin LIBRARY DESTINATION executable/lib) +install(TARGETS topexe toplib topmod testlib testlib_conflict RUNTIME DESTINATION bundle_executable/bin LIBRARY DESTINATION bundle_executable/lib) + +install(CODE [[ + function(exec_get_runtime_dependencies depsfile udepsfile cdepsfile) + file(GET_RUNTIME_DEPENDENCIES + RESOLVED_DEPENDENCIES_VAR deps + UNRESOLVED_DEPENDENCIES_VAR udeps + CONFLICTING_DEPENDENCIES_PREFIX cdeps + PRE_INCLUDE_REGEXES "^.*/lib(testlib|executable_path|executable_path_bundle|executable_path_postexcluded|loader_path|loader_path_unresolved|loader_path_postexcluded|rpath|rpath_unresolved|rpath_postexcluded|rpath_executable_path|rpath_executable_path_bundle|rpath_executable_path_postexcluded|rpath_loader_path|rpath_loader_path_unresolved|rpath_loader_path_postexcluded|normal|normal_unresolved|normal_postexcluded|conflict|System\\.B)\\.dylib$" + PRE_EXCLUDE_REGEXES ".*" + POST_INCLUDE_REGEXES "^.*/lib(testlib|executable_path|executable_path_bundle|loader_path|rpath|rpath_executable_path|rpath_executable_path_bundle|rpath_loader_path|normal|conflict|System\\.B)\\.dylib$" + POST_EXCLUDE_REGEXES ".*" + ${ARGN} + ) + list(SORT deps) + list(SORT udeps) + list(SORT cdeps_FILENAMES) + file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${depsfile}" "${deps}") + file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${udepsfile}" "${udeps}") + file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "") + foreach(cdep IN LISTS cdeps_FILENAMES) + set(cdep_values ${cdeps_${cdep}}) + list(SORT cdep_values) + file(APPEND "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "${cdep}:${cdep_values}\n") + endforeach() + endfunction() + + exec_get_runtime_dependencies( + deps1.txt udeps1.txt cdeps1.txt + EXECUTABLES + "${CMAKE_INSTALL_PREFIX}/executable/bin/$" + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + ) + + exec_get_runtime_dependencies( + deps2.txt udeps2.txt cdeps2.txt + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + ) + + exec_get_runtime_dependencies( + deps3.txt udeps3.txt cdeps3.txt + MODULES + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + ) + + exec_get_runtime_dependencies( + deps4.txt udeps4.txt cdeps4.txt + EXECUTABLES + "${CMAKE_INSTALL_PREFIX}/executable/bin/$" + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + BUNDLE_EXECUTABLE + "${CMAKE_INSTALL_PREFIX}/bundle_executable/bin/$" + ) + + exec_get_runtime_dependencies( + deps5.txt udeps5.txt cdeps5.txt + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + BUNDLE_EXECUTABLE "${CMAKE_INSTALL_PREFIX}/bundle_executable/bin/$" + ) + + exec_get_runtime_dependencies( + deps6.txt udeps6.txt cdeps6.txt + MODULES + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/executable/lib/$" + BUNDLE_EXECUTABLE "${CMAKE_INSTALL_PREFIX}/bundle_executable/bin/$" + ) + ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos/topexe.c b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos/topexe.c new file mode 100644 index 0000000..20c6087 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos/topexe.c @@ -0,0 +1,7 @@ +extern void testlib(void); + +int main(void) +{ + testlib(); + return 0; +} diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos/toplib.c b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos/toplib.c new file mode 100644 index 0000000..cff1bff --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos/toplib.c @@ -0,0 +1,6 @@ +extern void testlib(void); + +void toplib(void) +{ + testlib(); +} diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/project-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/project-stderr.txt new file mode 100644 index 0000000..f14a10d --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/project-stderr.txt @@ -0,0 +1,13 @@ +^CMake Warning \(dev\) at project\.cmake:[0-9]+ \(file\): + You have used file\(GET_RUNTIME_DEPENDENCIES\) in project mode\. This is + probably not what you intended to do\. Instead, please consider using it in + an install\(CODE\) or install\(SCRIPT\) command\. For example: + + install\(CODE \[\[ + file\(GET_RUNTIME_DEPENDENCIES + # \.\.\. + \) + ]]\) +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\) +This warning is for project developers\. Use -Wno-dev to suppress it\.$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/project.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/project.cmake new file mode 100644 index 0000000..842d7ab --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/project.cmake @@ -0,0 +1 @@ +file(GET_RUNTIME_DEPENDENCIES RESOLVED_DEPENDENCIES_VAR deps) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/unsupported-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/unsupported-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/unsupported-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/unsupported-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/unsupported-stderr.txt new file mode 100644 index 0000000..000159f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/unsupported-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at unsupported\.cmake:[0-9]+ \(file\): + file GET_RUNTIME_DEPENDENCIES is not supported on system "[^ + ]+" +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/unsupported.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/unsupported.cmake new file mode 100644 index 0000000..b91eefe --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/unsupported.cmake @@ -0,0 +1,2 @@ +file(GET_RUNTIME_DEPENDENCIES RESOLVED_DEPENDENCIES_VAR deps) +message(FATAL_ERROR "This message should not be displayed") diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-all-stderr.txt new file mode 100644 index 0000000..591a5e7 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-all-stderr.txt @@ -0,0 +1,6 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(message\): +.* +.*CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM: custom-platform.* +.*CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL: custom-platform-objdump.* +.*CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND: path/to/custom-objdump.* +.*CMAKE_OBJDUMP: custom-objdump.* diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-dev-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-dev-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-dev-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-dev-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-dev-stderr.txt new file mode 100644 index 0000000..591a5e7 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-dev-stderr.txt @@ -0,0 +1,6 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(message\): +.* +.*CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM: custom-platform.* +.*CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL: custom-platform-objdump.* +.*CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND: path/to/custom-objdump.* +.*CMAKE_OBJDUMP: custom-objdump.* diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation.cmake new file mode 100644 index 0000000..07bbc5e --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation.cmake @@ -0,0 +1,17 @@ +enable_language(C) + +set(CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM "custom-platform") +set(CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL "custom-platform-objdump") +set(CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND "path/to/custom-objdump") +set(CMAKE_OBJDUMP "custom-objdump") + +install(CODE [[ +message(FATAL_ERROR " + CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM: ${CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM} + CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL: ${CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL} + CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND: ${CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND} + CMAKE_OBJDUMP: ${CMAKE_OBJDUMP} +") +]] +COMPONENT dev +) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-all-check.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-all-check.cmake new file mode 100644 index 0000000..f1d70a1 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-all-check.cmake @@ -0,0 +1,38 @@ +function(check_contents filename contents_regex) + if(EXISTS "${CMAKE_INSTALL_PREFIX}/${filename}") + file(READ "${CMAKE_INSTALL_PREFIX}/${filename}" contents) + if(NOT contents MATCHES "${contents_regex}") + string(APPEND RunCMake_TEST_FAILED "File contents: + ${contents} +do not match what we expected: + ${contents_regex} +in file: + ${CMAKE_INSTALL_PREFIX}/${filename}\n") + set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) + endif() + else() + string(APPEND RunCMake_TEST_FAILED "File ${CMAKE_INSTALL_PREFIX}/${filename} does not exist") + set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE) + endif() +endfunction() + +set(_check + [=[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-build/root-all/bin/\.conflict/\.\./(lib)?libdir\.dll]=] + [=[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-build/root-all/bin/\.search/(lib)?search\.dll]=] + [=[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-build/root-all/bin/(lib)?testlib\.dll]=] + ) +check_contents(deps/deps1.txt "^${_check}$") +check_contents(deps/deps2.txt "^${_check}$") +check_contents(deps/deps3.txt "^${_check}$") +set(_check + [=[(lib)?unresolved\.dll]=] + ) +check_contents(deps/udeps1.txt "^${_check}$") +check_contents(deps/udeps2.txt "^${_check}$") +check_contents(deps/udeps3.txt "^${_check}$") +set(_check + "^(lib)?conflict\\.dll:[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-build/root-all/bin/\\.conflict/(lib)?conflict\\.dll;[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-build/root-all/bin/(lib)?conflict\\.dll\n$" + ) +check_contents(deps/cdeps1.txt "${_check}") +check_contents(deps/cdeps2.txt "${_check}") +check_contents(deps/cdeps3.txt "${_check}") diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict-all-stderr.txt new file mode 100644 index 0000000..c48c55d --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict-all-stderr.txt @@ -0,0 +1,7 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): + file Multiple conflicting paths found for (lib)?path\.dll: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict-build/root-all/lib/test1/(lib)?path\.dll + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict-build/root-all/lib/test2/(lib)?path\.dll$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict.cmake new file mode 100644 index 0000000..d413443 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict.cmake @@ -0,0 +1,47 @@ +enable_language(C) + +set(test1_names path) +set(test2_names path) + +file(WRITE "${CMAKE_BINARY_DIR}/path.c" "__declspec(dllexport) void path(void) {}\n") +add_library(path SHARED "${CMAKE_BINARY_DIR}/path.c") + +file(REMOVE "${CMAKE_BINARY_DIR}/test1.c") +add_library(test1 SHARED "${CMAKE_BINARY_DIR}/test1.c") +foreach(name ${test1_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "__declspec(dllimport) extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "__declspec(dllexport) void test1(void)\n{\n") +foreach(name ${test1_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test1.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "}\n") + +target_link_libraries(test1 PRIVATE ${test1_names}) + +file(REMOVE "${CMAKE_BINARY_DIR}/test2.c") +add_library(test2 SHARED "${CMAKE_BINARY_DIR}/test2.c") +foreach(name ${test2_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "__declspec(dllimport) extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "__declspec(dllexport) void test2(void)\n{\n") +foreach(name ${test2_names}) + file(APPEND "${CMAKE_BINARY_DIR}/test2.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "}\n") + +target_link_libraries(test2 PRIVATE ${test2_names}) + +install(TARGETS test1 path DESTINATION lib/test1) +install(TARGETS test2 path DESTINATION lib/test2) + +install(CODE [[ + file(GET_RUNTIME_DEPENDENCIES + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/lib/test1/$" + "${CMAKE_INSTALL_PREFIX}/lib/test2/$" + PRE_INCLUDE_REGEXES "^(lib)?path\\.dll$" + PRE_EXCLUDE_REGEXES ".*" + ) + message(FATAL_ERROR "This message should not be displayed") + ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-notfile-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-notfile-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-notfile-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-notfile-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-notfile-all-stderr.txt new file mode 100644 index 0000000..33c0390 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-notfile-all-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): + file Failed to run (dumpbin|objdump) on: + + [^ +]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-notfile-build/root-all/bin/(lib)?test\.dll$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-notfile.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-notfile.cmake new file mode 100644 index 0000000..6665a3b --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-notfile.cmake @@ -0,0 +1,28 @@ +enable_language(C) + +file(WRITE "${CMAKE_BINARY_DIR}/test.c" "__declspec(dllexport) void test(void) {}\n") +file(WRITE "${CMAKE_BINARY_DIR}/main.c" [[__declspec(dllimport) extern void test(void); + +int main(void) +{ + test(); + return 0; +} +]]) + +add_library(test SHARED "${CMAKE_BINARY_DIR}/test.c") +add_executable(exe "${CMAKE_BINARY_DIR}/main.c") +target_link_libraries(exe PRIVATE test) + +install(TARGETS exe DESTINATION bin) + +install(CODE [[ + file(MAKE_DIRECTORY "${CMAKE_INSTALL_PREFIX}/bin/$") + file(GET_RUNTIME_DEPENDENCIES + EXECUTABLES + "${CMAKE_INSTALL_PREFIX}/bin/$" + PRE_INCLUDE_REGEXES "^(lib)?test\\.dll$" + PRE_EXCLUDE_REGEXES ".*" + ) + message(FATAL_ERROR "This message should not be displayed") + ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved-all-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved-all-stderr.txt new file mode 100644 index 0000000..a20654c --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved-all-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error at cmake_install\.cmake:[0-9]+ \(file\): + file Could not resolve file (lib)?unresolved\.dll$ diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved.cmake new file mode 100644 index 0000000..4cc74c7 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved.cmake @@ -0,0 +1,18 @@ +enable_language(C) + +file(WRITE "${CMAKE_BINARY_DIR}/testlib.c" "__declspec(dllimport) extern void unresolved(void);\n__declspec(dllexport) void testlib(void)\n{\n unresolved();\n}\n") +add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c") +file(WRITE "${CMAKE_BINARY_DIR}/unresolved.c" "__declspec(dllexport) void unresolved(void) {}\n") +add_library(unresolved SHARED "${CMAKE_BINARY_DIR}/unresolved.c") +target_link_libraries(testlib PRIVATE unresolved) +install(TARGETS testlib DESTINATION lib) + +install(CODE [[ + file(GET_RUNTIME_DEPENDENCIES + PRE_INCLUDE_REGEXES "^(lib)?unresolved\\.dll$" + PRE_EXCLUDE_REGEXES ".*" + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/lib/$" + ) + message(FATAL_ERROR "This message should not be displayed") + ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows.cmake new file mode 100644 index 0000000..9160ce5 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows.cmake @@ -0,0 +1,114 @@ +enable_language(C) + +set(testlib_names + preexcluded + libdir_postexcluded + libdir + search_postexcluded + search + unresolved + conflict + ) + +file(REMOVE "${CMAKE_BINARY_DIR}/testlib.c") +add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c") +foreach(name ${testlib_names}) + file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "__declspec(dllexport) void ${name}(void) {}\n") + add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c") + + file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "__declspec(dllimport) extern void ${name}(void);\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "__declspec(dllexport) void testlib(void)\n{\n") +foreach(name ${testlib_names}) + file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" " ${name}();\n") +endforeach() +file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "}\n") + +target_link_libraries(testlib PRIVATE ${testlib_names}) + +file(WRITE "${CMAKE_BINARY_DIR}/testlib_conflict.c" "__declspec(dllimport) extern void conflict(void);\n__declspec(dllexport) void testlib_conflict(void)\n{\n conflict();\n}\n") +add_library(testlib_conflict SHARED "${CMAKE_BINARY_DIR}/testlib_conflict.c") +target_link_libraries(testlib_conflict PRIVATE conflict) + +file(WRITE "${CMAKE_BINARY_DIR}/testlib_noconflict.c" "__declspec(dllimport) extern void libdir(void);\n__declspec(dllexport) void testlib_noconflict(void)\n{\n libdir();\n}\n") +add_library(testlib_noconflict SHARED "${CMAKE_BINARY_DIR}/testlib_noconflict.c") +target_link_libraries(testlib_noconflict PRIVATE libdir) + +install(TARGETS testlib libdir_postexcluded libdir conflict testlib_noconflict DESTINATION bin) +install(TARGETS libdir search_postexcluded search DESTINATION bin/.search) # Prefixing with "." ensures it is the first item after list(SORT) +install(TARGETS testlib_conflict conflict DESTINATION bin/.conflict) + +add_executable(topexe windows/topexe.c) +add_library(toplib SHARED windows/toplib.c) +add_library(topmod MODULE windows/toplib.c) +target_link_libraries(topexe PRIVATE testlib) +target_link_libraries(toplib PRIVATE testlib) +target_link_libraries(topmod PRIVATE testlib) + +install(TARGETS topexe toplib topmod DESTINATION bin) + +install(CODE [[ + function(exec_get_runtime_dependencies depsfile udepsfile cdepsfile) + file(GET_RUNTIME_DEPENDENCIES + RESOLVED_DEPENDENCIES_VAR deps + UNRESOLVED_DEPENDENCIES_VAR udeps + CONFLICTING_DEPENDENCIES_PREFIX cdeps + PRE_INCLUDE_REGEXES + "^(lib)?testlib\\.dll$" + "^(lib)?libdir_postexcluded\\.dll$" + "^(lib)?libdir\\.dll$" + "^(lib)?search_postexcluded\\.dll$" + "^(lib)?search\\.dll$" + "^(lib)?unresolved\\.dll$" + "^(lib)?conflict\\.dll$" + "^kernel32\\.dll$" + PRE_EXCLUDE_REGEXES ".*" + POST_INCLUDE_REGEXES + "^.*/(lib)?testlib\\.dll$" + "^.*/(lib)?libdir\\.dll$" + "^.*/(lib)?search\\.dll$" + "^.*/(lib)?conflict\\.dll$" + POST_EXCLUDE_REGEXES ".*" + DIRECTORIES + "${CMAKE_INSTALL_PREFIX}/bin/.search" + ${ARGN} + ) + list(SORT deps) + list(SORT udeps) + list(SORT cdeps_FILENAMES) + file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${depsfile}" "${deps}") + file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${udepsfile}" "${udeps}") + file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "") + foreach(cdep IN LISTS cdeps_FILENAMES) + set(cdep_values ${cdeps_${cdep}}) + list(SORT cdep_values) + file(APPEND "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "${cdep}:${cdep_values}\n") + endforeach() + endfunction() + + exec_get_runtime_dependencies( + deps1.txt udeps1.txt cdeps1.txt + EXECUTABLES + "${CMAKE_INSTALL_PREFIX}/bin/$" + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/bin/.conflict/$" + "${CMAKE_INSTALL_PREFIX}/bin/.conflict/../$" + ) + + exec_get_runtime_dependencies( + deps2.txt udeps2.txt cdeps2.txt + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/bin/$" + "${CMAKE_INSTALL_PREFIX}/bin/.conflict/$" + "${CMAKE_INSTALL_PREFIX}/bin/.conflict/../$" + ) + + exec_get_runtime_dependencies( + deps3.txt udeps3.txt cdeps3.txt + MODULES + "${CMAKE_INSTALL_PREFIX}/bin/$" + LIBRARIES + "${CMAKE_INSTALL_PREFIX}/bin/.conflict/$" + "${CMAKE_INSTALL_PREFIX}/bin/.conflict/../$" + ) + ]]) diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows/topexe.c b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows/topexe.c new file mode 100644 index 0000000..713b8eb --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows/topexe.c @@ -0,0 +1,7 @@ +__declspec(dllimport) extern void testlib(void); + +int main(void) +{ + testlib(); + return 0; +} diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows/toplib.c b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows/toplib.c new file mode 100644 index 0000000..6997175 --- /dev/null +++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows/toplib.c @@ -0,0 +1,6 @@ +__declspec(dllimport) extern void testlib(void); + +__declspec(dllexport) void toplib(void) +{ + testlib(); +} -- cgit v0.12