From 5baa81592be69a87c10380daaa03da48c3fc729f Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 16 Apr 2014 22:49:40 +0200 Subject: [PATCH] CMP0052: Test that include dirs in install locations cause no warnings. --- .../include_directories/DirInInstallPrefix-result.txt | 1 + .../include_directories/DirInInstallPrefix-stderr.txt | 1 + .../include_directories/DirInInstallPrefix.cmake | 9 +++++++++ Tests/RunCMake/include_directories/RunCMakeTest.cmake | 3 +++ 4 files changed, 14 insertions(+) create mode 100644 Tests/RunCMake/include_directories/DirInInstallPrefix-result.txt create mode 100644 Tests/RunCMake/include_directories/DirInInstallPrefix-stderr.txt create mode 100644 Tests/RunCMake/include_directories/DirInInstallPrefix.cmake diff --git a/Tests/RunCMake/include_directories/DirInInstallPrefix-result.txt b/Tests/RunCMake/include_directories/DirInInstallPrefix-result.txt new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/Tests/RunCMake/include_directories/DirInInstallPrefix-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/include_directories/DirInInstallPrefix-stderr.txt b/Tests/RunCMake/include_directories/DirInInstallPrefix-stderr.txt new file mode 100644 index 000000000..10f32932e --- /dev/null +++ b/Tests/RunCMake/include_directories/DirInInstallPrefix-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/include_directories/DirInInstallPrefix.cmake b/Tests/RunCMake/include_directories/DirInInstallPrefix.cmake new file mode 100644 index 000000000..d6f08bd10 --- /dev/null +++ b/Tests/RunCMake/include_directories/DirInInstallPrefix.cmake @@ -0,0 +1,9 @@ + +add_library(testTarget empty.cpp) +target_include_directories(testTarget INTERFACE "${CMAKE_INSTALL_PREFIX}/dir") + +install(TARGETS testTarget EXPORT testTargets + DESTINATION lib +) + +install(EXPORT testTargets DESTINATION lib/cmake) diff --git a/Tests/RunCMake/include_directories/RunCMakeTest.cmake b/Tests/RunCMake/include_directories/RunCMakeTest.cmake index 434beb9b5..c5b29d019 100644 --- a/Tests/RunCMake/include_directories/RunCMakeTest.cmake +++ b/Tests/RunCMake/include_directories/RunCMakeTest.cmake @@ -13,6 +13,9 @@ run_cmake(install_config) run_cmake(incomplete-genex) run_cmake(export-NOWARN) +set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/DirInInstallPrefix/prefix") +run_cmake(DirInInstallPrefix) + configure_file( "${RunCMake_SOURCE_DIR}/CMakeLists.txt" "${RunCMake_BINARY_DIR}/copy/CMakeLists.txt"