Files
CMake/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake
Vitaly Lipatov c18ed7236d GNUInstallDirs: Warn when CMAKE_SYSTEM_NAME is not set
If a project writes `include(GNUInstallDirs)` before `project()` then
`CMAKE_SYSTEM_NAME` may not be set and an incorrect `LIBDIR` may be
computed.  Warn about this case.
2020-01-30 09:14:47 -05:00

23 lines
392 B
CMake

include(RunCMake)
if(SYSTEM_NAME STREQUAL "FreeBSD")
set(variant "-FreeBSD")
elseif(SYSTEM_NAME MATCHES "^(([^k].*)?BSD|DragonFly)$")
set(variant "-BSD")
else()
set(variant "")
endif()
foreach(case
Opt
Root
Usr
UsrLocal
)
set(RunCMake-stderr-file ${case}${variant}-stderr.txt)
run_cmake(${case})
unset(RunCMake-stderr-file)
endforeach()
run_cmake(NoSystem)