UnixPaths.cmake 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. # Block multiple inclusion because "CMakeCInformation.cmake" includes
  4. # "Platform/${CMAKE_SYSTEM_NAME}" even though the generic module
  5. # "CMakeSystemSpecificInformation.cmake" already included it.
  6. # The extra inclusion is a work-around documented next to the include()
  7. # call, so this can be removed when the work-around is removed.
  8. if(__UNIX_PATHS_INCLUDED)
  9. return()
  10. endif()
  11. set(__UNIX_PATHS_INCLUDED 1)
  12. set(UNIX 1)
  13. # also add the install directory of the running cmake to the search directories
  14. # CMAKE_ROOT is CMAKE_INSTALL_PREFIX/share/cmake, so we need to go two levels up
  15. get_filename_component(_CMAKE_INSTALL_DIR "${CMAKE_ROOT}" PATH)
  16. get_filename_component(_CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" PATH)
  17. # List common installation prefixes. These will be used for all
  18. # search types.
  19. list(APPEND CMAKE_SYSTEM_PREFIX_PATH
  20. # Standard
  21. /usr/local /usr /
  22. # CMake install location
  23. "${_CMAKE_INSTALL_DIR}"
  24. )
  25. if (NOT CMAKE_FIND_NO_INSTALL_PREFIX)
  26. list(APPEND CMAKE_SYSTEM_PREFIX_PATH
  27. # Project install destination.
  28. "${CMAKE_INSTALL_PREFIX}"
  29. )
  30. if(CMAKE_STAGING_PREFIX)
  31. list(APPEND CMAKE_SYSTEM_PREFIX_PATH
  32. # User-supplied staging prefix.
  33. "${CMAKE_STAGING_PREFIX}"
  34. )
  35. endif()
  36. endif()
  37. # List common include file locations not under the common prefixes.
  38. list(APPEND CMAKE_SYSTEM_INCLUDE_PATH
  39. # Windows API on Cygwin
  40. /usr/include/w32api
  41. # X11
  42. /usr/X11R6/include /usr/include/X11
  43. # Other
  44. /usr/pkg/include
  45. /opt/csw/include /opt/include
  46. /usr/openwin/include
  47. )
  48. list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
  49. # Windows API on Cygwin
  50. /usr/lib/w32api
  51. # X11
  52. /usr/X11R6/lib /usr/lib/X11
  53. # Other
  54. /usr/pkg/lib
  55. /opt/csw/lib /opt/lib
  56. /usr/openwin/lib
  57. )
  58. list(APPEND CMAKE_SYSTEM_PROGRAM_PATH
  59. /usr/pkg/bin
  60. )
  61. list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
  62. /lib /lib32 /lib64 /usr/lib /usr/lib32 /usr/lib64
  63. )
  64. list(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
  65. /usr/include
  66. )
  67. list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
  68. /usr/include
  69. )
  70. # Enable use of lib32 and lib64 search path variants by default.
  71. set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS TRUE)
  72. set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)
  73. set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS TRUE)