Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 733480 | Differences between
and this patch

Collapse All | Expand All

(-)a/Modules/Platform/Platform.cmake (-2 / +48 lines)
Line 0 Link Here
0
- 
1
set(CMAKE_PLATFORM_DEBIAN_PATH "/etc/debian_version")
2
set(CMAKE_PLATFORM_ARCHLINUX_PATH "/etc/arch-release")
3
4
option (CMAKE_PLATFORM_DISABLE_DETECTION "Do not check for platform." OFF)
5
6
if(CMAKE_PLATFORM_DISABLE_DETECTION)
7
    set(CMAKE_PLATFORM_DEBIAN_FOUND 0 CACHE INTERNAL
8
      "Debian platform detected via ${CMAKE_PLATFORM_DEBIAN_PATH}")
9
    set(CMAKE_PLATFORM_ARCHLINUX_FOUND 0 CACHE INTERNAL
10
      "Arch Linux platform detected via ${CMAKE_PLATFORM_ARCHLINUX_PATH}")
11
else()
12
  if(EXISTS "${CMAKE_PLATFORM_DEBIAN_PATH}")
13
    set(CMAKE_PLATFORM_DEBIAN_FOUND 1 CACHE INTERNAL
14
      "Debian platform detected via ${CMAKE_PLATFORM_DEBIAN_PATH}")
15
  endif()
16
17
  if(EXISTS "${CMAKE_PLATFORM_ARCHLINUX_PATH}")
18
    set(CMAKE_PLATFORM_ARCHLINUX_FOUND 1 CACHE INTERNAL
19
      "Arch Linux platform detected via ${CMAKE_PLATFORM_ARCHLINUX_PATH}")
20
  endif()
21
endif()
22
23
# Debian policy requires that shared libraries be installed without
24
# executable permission.  Fedora policy requires that shared libraries
25
# be installed with the executable permission.  Since the native tools
26
# create shared libraries with execute permission in the first place a
27
# reasonable policy seems to be to install with execute permission by
28
# default.  In order to support debian packages we provide an option
29
# here.  The option default is based on the current distribution, but
30
# packagers can set it explicitly on the command line.
31
if(DEFINED CMAKE_INSTALL_SO_NO_EXE)
32
  # Store the decision variable in the cache.  This preserves any
33
  # setting the user provides on the command line.
34
  set(CMAKE_INSTALL_SO_NO_EXE "${CMAKE_INSTALL_SO_NO_EXE}" CACHE INTERNAL
35
    "Install .so files without execute permission.")
36
else()
37
  # Store the decision variable as an internal cache entry to avoid
38
  # checking the platform every time.  This option is advanced enough
39
  # that only package maintainers should need to adjust it.  They are
40
  # capable of providing a setting on the command line.
41
  if(CMAKE_PLATFORM_DEBIAN_FOUND)
42
    set(CMAKE_INSTALL_SO_NO_EXE 1 CACHE INTERNAL
43
      "Install .so files without execute permission.")
44
  else()
45
    set(CMAKE_INSTALL_SO_NO_EXE 0 CACHE INTERNAL
46
      "Install .so files without execute permission.")
47
  endif()
48
endif()
1
Platform.cmake
49
Platform.cmake
2
--
3
Modules/Platform/GNU.cmake   | 28 +---------------------------
50
Modules/Platform/GNU.cmake   | 28 +---------------------------
4
Modules/Platform/Linux.cmake | 28 +---------------------------
51
Modules/Platform/Linux.cmake | 28 +---------------------------
5
2 files changed, 2 insertions(+), 54 deletions(-)
52
2 files changed, 2 insertions(+), 54 deletions(-)
(-)a/Modules/Platform/GNU.cmake (-27 / +1 lines)
Lines 8-40 set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,") Link Here
8
set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
8
set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
9
set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
9
set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
10
10
11
# Debian policy requires that shared libraries be installed without
12
# executable permission.  Fedora policy requires that shared libraries
13
# be installed with the executable permission.  Since the native tools
14
# create shared libraries with execute permission in the first place a
15
# reasonable policy seems to be to install with execute permission by
16
# default.  In order to support debian packages we provide an option
17
# here.  The option default is based on the current distribution, but
18
# packagers can set it explicitly on the command line.
19
if(DEFINED CMAKE_INSTALL_SO_NO_EXE)
20
  # Store the decision variable in the cache.  This preserves any
21
  # setting the user provides on the command line.
22
  set(CMAKE_INSTALL_SO_NO_EXE "${CMAKE_INSTALL_SO_NO_EXE}" CACHE INTERNAL
23
    "Install .so files without execute permission.")
24
else()
25
  # Store the decision variable as an internal cache entry to avoid
26
  # checking the platform every time.  This option is advanced enough
27
  # that only package maintainers should need to adjust it.  They are
28
  # capable of providing a setting on the command line.
29
  if(EXISTS "/etc/debian_version")
30
    set(CMAKE_INSTALL_SO_NO_EXE 1 CACHE INTERNAL
31
      "Install .so files without execute permission.")
32
  else()
33
    set(CMAKE_INSTALL_SO_NO_EXE 0 CACHE INTERNAL
34
      "Install .so files without execute permission.")
35
  endif()
36
endif()
37
38
set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-gnu[a-z0-9_]*")
11
set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-gnu[a-z0-9_]*")
39
12
13
include(Platform/Platform)
40
include(Platform/UnixPaths)
14
include(Platform/UnixPaths)
(-)a/Modules/Platform/Linux.cmake (-29 / +1 lines)
Lines 19-54 foreach(type SHARED_LIBRARY SHARED_MODULE EXE) Link Here
19
  set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
19
  set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
20
endforeach()
20
endforeach()
21
21
22
# Debian policy requires that shared libraries be installed without
23
# executable permission.  Fedora policy requires that shared libraries
24
# be installed with the executable permission.  Since the native tools
25
# create shared libraries with execute permission in the first place a
26
# reasonable policy seems to be to install with execute permission by
27
# default.  In order to support debian packages we provide an option
28
# here.  The option default is based on the current distribution, but
29
# packagers can set it explicitly on the command line.
30
if(DEFINED CMAKE_INSTALL_SO_NO_EXE)
31
  # Store the decision variable in the cache.  This preserves any
32
  # setting the user provides on the command line.
33
  set(CMAKE_INSTALL_SO_NO_EXE "${CMAKE_INSTALL_SO_NO_EXE}" CACHE INTERNAL
34
    "Install .so files without execute permission.")
35
else()
36
  # Store the decision variable as an internal cache entry to avoid
37
  # checking the platform every time.  This option is advanced enough
38
  # that only package maintainers should need to adjust it.  They are
39
  # capable of providing a setting on the command line.
40
  if(EXISTS "/etc/debian_version")
41
    set(CMAKE_INSTALL_SO_NO_EXE 1 CACHE INTERNAL
42
      "Install .so files without execute permission.")
43
  else()
44
    set(CMAKE_INSTALL_SO_NO_EXE 0 CACHE INTERNAL
45
      "Install .so files without execute permission.")
46
  endif()
47
endif()
48
49
# Match multiarch library directory names.
22
# Match multiarch library directory names.
50
set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-linux-gnu[a-z0-9_]*")
23
set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-linux-gnu[a-z0-9_]*")
51
24
25
include(Platform/Platform)
52
include(Platform/UnixPaths)
26
include(Platform/UnixPaths)
53
27
54
# Debian has lib32 and lib64 paths only for compatibility so they should not be
28
# Debian has lib32 and lib64 paths only for compatibility so they should not be
55
- 
56
Platform.cmake
29
Platform.cmake
57
--
58
Modules/CMakeFindPackageMode.cmake                          | 3 ++-
30
Modules/CMakeFindPackageMode.cmake                          | 3 ++-
59
Modules/FindPkgConfig.cmake                                 | 4 +++-
31
Modules/FindPkgConfig.cmake                                 | 4 +++-
60
Modules/GNUInstallDirs.cmake                                | 6 ++++--
32
Modules/GNUInstallDirs.cmake                                | 6 ++++--
61
Modules/Platform/Linux.cmake                                | 2 +-
33
Modules/Platform/Linux.cmake                                | 2 +-
62
.../FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH.cmake        | 2 +-
34
.../FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH.cmake        | 2 +-
63
...PkgConfig_PKGCONFIG_PATH_NO_CMAKE_ENVIRONMENT_PATH.cmake | 2 +-
35
...PkgConfig_PKGCONFIG_PATH_NO_CMAKE_ENVIRONMENT_PATH.cmake | 2 +-
64
.../FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_PATH.cmake        | 2 +-
36
.../FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_PATH.cmake        | 2 +-
65
7 files changed, 13 insertions(+), 8 deletions(-)
37
7 files changed, 13 insertions(+), 8 deletions(-)
(-)a/Modules/CMakeFindPackageMode.cmake (-1 / +2 lines)
Lines 73-78 include(CMakeSystemSpecificInitialize) Link Here
73
include(CMakeSystemSpecificInformation)
73
include(CMakeSystemSpecificInformation)
74
74
75
if(UNIX)
75
if(UNIX)
76
  include(Platform/Platform)
76
77
77
  # try to guess whether we have a 64bit system, if it has not been set
78
  # try to guess whether we have a 64bit system, if it has not been set
78
  # from the outside
79
  # from the outside
Lines 94-100 if(UNIX) Link Here
94
  endif()
95
  endif()
95
96
96
  # guess Debian multiarch if it has not been set:
97
  # guess Debian multiarch if it has not been set:
97
  if(EXISTS /etc/debian_version)
98
  if(CMAKE_PLATFORM_DEBIAN_FOUND)
98
    if(NOT CMAKE_${LANGUAGE}_LIBRARY_ARCHITECTURE )
99
    if(NOT CMAKE_${LANGUAGE}_LIBRARY_ARCHITECTURE )
99
      file(GLOB filesInLib RELATIVE /lib /lib/*-linux-gnu* )
100
      file(GLOB filesInLib RELATIVE /lib /lib/*-linux-gnu* )
100
      foreach(file ${filesInLib})
101
      foreach(file ${filesInLib})
(-)a/Modules/FindPkgConfig.cmake (-1 / +3 lines)
Lines 55-60 if (PKG_CONFIG_EXECUTABLE) Link Here
55
  unset(_PKG_CONFIG_VERSION_RESULT)
55
  unset(_PKG_CONFIG_VERSION_RESULT)
56
endif ()
56
endif ()
57
57
58
include(Platform/Platform)
59
58
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
60
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
59
find_package_handle_standard_args(PkgConfig
61
find_package_handle_standard_args(PkgConfig
60
                                  REQUIRED_VARS PKG_CONFIG_EXECUTABLE
62
                                  REQUIRED_VARS PKG_CONFIG_EXECUTABLE
Lines 323-329 macro(_pkg_set_path_internal) Link Here
323
    if(NOT DEFINED CMAKE_SYSTEM_NAME
325
    if(NOT DEFINED CMAKE_SYSTEM_NAME
324
        OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
326
        OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
325
            AND NOT CMAKE_CROSSCOMPILING))
327
            AND NOT CMAKE_CROSSCOMPILING))
326
      if(EXISTS "/etc/debian_version") # is this a debian system ?
328
      if(CMAKE_PLATFORM_DEBIAN_FOUND) # is this a debian system ?
327
        if(CMAKE_LIBRARY_ARCHITECTURE)
329
        if(CMAKE_LIBRARY_ARCHITECTURE)
328
          list(APPEND _lib_dirs "lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig")
330
          list(APPEND _lib_dirs "lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig")
329
        endif()
331
        endif()
(-)a/Modules/GNUInstallDirs.cmake (-2 / +4 lines)
Lines 127-132 Macros Link Here
127
cmake_policy(PUSH)
127
cmake_policy(PUSH)
128
cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
128
cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
129
129
130
include(Platform/Platform)
131
130
# Convert a cache variable to PATH type
132
# Convert a cache variable to PATH type
131
133
132
macro(_GNUInstallDirs_cache_convert_to_path var description)
134
macro(_GNUInstallDirs_cache_convert_to_path var description)
Lines 228-235 if(NOT DEFINED CMAKE_INSTALL_LIBDIR OR (_libdir_set Link Here
228
  endif()
230
  endif()
229
  if(CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
231
  if(CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
230
      AND NOT CMAKE_CROSSCOMPILING
232
      AND NOT CMAKE_CROSSCOMPILING
231
      AND NOT EXISTS "/etc/arch-release")
233
      AND NOT CMAKE_PLATFORM_ARCHLINUX_FOUND)
232
    if (EXISTS "/etc/debian_version") # is this a debian system ?
234
    if (CMAKE_PLATFORM_DEBIAN_FOUND) # is this a debian system ?
233
      if(CMAKE_LIBRARY_ARCHITECTURE)
235
      if(CMAKE_LIBRARY_ARCHITECTURE)
234
        if("${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$")
236
        if("${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$")
235
          set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
237
          set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
(-)a/Modules/Platform/Linux.cmake (-1 / +1 lines)
Lines 27-33 include(Platform/UnixPaths) Link Here
27
27
28
# Debian has lib32 and lib64 paths only for compatibility so they should not be
28
# Debian has lib32 and lib64 paths only for compatibility so they should not be
29
# searched.
29
# searched.
30
if(NOT CMAKE_CROSSCOMPILING AND EXISTS "/etc/debian_version")
30
if(NOT CMAKE_CROSSCOMPILING AND CMAKE_PLATFORM_DEBIAN_FOUND)
31
  set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS FALSE)
31
  set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS FALSE)
32
  set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)
32
  set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)
33
endif()
33
endif()
(-)a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH.cmake (-1 / +1 lines)
Lines 21-27 find_package(PkgConfig) Link Here
21
if(NOT DEFINED CMAKE_SYSTEM_NAME
21
if(NOT DEFINED CMAKE_SYSTEM_NAME
22
    OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
22
    OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
23
    AND NOT CMAKE_CROSSCOMPILING))
23
    AND NOT CMAKE_CROSSCOMPILING))
24
  if(EXISTS "/etc/debian_version") # is this a debian system ?
24
  if(CMAKE_PLATFORM_DEBIAN_FOUND) # is this a debian system ?
25
    if(CMAKE_LIBRARY_ARCHITECTURE MATCHES "^(i386-linux-gnu|x86_64-linux-gnu)$")
25
    if(CMAKE_LIBRARY_ARCHITECTURE MATCHES "^(i386-linux-gnu|x86_64-linux-gnu)$")
26
      # Cannot create directories for all the existing architectures...
26
      # Cannot create directories for all the existing architectures...
27
      set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")
27
      set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")
(-)a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_ENVIRONMENT_PATH.cmake (-1 / +1 lines)
Lines 21-27 find_package(PkgConfig) Link Here
21
if(NOT DEFINED CMAKE_SYSTEM_NAME
21
if(NOT DEFINED CMAKE_SYSTEM_NAME
22
    OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
22
    OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
23
    AND NOT CMAKE_CROSSCOMPILING))
23
    AND NOT CMAKE_CROSSCOMPILING))
24
  if(EXISTS "/etc/debian_version") # is this a debian system ?
24
  if(CMAKE_PLATFORM_DEBIAN_FOUND) # is this a debian system ?
25
    if(CMAKE_LIBRARY_ARCHITECTURE MATCHES "^(i386-linux-gnu|x86_64-linux-gnu)$")
25
    if(CMAKE_LIBRARY_ARCHITECTURE MATCHES "^(i386-linux-gnu|x86_64-linux-gnu)$")
26
      # Cannot create directories for all the existing architectures...
26
      # Cannot create directories for all the existing architectures...
27
      set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig")
27
      set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig")
(-)a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_PATH.cmake (-2 / +1 lines)
Lines 21-27 find_package(PkgConfig) Link Here
21
if(NOT DEFINED CMAKE_SYSTEM_NAME
21
if(NOT DEFINED CMAKE_SYSTEM_NAME
22
    OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
22
    OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
23
    AND NOT CMAKE_CROSSCOMPILING))
23
    AND NOT CMAKE_CROSSCOMPILING))
24
  if(EXISTS "/etc/debian_version") # is this a debian system ?
24
  if(CMAKE_PLATFORM_DEBIAN_FOUND) # is this a debian system ?
25
    if(CMAKE_LIBRARY_ARCHITECTURE MATCHES "^(i386-linux-gnu|x86_64-linux-gnu)$")
25
    if(CMAKE_LIBRARY_ARCHITECTURE MATCHES "^(i386-linux-gnu|x86_64-linux-gnu)$")
26
      # Cannot create directories for all the existing architectures...
26
      # Cannot create directories for all the existing architectures...
27
      set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")
27
      set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")
28
- 

Return to bug 733480