mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
Merge topic 'GNUInstallDirs-no-lang'
78b4ffa0a7 GNUInutallDirs: Suppress LIBDIR warning for LANGUAGES NONE projects
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12440
This commit is contained in:
@@ -90,6 +90,10 @@ where ``<dir>`` is one of:
|
||||
:variable:`CMAKE_INSTALL_PREFIX` is ``/usr``.
|
||||
When cross-compiling, the default is ``lib``.
|
||||
|
||||
In projects that enable no languages, e.g.,
|
||||
``project(... LANGUAGES NONE)``, no target architecture information
|
||||
is available, so the default is ``lib``.
|
||||
|
||||
.. note::
|
||||
|
||||
When an alternative installation prefix is specified with the
|
||||
@@ -444,10 +448,13 @@ set(_GNUInstallDirs_DATAROOTDIR_DEFAULT "share")
|
||||
function(_GNUInstallDirs_LIBDIR_get_default out_var install_prefix)
|
||||
set(${out_var} "${_GNUInstallDirs_LIBDIR_DEFAULT}")
|
||||
|
||||
if (NOT DEFINED CMAKE_SYSTEM_NAME OR NOT DEFINED CMAKE_SIZEOF_VOID_P)
|
||||
message(AUTHOR_WARNING
|
||||
"Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. "
|
||||
"Please enable at least one language before including GNUInstallDirs.")
|
||||
if(NOT DEFINED CMAKE_SYSTEM_NAME)
|
||||
message(AUTHOR_WARNING "Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target platform is known.")
|
||||
elseif(NOT DEFINED CMAKE_SIZEOF_VOID_P)
|
||||
get_property(_enabled_languages GLOBAL PROPERTY ENABLED_LANGUAGES)
|
||||
if(NOT _enabled_languages STREQUAL "NONE")
|
||||
message(AUTHOR_WARNING "Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# When not cross-compiling, detect the host distro's arch-specific 'lib'.
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
^CMake Warning \(author\) at .*/Modules/GNUInstallDirs\.cmake:[0-9]+ \(message\):
|
||||
Unable to determine default CMAKE_INSTALL_LIBDIR directory because no
|
||||
target architecture is known\.
|
||||
Call Stack \(most recent call first\):
|
||||
.*GNUInstallDirs\.cmake:[0-9]+ \(_GNUInstallDirs_LIBDIR_get_default\)
|
||||
.*GNUInstallDirs\.cmake:[0-9]+ \(cmake_language\)
|
||||
.*GNUInstallDirs\.cmake:[0-9]+ \(_GNUInstallDirs_cache_path\)
|
||||
NoArch\.cmake:[0-9]+ \(include\)
|
||||
CMakeLists\.txt:[0-9]+ \(include\)
|
||||
This warning is for project developers\. Use -Wno-author to suppress it\.$
|
||||
@@ -0,0 +1,3 @@
|
||||
enable_language(C)
|
||||
unset(CMAKE_SIZEOF_VOID_P)
|
||||
include(GNUInstallDirs)
|
||||
@@ -0,0 +1 @@
|
||||
include(GNUInstallDirs)
|
||||
@@ -1,7 +1,6 @@
|
||||
^CMake Warning \(author\) at .*/Modules/GNUInstallDirs\.cmake:[0-9]+ \(message\):
|
||||
Unable to determine default CMAKE_INSTALL_LIBDIR directory because no
|
||||
target architecture is known\. Please enable at least one language before
|
||||
including GNUInstallDirs\.
|
||||
target platform is known\.
|
||||
Call Stack \(most recent call first\):
|
||||
.*GNUInstallDirs\.cmake:[0-9]+ \(_GNUInstallDirs_LIBDIR_get_default\)
|
||||
.*GNUInstallDirs\.cmake:[0-9]+ \(cmake_language\)
|
||||
|
||||
@@ -38,6 +38,8 @@ block()
|
||||
endblock()
|
||||
|
||||
run_cmake(GetAbs)
|
||||
run_cmake(NoArch)
|
||||
run_cmake(NoLanguages)
|
||||
run_cmake(NoSystem)
|
||||
|
||||
foreach(case
|
||||
|
||||
Reference in New Issue
Block a user