UnixPaths.cmake 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 distributed this file outside of CMake, substitute the full
  12. # License text for the above reference.)
  13. SET(UNIX 1)
  14. # also add the install directory of the running cmake to the search directories
  15. # CMAKE_ROOT is CMAKE_INSTALL_PREFIX/share/cmake, so we need to go two levels up
  16. GET_FILENAME_COMPONENT(_CMAKE_INSTALL_DIR "${CMAKE_ROOT}" PATH)
  17. GET_FILENAME_COMPONENT(_CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" PATH)
  18. # List common installation prefixes. These will be used for all
  19. # search types.
  20. LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH
  21. # Standard
  22. /usr/local / /usr
  23. # CMake install location
  24. "${_CMAKE_INSTALL_DIR}"
  25. # Project install destination.
  26. "${CMAKE_INSTALL_PREFIX}"
  27. )
  28. # List common include file locations not under the common prefixes.
  29. LIST(APPEND CMAKE_SYSTEM_INCLUDE_PATH
  30. # Windows API on Cygwin
  31. /usr/include/w32api
  32. # X11
  33. /usr/X11R6/include /usr/include/X11
  34. # Other
  35. /opt/local/include /usr/pkg/include
  36. /opt/csw/include /opt/include
  37. /usr/openwin/include
  38. )
  39. LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH
  40. # Windows API on Cygwin
  41. /usr/lib/w32api
  42. # X11
  43. /usr/X11R6/lib /usr/lib/X11
  44. # Other
  45. /opt/local/lib /usr/pkg/lib
  46. /opt/csw/lib /opt/lib
  47. /usr/openwin/lib
  48. )
  49. LIST(APPEND CMAKE_SYSTEM_PROGRAM_PATH
  50. /usr/pkg/bin
  51. )
  52. LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
  53. /lib /usr/lib /usr/lib32 /usr/lib64
  54. )
  55. LIST(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
  56. /usr/include
  57. )
  58. LIST(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
  59. /usr/include
  60. )
  61. # Enable use of lib64 search path variants by default.
  62. SET_PROPERTY(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)