CMakeCommonLanguageInclude.cmake 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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 distribute this file outside of CMake, substitute the full
  12. # License text for the above reference.)
  13. # this file has flags that are shared across languages and sets
  14. # cache values that can be initialized in the platform-compiler.cmake file
  15. # it may be included by more than one language.
  16. SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
  17. CACHE STRING "Flags used by the linker.")
  18. IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
  19. # default build type is none
  20. IF(NOT CMAKE_NO_BUILD_TYPE)
  21. SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
  22. "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
  23. ENDIF(NOT CMAKE_NO_BUILD_TYPE)
  24. SET (CMAKE_EXE_LINKER_FLAGS_DEBUG ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
  25. "Flags used by the linker during debug builds.")
  26. SET (CMAKE_EXE_LINKER_FLAGS_MINSIZEREL ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT} CACHE STRING
  27. "Flags used by the linker during release minsize builds.")
  28. SET (CMAKE_EXE_LINKER_FLAGS_RELEASE ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
  29. "Flags used by the linker during release builds.")
  30. SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
  31. ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
  32. "Flags used by the linker during Release with Debug Info builds.")
  33. SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
  34. "Flags used by the linker during debug builds.")
  35. SET (CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL ${CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL_INIT}
  36. CACHE STRING
  37. "Flags used by the linker during release minsize builds.")
  38. SET (CMAKE_SHARED_LINKER_FLAGS_RELEASE ${CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
  39. "Flags used by the linker during release builds.")
  40. SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
  41. ${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
  42. "Flags used by the linker during Release with Debug Info builds.")
  43. SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG ${CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
  44. "Flags used by the linker during debug builds.")
  45. SET (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL ${CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT}
  46. CACHE STRING
  47. "Flags used by the linker during release minsize builds.")
  48. SET (CMAKE_MODULE_LINKER_FLAGS_RELEASE ${CMAKE_MODULE_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
  49. "Flags used by the linker during release builds.")
  50. SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
  51. ${CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
  52. "Flags used by the linker during Release with Debug Info builds.")
  53. ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
  54. # shared linker flags
  55. SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
  56. CACHE STRING "Flags used by the linker during the creation of dll's.")
  57. # module linker flags
  58. SET (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
  59. CACHE STRING "Flags used by the linker during the creation of modules.")
  60. SET(CMAKE_BUILD_TOOL ${CMAKE_MAKE_PROGRAM} CACHE INTERNAL
  61. "What is the target build tool cmake is generating for.")
  62. MARK_AS_ADVANCED(
  63. CMAKE_BUILD_TOOL
  64. CMAKE_VERBOSE_MAKEFILE
  65. CMAKE_EXE_LINKER_FLAGS
  66. CMAKE_EXE_LINKER_FLAGS_DEBUG
  67. CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
  68. CMAKE_EXE_LINKER_FLAGS_RELEASE
  69. CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
  70. CMAKE_SHARED_LINKER_FLAGS
  71. CMAKE_SHARED_LINKER_FLAGS_DEBUG
  72. CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
  73. CMAKE_SHARED_LINKER_FLAGS_RELEASE
  74. CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
  75. CMAKE_MODULE_LINKER_FLAGS
  76. CMAKE_MODULE_LINKER_FLAGS_DEBUG
  77. CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
  78. CMAKE_MODULE_LINKER_FLAGS_RELEASE
  79. CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
  80. )