UnixPaths.cmake 2.7 KB

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