diff options
author | Brad King <brad.king@kitware.com> | 2020-11-04 20:05:51 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-11-04 20:10:25 (GMT) |
commit | a61007b3b0d7e70f48521e6e35c98f7c7b8b259c (patch) | |
tree | bc2e029adf898747e1d8dee583b9036ca8345bb0 /Tests/RunCMake/GNUInstallDirs | |
parent | 229b5ee99425a41ae1963dc1bb873e0051ba9ccd (diff) | |
download | CMake-a61007b3b0d7e70f48521e6e35c98f7c7b8b259c.zip CMake-a61007b3b0d7e70f48521e6e35c98f7c7b8b259c.tar.gz CMake-a61007b3b0d7e70f48521e6e35c98f7c7b8b259c.tar.bz2 |
Tests: Add RunCMake.GNUInstallDirs case for get_absolute_install_dir
Diffstat (limited to 'Tests/RunCMake/GNUInstallDirs')
-rw-r--r-- | Tests/RunCMake/GNUInstallDirs/GetAbs-stderr.txt | 12 | ||||
-rw-r--r-- | Tests/RunCMake/GNUInstallDirs/GetAbs.cmake | 11 | ||||
-rw-r--r-- | Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake | 1 |
3 files changed, 24 insertions, 0 deletions
diff --git a/Tests/RunCMake/GNUInstallDirs/GetAbs-stderr.txt b/Tests/RunCMake/GNUInstallDirs/GetAbs-stderr.txt new file mode 100644 index 0000000..ec9a2dd --- /dev/null +++ b/Tests/RunCMake/GNUInstallDirs/GetAbs-stderr.txt @@ -0,0 +1,12 @@ +^PROJ1_FULL_BINDIR='/usr/bin' +CMake Warning \(dev\) at [^ +]*/Modules/GNUInstallDirs.cmake:[0-9]+ \(message\): + GNUInstallDirs_get_absolute_install_dir called without third argument. + Using \${dir} from the caller's scope for compatibility with CMake 3.19 and + below. +Call Stack \(most recent call first\): + GetAbs.cmake:10 \(GNUInstallDirs_get_absolute_install_dir\) + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. ++ +PROJ2_FULL_BINDIR='/usr/bin'$ diff --git a/Tests/RunCMake/GNUInstallDirs/GetAbs.cmake b/Tests/RunCMake/GNUInstallDirs/GetAbs.cmake new file mode 100644 index 0000000..7d5bfc8 --- /dev/null +++ b/Tests/RunCMake/GNUInstallDirs/GetAbs.cmake @@ -0,0 +1,11 @@ +set(CMAKE_SIZEOF_VOID_P 8) +set(CMAKE_LIBRARY_ARCHITECTURE "arch") +set(CMAKE_INSTALL_PREFIX /usr) +include(GNUInstallDirs) + +GNUInstallDirs_get_absolute_install_dir(PROJ1_FULL_BINDIR CMAKE_INSTALL_BINDIR BINDIR) +message("PROJ1_FULL_BINDIR='${PROJ1_FULL_BINDIR}'") + +set(dir BINDIR) +GNUInstallDirs_get_absolute_install_dir(PROJ2_FULL_BINDIR CMAKE_INSTALL_BINDIR) +message("PROJ2_FULL_BINDIR='${PROJ2_FULL_BINDIR}'") diff --git a/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake b/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake index 529e10a..395ff30 100644 --- a/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake +++ b/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake @@ -21,4 +21,5 @@ foreach(case unset(RunCMake-stderr-file) endforeach() +run_cmake(GetAbs) run_cmake(NoSystem) |