CMakeGenericSystem.cmake 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic
  2. SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") # -shared
  3. SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # +s, flag for exe link to use shared lib
  4. SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "") # -rpath
  5. SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "") # : or empty
  6. SET(CMAKE_INCLUDE_FLAG_C "-I") # -I
  7. SET(CMAKE_INCLUDE_FLAG_C_SEP "") # , or empty
  8. SET(CMAKE_LIBRARY_PATH_FLAG "-L")
  9. SET(CMAKE_LINK_LIBRARY_FLAG "-l")
  10. SET(CMAKE_LINK_LIBRARY_SUFFIX "")
  11. SET(CMAKE_STATIC_LIBRARY_PREFIX "lib")
  12. SET(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
  13. SET(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib
  14. SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so
  15. SET(CMAKE_EXECUTABLE_SUFFIX "") # .exe
  16. SET(CMAKE_DL_LIBS "dl")
  17. SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
  18. SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
  19. # basically all general purpose OSs support shared libs
  20. SET_PROPERTIES(GLOBAL PROPERTIES TARGET_SUPPORTS_SHARED_LIBS TRUE)
  21. SET (CMAKE_SKIP_RPATH "NO" CACHE BOOL
  22. "If set, runtime paths are not added when using shared libraries.")
  23. SET(CMAKE_INIT_VALUE FALSE)
  24. IF(CMAKE_GENERATOR MATCHES "KDevelop3")
  25. SET(CMAKE_INIT_VALUE TRUE)
  26. ENDIF(CMAKE_GENERATOR MATCHES "KDevelop3")
  27. SET(CMAKE_VERBOSE_MAKEFILE ${CMAKE_INIT_VALUE} 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.")
  28. IF(CMAKE_GENERATOR MATCHES "Makefiles")
  29. SET(CMAKE_COLOR_MAKEFILE ON CACHE BOOL
  30. "Enable/Disable color output during build."
  31. )
  32. MARK_AS_ADVANCED(CMAKE_COLOR_MAKEFILE)
  33. ENDIF(CMAKE_GENERATOR MATCHES "Makefiles")
  34. # Set a variable to indicate whether the value of CMAKE_INSTALL_PREFIX
  35. # was initialized by the block below. This is useful for user
  36. # projects to change the default prefix while still allowing the
  37. # command line to override it.
  38. IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
  39. SET(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 1)
  40. ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
  41. # Choose a default install prefix for this platform.
  42. IF(CMAKE_HOST_UNIX)
  43. SET(CMAKE_INSTALL_PREFIX "/usr/local"
  44. CACHE PATH "Install path prefix, prepended onto install directories.")
  45. ELSE(CMAKE_HOST_UNIX)
  46. IF("$ENV{ProgramFiles}" MATCHES "^$")
  47. IF("$ENV{SystemDrive}" MATCHES "^$")
  48. SET(CMAKE_GENERIC_PROGRAM_FILES "C:/Program Files")
  49. ELSE("$ENV{SystemDrive}" MATCHES "^$")
  50. SET(CMAKE_GENERIC_PROGRAM_FILES "$ENV{SystemDrive}/Program Files")
  51. ENDIF("$ENV{SystemDrive}" MATCHES "^$")
  52. ELSE("$ENV{ProgramFiles}" MATCHES "^$")
  53. SET(CMAKE_GENERIC_PROGRAM_FILES "$ENV{ProgramFiles}")
  54. ENDIF("$ENV{ProgramFiles}" MATCHES "^$")
  55. SET(CMAKE_INSTALL_PREFIX
  56. "${CMAKE_GENERIC_PROGRAM_FILES}/${PROJECT_NAME}"
  57. CACHE PATH "Install path prefix, prepended onto install directories.")
  58. SET(CMAKE_GENERIC_PROGRAM_FILES)
  59. # Make sure the prefix uses forward slashes.
  60. STRING(REGEX REPLACE "\\\\" "/"
  61. CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
  62. ENDIF(CMAKE_HOST_UNIX)
  63. MARK_AS_ADVANCED(
  64. CMAKE_SKIP_RPATH
  65. CMAKE_VERBOSE_MAKEFILE
  66. )
  67. # always include the gcc compiler information
  68. INCLUDE(Platform/gcc)