UnixPaths.cmake 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. endif()
  41. # List common include file locations not under the common prefixes.
  42. list(APPEND CMAKE_SYSTEM_INCLUDE_PATH
  43. # Windows API on Cygwin
  44. /usr/include/w32api
  45. # X11
  46. /usr/X11R6/include /usr/include/X11
  47. # Other
  48. /usr/pkg/include
  49. /opt/csw/include /opt/include
  50. /usr/openwin/include
  51. )
  52. list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
  53. # Windows API on Cygwin
  54. /usr/lib/w32api
  55. # X11
  56. /usr/X11R6/lib /usr/lib/X11
  57. # Other
  58. /usr/pkg/lib
  59. /opt/csw/lib /opt/lib
  60. /usr/openwin/lib
  61. )
  62. list(APPEND CMAKE_SYSTEM_PROGRAM_PATH
  63. /usr/pkg/bin
  64. )
  65. list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
  66. /lib /usr/lib /usr/lib32 /usr/lib64
  67. )
  68. list(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
  69. /usr/include
  70. )
  71. list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
  72. /usr/include
  73. )
  74. # Enable use of lib64 search path variants by default.
  75. set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)