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/CMakeFindPackageMode.cmake (-16 lines)
Lines 93-114 Link Here
93
    endif()
93
    endif()
94
  endif()
94
  endif()
95
95
96
  # guess Debian multiarch if it has not been set:
97
  if(EXISTS /etc/debian_version)
98
    if(NOT CMAKE_${LANGUAGE}_LIBRARY_ARCHITECTURE )
99
      file(GLOB filesInLib RELATIVE /lib /lib/*-linux-gnu* )
100
      foreach(file ${filesInLib})
101
        if("${file}" MATCHES "${CMAKE_LIBRARY_ARCHITECTURE_REGEX}")
102
          set(CMAKE_${LANGUAGE}_LIBRARY_ARCHITECTURE ${file})
103
          break()
104
        endif()
105
      endforeach()
106
    endif()
107
    if(NOT CMAKE_LIBRARY_ARCHITECTURE)
108
      set(CMAKE_LIBRARY_ARCHITECTURE ${CMAKE_${LANGUAGE}_LIBRARY_ARCHITECTURE})
109
    endif()
110
  endif()
111
112
endif()
96
endif()
113
97
114
set(CMAKE_${LANGUAGE}_COMPILER "dummy")
98
set(CMAKE_${LANGUAGE}_COMPILER "dummy")
(-)a/Modules/FindPkgConfig.cmake (-18 / +12 lines)
Lines 299-322 Link Here
299
    if(NOT DEFINED CMAKE_SYSTEM_NAME
299
    if(NOT DEFINED CMAKE_SYSTEM_NAME
300
        OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
300
        OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
301
            AND NOT CMAKE_CROSSCOMPILING))
301
            AND NOT CMAKE_CROSSCOMPILING))
302
      if(EXISTS "/etc/debian_version") # is this a debian system ?
302
      # not debian, check the FIND_LIBRARY_USE_LIB32_PATHS and FIND_LIBRARY_USE_LIB64_PATHS properties
303
        if(CMAKE_LIBRARY_ARCHITECTURE)
303
      get_property(uselib32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS)
304
          list(APPEND _lib_dirs "lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig")
304
      if(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
305
        endif()
305
        list(APPEND _lib_dirs "lib32/pkgconfig")
306
      else()
306
      endif()
307
        # not debian, check the FIND_LIBRARY_USE_LIB32_PATHS and FIND_LIBRARY_USE_LIB64_PATHS properties
307
      get_property(uselib64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
308
        get_property(uselib32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS)
308
      if(uselib64 AND CMAKE_SIZEOF_VOID_P EQUAL 8)
309
        if(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
309
        list(APPEND _lib_dirs "lib64/pkgconfig")
310
          list(APPEND _lib_dirs "lib32/pkgconfig")
310
      endif()
311
        endif()
311
      get_property(uselibx32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS)
312
        get_property(uselib64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
312
      if(uselibx32 AND CMAKE_INTERNAL_PLATFORM_ABI STREQUAL "ELF X32")
313
        if(uselib64 AND CMAKE_SIZEOF_VOID_P EQUAL 8)
313
        list(APPEND _lib_dirs "libx32/pkgconfig")
314
          list(APPEND _lib_dirs "lib64/pkgconfig")
315
        endif()
316
        get_property(uselibx32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS)
317
        if(uselibx32 AND CMAKE_INTERNAL_PLATFORM_ABI STREQUAL "ELF X32")
318
          list(APPEND _lib_dirs "libx32/pkgconfig")
319
        endif()
320
      endif()
314
      endif()
321
    endif()
315
    endif()
322
    if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND NOT CMAKE_CROSSCOMPILING)
316
    if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND NOT CMAKE_CROSSCOMPILING)
(-)a/Modules/GNUInstallDirs.cmake (-18 / +5 lines)
Lines 227-250 Link Here
227
      "Please enable at least one language before including GNUInstallDirs.")
227
      "Please enable at least one language before including GNUInstallDirs.")
228
  endif()
228
  endif()
229
  if(CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
229
  if(CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
230
      AND NOT CMAKE_CROSSCOMPILING
230
      AND NOT CMAKE_CROSSCOMPILING)
231
      AND NOT EXISTS "/etc/arch-release")
231
    if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
232
    if (EXISTS "/etc/debian_version") # is this a debian system ?
232
      set(_LIBDIR_DEFAULT "lib64")
233
      if(CMAKE_LIBRARY_ARCHITECTURE)
233
      if(DEFINED _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX)
234
        if("${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$")
234
        set(__LAST_LIBDIR_DEFAULT "lib64")
235
          set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
236
        endif()
237
        if(DEFINED _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX
238
            AND "${_GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/?$")
239
          set(__LAST_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
240
        endif()
241
      endif()
242
    else() # not debian, rely on CMAKE_SIZEOF_VOID_P:
243
      if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
244
        set(_LIBDIR_DEFAULT "lib64")
245
        if(DEFINED _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX)
246
          set(__LAST_LIBDIR_DEFAULT "lib64")
247
        endif()
248
      endif()
235
      endif()
249
    endif()
236
    endif()
250
  endif()
237
  endif()
(-)a/Modules/Platform/GNU.cmake (-7 / +2 lines)
Lines 26-38 Link Here
26
  # checking the platform every time.  This option is advanced enough
26
  # checking the platform every time.  This option is advanced enough
27
  # that only package maintainers should need to adjust it.  They are
27
  # that only package maintainers should need to adjust it.  They are
28
  # capable of providing a setting on the command line.
28
  # capable of providing a setting on the command line.
29
  if(EXISTS "/etc/debian_version")
29
  set(CMAKE_INSTALL_SO_NO_EXE 0 CACHE INTERNAL
30
    set(CMAKE_INSTALL_SO_NO_EXE 1 CACHE INTERNAL
30
    "Install .so files without execute permission.")
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()
31
endif()
37
32
38
set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-gnu[a-z0-9_]*")
33
set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-gnu[a-z0-9_]*")
(-)a/Modules/Platform/Linux.cmake (-13 / +2 lines)
Lines 37-49 Link Here
37
  # checking the platform every time.  This option is advanced enough
37
  # checking the platform every time.  This option is advanced enough
38
  # that only package maintainers should need to adjust it.  They are
38
  # that only package maintainers should need to adjust it.  They are
39
  # capable of providing a setting on the command line.
39
  # capable of providing a setting on the command line.
40
  if(EXISTS "/etc/debian_version")
40
  set(CMAKE_INSTALL_SO_NO_EXE 0 CACHE INTERNAL
41
    set(CMAKE_INSTALL_SO_NO_EXE 1 CACHE INTERNAL
41
    "Install .so files without execute permission.")
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()
42
endif()
48
43
49
# Match multiarch library directory names.
44
# Match multiarch library directory names.
Lines 51-59 Link Here
51
46
52
include(Platform/UnixPaths)
47
include(Platform/UnixPaths)
53
48
54
# Debian has lib32 and lib64 paths only for compatibility so they should not be
55
# searched.
56
if(NOT CMAKE_CROSSCOMPILING AND EXISTS "/etc/debian_version")
57
  set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS FALSE)
58
  set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)
59
endif()

Return to bug 733480