CMakeGenericSystem.cmake 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #=============================================================================
  2. # Copyright 2004-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(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic
  14. SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") # -shared
  15. SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # +s, flag for exe link to use shared lib
  16. SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "") # -rpath
  17. SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "") # : or empty
  18. SET(CMAKE_INCLUDE_FLAG_C "-I") # -I
  19. SET(CMAKE_INCLUDE_FLAG_C_SEP "") # , or empty
  20. SET(CMAKE_LIBRARY_PATH_FLAG "-L")
  21. SET(CMAKE_LIBRARY_PATH_TERMINATOR "") # for the Digital Mars D compiler the link paths have to be terminated with a "/"
  22. SET(CMAKE_LINK_LIBRARY_FLAG "-l")
  23. SET(CMAKE_LINK_LIBRARY_SUFFIX "")
  24. SET(CMAKE_STATIC_LIBRARY_PREFIX "lib")
  25. SET(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
  26. SET(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib
  27. SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so
  28. SET(CMAKE_EXECUTABLE_SUFFIX "") # .exe
  29. SET(CMAKE_DL_LIBS "dl")
  30. SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
  31. SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
  32. # basically all general purpose OSs support shared libs
  33. SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
  34. SET (CMAKE_SKIP_RPATH "NO" CACHE BOOL
  35. "If set, runtime paths are not added when using shared libraries.")
  36. SET(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")
  37. IF(CMAKE_GENERATOR MATCHES "Makefiles")
  38. SET(CMAKE_COLOR_MAKEFILE ON CACHE BOOL
  39. "Enable/Disable color output during build."
  40. )
  41. MARK_AS_ADVANCED(CMAKE_COLOR_MAKEFILE)
  42. IF(DEFINED CMAKE_RULE_MESSAGES)
  43. SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES ${CMAKE_RULE_MESSAGES})
  44. ENDIF(DEFINED CMAKE_RULE_MESSAGES)
  45. ENDIF(CMAKE_GENERATOR MATCHES "Makefiles")
  46. # Set a variable to indicate whether the value of CMAKE_INSTALL_PREFIX
  47. # was initialized by the block below. This is useful for user
  48. # projects to change the default prefix while still allowing the
  49. # command line to override it.
  50. IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
  51. SET(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 1)
  52. ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
  53. # Choose a default install prefix for this platform.
  54. IF(CMAKE_HOST_UNIX)
  55. SET(CMAKE_INSTALL_PREFIX "/usr/local"
  56. CACHE PATH "Install path prefix, prepended onto install directories.")
  57. ELSE(CMAKE_HOST_UNIX)
  58. IF("$ENV{ProgramFiles}" MATCHES "^$")
  59. IF("$ENV{SystemDrive}" MATCHES "^$")
  60. SET(CMAKE_GENERIC_PROGRAM_FILES "C:/Program Files")
  61. ELSE("$ENV{SystemDrive}" MATCHES "^$")
  62. SET(CMAKE_GENERIC_PROGRAM_FILES "$ENV{SystemDrive}/Program Files")
  63. ENDIF("$ENV{SystemDrive}" MATCHES "^$")
  64. ELSE("$ENV{ProgramFiles}" MATCHES "^$")
  65. SET(CMAKE_GENERIC_PROGRAM_FILES "$ENV{ProgramFiles}")
  66. ENDIF("$ENV{ProgramFiles}" MATCHES "^$")
  67. SET(CMAKE_INSTALL_PREFIX
  68. "${CMAKE_GENERIC_PROGRAM_FILES}/${PROJECT_NAME}"
  69. CACHE PATH "Install path prefix, prepended onto install directories.")
  70. SET(CMAKE_GENERIC_PROGRAM_FILES)
  71. # Make sure the prefix uses forward slashes.
  72. STRING(REGEX REPLACE "\\\\" "/"
  73. CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
  74. ENDIF(CMAKE_HOST_UNIX)
  75. MARK_AS_ADVANCED(
  76. CMAKE_SKIP_RPATH
  77. CMAKE_VERBOSE_MAKEFILE
  78. )
  79. # always include the gcc compiler information
  80. INCLUDE(Platform/gcc)