ENH: make this work for older versions of OSX
[cmake.git] / Modules / CMakeGenericSystem.cmake
blob25dbb9eb372785f6b64a2e52637a5fe89ccb5cdf
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_LIBRARY_PATH_TERMINATOR "")  # for the Digital Mars D compiler the link paths have to be terminated with a "/"
10 SET(CMAKE_LINK_LIBRARY_FLAG "-l")
12 SET(CMAKE_LINK_LIBRARY_SUFFIX "")
13 SET(CMAKE_STATIC_LIBRARY_PREFIX "lib")
14 SET(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
15 SET(CMAKE_SHARED_LIBRARY_PREFIX "lib")          # lib
16 SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so")          # .so
17 SET(CMAKE_EXECUTABLE_SUFFIX "")          # .exe
18 SET(CMAKE_DL_LIBS "dl")
20 SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
21 SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
23 # basically all general purpose OSs support shared libs
24 SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
26 SET (CMAKE_SKIP_RPATH "NO" CACHE BOOL
27      "If set, runtime paths are not added when using shared libraries.")
29 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.") 
31 IF(CMAKE_GENERATOR MATCHES "Makefiles")
32   SET(CMAKE_COLOR_MAKEFILE ON CACHE BOOL
33     "Enable/Disable color output during build."
34     )
35   MARK_AS_ADVANCED(CMAKE_COLOR_MAKEFILE)
36   IF(DEFINED CMAKE_RULE_MESSAGES)
37     SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES ${CMAKE_RULE_MESSAGES})
38   ENDIF(DEFINED CMAKE_RULE_MESSAGES)
39 ENDIF(CMAKE_GENERATOR MATCHES "Makefiles")
41 # Set a variable to indicate whether the value of CMAKE_INSTALL_PREFIX
42 # was initialized by the block below.  This is useful for user
43 # projects to change the default prefix while still allowing the
44 # command line to override it.
45 IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
46   SET(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 1)
47 ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
49 # Choose a default install prefix for this platform.
50 IF(CMAKE_HOST_UNIX)
51   SET(CMAKE_INSTALL_PREFIX "/usr/local"
52     CACHE PATH "Install path prefix, prepended onto install directories.")
53 ELSE(CMAKE_HOST_UNIX)
54   IF("$ENV{ProgramFiles}" MATCHES "^$")
55     IF("$ENV{SystemDrive}" MATCHES "^$")
56       SET(CMAKE_GENERIC_PROGRAM_FILES "C:/Program Files")
57     ELSE("$ENV{SystemDrive}" MATCHES "^$")
58       SET(CMAKE_GENERIC_PROGRAM_FILES "$ENV{SystemDrive}/Program Files")
59     ENDIF("$ENV{SystemDrive}" MATCHES "^$")
60   ELSE("$ENV{ProgramFiles}" MATCHES "^$")
61     SET(CMAKE_GENERIC_PROGRAM_FILES "$ENV{ProgramFiles}")
62   ENDIF("$ENV{ProgramFiles}" MATCHES "^$")
63   SET(CMAKE_INSTALL_PREFIX
64     "${CMAKE_GENERIC_PROGRAM_FILES}/${PROJECT_NAME}"
65     CACHE PATH "Install path prefix, prepended onto install directories.")
66   SET(CMAKE_GENERIC_PROGRAM_FILES)
68   # Make sure the prefix uses forward slashes.
69   STRING(REGEX REPLACE "\\\\" "/"
70     CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
71 ENDIF(CMAKE_HOST_UNIX)
73 MARK_AS_ADVANCED(
74   CMAKE_SKIP_RPATH
75   CMAKE_VERBOSE_MAKEFILE
78 # always include the gcc compiler information
79 INCLUDE(Platform/gcc)