UnixPaths.cmake 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. # Project install destination.
  35. "${CMAKE_INSTALL_PREFIX}"
  36. )
  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 /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 lib64 search path variants by default.
  71. set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)