Complete rework of makefile generators expect trouble
This commit is contained in:
parent
c72462ffb1
commit
f5d95fb078
|
@ -5,18 +5,19 @@ IF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ")
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ")
|
||||||
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
|
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||||
ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
|
ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
|
||||||
|
|
||||||
SUBDIRS(Source Modules Templates Utilities)
|
SUBDIRS(Source Modules Templates Utilities)
|
||||||
ENABLE_TESTING()
|
ENABLE_TESTING()
|
||||||
|
|
||||||
# Include the standard Dart testing module
|
# Include the standard Dart testing module
|
||||||
INCLUDE (${CMake_SOURCE_DIR}/Modules/Dart.cmake)
|
INCLUDE (${CMake_SOURCE_DIR}/Modules/Dart.cmake)
|
||||||
INCLUDE (${CMAKE_BINARY_DIR}/Source/InitialConfigureFlags.cmake OPTIONAL)
|
INCLUDE (${CMAKE_BINARY_DIR}/Source/InitialConfigureFlags.cmake OPTIONAL)
|
||||||
|
|
||||||
IF(CMAKE_CONFIGURE_INSTALL_PREFIX)
|
IF(CMAKE_CONFIGURE_INSTALL_PREFIX)
|
||||||
SET(CMAKE_INSTALL_PREFIX ${CMAKE_CONFIGURE_INSTALL_PREFIX} )
|
SET(CMAKE_INSTALL_PREFIX ${CMAKE_CONFIGURE_INSTALL_PREFIX} )
|
||||||
ENDIF(CMAKE_CONFIGURE_INSTALL_PREFIX)
|
ENDIF(CMAKE_CONFIGURE_INSTALL_PREFIX)
|
||||||
|
|
||||||
# use the ansi CXX compile flag for building cmake
|
# use the ansi CXX compile flag for building cmake
|
||||||
|
|
||||||
IF (CMAKE_ANSI_CXXFLAGS)
|
IF (CMAKE_ANSI_CXXFLAGS)
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
|
||||||
ENDIF (CMAKE_ANSI_CXXFLAGS)
|
ENDIF (CMAKE_ANSI_CXXFLAGS)
|
||||||
|
|
|
@ -1,2 +1,10 @@
|
||||||
#
|
#
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/TestForANSIStreamHeaders.cmake)
|
INCLUDE(${CMAKE_ROOT}/Modules/TestForANSIStreamHeaders.cmake)
|
||||||
|
INCLUDE(${CMAKE_ROOT}/Modules/CheckIncludeFileCXX.cmake)
|
||||||
|
INCLUDE(${CMAKE_ROOT}/Modules/TestForSTDNamespace.cmake)
|
||||||
|
INCLUDE(${CMAKE_ROOT}/Modules/TestForANSIForScope.cmake)
|
||||||
|
CHECK_INCLUDE_FILE_CXX("sstream" CMAKE_HAS_ANSI_STRING_STREAM)
|
||||||
|
IF(NOT CMAKE_HAS_ANSI_STRING_STREAM)
|
||||||
|
SET( CMAKE_NO_ANSI_STRING_STREAM 1 CACHE INTERNAL
|
||||||
|
"Does the compiler support sstream or stringstream.")
|
||||||
|
ENDIF(NOT CMAKE_HAS_ANSI_STRING_STREAM)
|
||||||
|
|
|
@ -2,3 +2,4 @@ SET(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@")
|
||||||
SET(CMAKE_AR "@CMAKE_AR@")
|
SET(CMAKE_AR "@CMAKE_AR@")
|
||||||
SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
|
SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
|
||||||
SET(CMAKE_COMPILER_IS_GNUGCC @CMAKE_COMPILER_IS_GNUGCC@)
|
SET(CMAKE_COMPILER_IS_GNUGCC @CMAKE_COMPILER_IS_GNUGCC@)
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
SET(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@")
|
SET(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@")
|
||||||
SET(CMAKE_COMPILER_IS_GNUGXX @CMAKE_COMPILER_IS_GNUGXX@)
|
SET(CMAKE_COMPILER_IS_GNUCXX @CMAKE_COMPILER_IS_GNUCXX@)
|
||||||
|
|
|
@ -16,22 +16,22 @@
|
||||||
|
|
||||||
# variables supplied by the generator at use time
|
# variables supplied by the generator at use time
|
||||||
# <TARGET>
|
# <TARGET>
|
||||||
|
# <TARGET_BASE> the target without the suffix
|
||||||
# <OBJECTS>
|
# <OBJECTS>
|
||||||
# <OBJECT>
|
# <OBJECT>
|
||||||
# <LINK_LIBRARIES>
|
# <LINK_LIBRARIES>
|
||||||
|
# <FLAGS>
|
||||||
|
|
||||||
# CXX compiler information
|
# CXX compiler information
|
||||||
# <CMAKE_CXX_COMPILER>
|
# <CMAKE_CXX_COMPILER>
|
||||||
# <CMAKE_CXX_COMPILE_FLAGS>
|
# <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS>
|
||||||
# <CMAKE_CXX_SHARED_LIBRARY_CREATE_FLAGS>
|
|
||||||
# <CMAKE_CXX_SHARED_MODULE_CREATE_FLAGS>
|
# <CMAKE_CXX_SHARED_MODULE_CREATE_FLAGS>
|
||||||
# <CMAKE_CXX_LINK_FLAGS>
|
# <CMAKE_CXX_LINK_FLAGS>
|
||||||
|
|
||||||
# C compiler information
|
# C compiler information
|
||||||
# <CMAKE_C_COMPILER>
|
# <CMAKE_C_COMPILER>
|
||||||
# <CMAKE_C_COMPILE_FLAGS>
|
# <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS>
|
||||||
# <CMAKE_C_SHARED_LIBRARY_CREATE_FLAGS>
|
# <CMAKE_SHARED_MODULE_CREATE_C_FLAGS>
|
||||||
# <CMAKE_C_SHARED_MODULE_CREATE_FLAGS>
|
|
||||||
# <CMAKE_C_LINK_FLAGS>
|
# <CMAKE_C_LINK_FLAGS>
|
||||||
|
|
||||||
# Static library tools
|
# Static library tools
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
# create a shared C++ library
|
# create a shared C++ library
|
||||||
IF(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY)
|
IF(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY)
|
||||||
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
|
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
|
||||||
"<CMAKE_CXX_COMPILER> <CMAKE_CXX_SHARED_LIBRARY_CREATE_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
"<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
||||||
ENDIF(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY)
|
ENDIF(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY)
|
||||||
|
|
||||||
# create a c++ shared module copy the shared library rule by default
|
# create a c++ shared module copy the shared library rule by default
|
||||||
|
@ -53,7 +53,7 @@ ENDIF(NOT CMAKE_CXX_CREATE_SHARED_MODULE)
|
||||||
# create a C shared library
|
# create a C shared library
|
||||||
IF(NOT CMAKE_C_CREATE_SHARED_LIBRARY)
|
IF(NOT CMAKE_C_CREATE_SHARED_LIBRARY)
|
||||||
SET(CMAKE_C_CREATE_SHARED_LIBRARY
|
SET(CMAKE_C_CREATE_SHARED_LIBRARY
|
||||||
"<CMAKE_C_COMPILER> <CMAKE_C_SHARED_LIBRARY_CREATE_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
"<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
||||||
ENDIF(NOT CMAKE_C_CREATE_SHARED_LIBRARY)
|
ENDIF(NOT CMAKE_C_CREATE_SHARED_LIBRARY)
|
||||||
|
|
||||||
# create a C shared module just copy the shared library rule
|
# create a C shared module just copy the shared library rule
|
||||||
|
@ -78,23 +78,23 @@ ENDIF(NOT CMAKE_C_CREATE_STATIC_LIBRARY)
|
||||||
# compile a C++ file into an object file
|
# compile a C++ file into an object file
|
||||||
IF(NOT CMAKE_CXX_COMPILE_OBJECT)
|
IF(NOT CMAKE_CXX_COMPILE_OBJECT)
|
||||||
SET(CMAKE_CXX_COMPILE_OBJECT
|
SET(CMAKE_CXX_COMPILE_OBJECT
|
||||||
"<CMAKE_CXX_COMPILER> -o <OBJECT> <CMAKE_CXX_COMPILE_FLAGS> -c <SOURCE>")
|
"<CMAKE_CXX_COMPILER> -o <OBJECT> <FLAGS> -c <SOURCE>")
|
||||||
ENDIF(NOT CMAKE_CXX_COMPILE_OBJECT)
|
ENDIF(NOT CMAKE_CXX_COMPILE_OBJECT)
|
||||||
|
|
||||||
# compile a C file into an object file
|
# compile a C file into an object file
|
||||||
IF(NOT CMAKE_C_COMPILE_OBJECT)
|
IF(NOT CMAKE_C_COMPILE_OBJECT)
|
||||||
SET(CMAKE_C_COMPILE_OBJECT
|
SET(CMAKE_C_COMPILE_OBJECT
|
||||||
"<CMAKE_C_COMPILER> -o <OBJECT> <CMAKE_C_COMPILE_FLAGS> -c <SOURCE>")
|
"<CMAKE_C_COMPILER> -o <OBJECT> <FLAGS> -c <SOURCE>")
|
||||||
ENDIF(NOT CMAKE_C_COMPILE_OBJECT)
|
ENDIF(NOT CMAKE_C_COMPILE_OBJECT)
|
||||||
|
|
||||||
|
|
||||||
IF(NOT CMAKE_C_LINK_EXECUTABLE)
|
IF(NOT CMAKE_C_LINK_EXECUTABLE)
|
||||||
SET(CMAKE_C_LINK_EXECUTABLE
|
SET(CMAKE_C_LINK_EXECUTABLE
|
||||||
"<CMAKE_C_COMPILER> <CMAKE_C_LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
"<CMAKE_C_COMPILER> <CMAKE_C_LINK_FLAGS> <FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
||||||
ENDIF(NOT CMAKE_C_LINK_EXECUTABLE)
|
ENDIF(NOT CMAKE_C_LINK_EXECUTABLE)
|
||||||
|
|
||||||
|
|
||||||
IF(NOT CMAKE_CXX_LINK_EXECUTABLE)
|
IF(NOT CMAKE_CXX_LINK_EXECUTABLE)
|
||||||
SET(CMAKE_CXX_LINK_EXECUTABLE
|
SET(CMAKE_CXX_LINK_EXECUTABLE
|
||||||
"<CMAKE_CXX_COMPILER> <CMAKE_CXX_LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
"<CMAKE_CXX_COMPILER> <CMAKE_CXX_LINK_FLAGS> <FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
||||||
ENDIF(NOT CMAKE_CXX_LINK_EXECUTABLE)
|
ENDIF(NOT CMAKE_CXX_LINK_EXECUTABLE)
|
||||||
|
|
|
@ -1,16 +1,22 @@
|
||||||
# determine the compiler to use for C programs
|
# determine the compiler to use for C programs
|
||||||
# NOTE, a generator may set CMAKE_C_COMPILER before
|
# NOTE, a generator may set CMAKE_C_COMPILER before
|
||||||
# loading this file to force a compiler.
|
# loading this file to force a compiler.
|
||||||
|
# use environment variable CCC first if defined by user, next use
|
||||||
|
# the cmake variable CMAKE_GENERATOR_CC which can be defined by a generator
|
||||||
|
# as a default compiler
|
||||||
|
|
||||||
FIND_PROGRAM(CMAKE_C_COMPILER_FULLPATH NAMES $ENV{CC} gcc cc cl bcc )
|
FIND_PROGRAM(CMAKE_C_COMPILER_FULLPATH NAMES $ENV{CC} ${CMAKE_GENERATOR_CC} gcc cc cl bcc )
|
||||||
GET_FILENAME_COMPONENT(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_FULLPATH} NAME_WE)
|
GET_FILENAME_COMPONENT(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_FULLPATH} NAME_WE)
|
||||||
|
# set this to notfound right after so that it is searched for each time this
|
||||||
|
# file is included
|
||||||
|
SET(CMAKE_C_COMPILER_FULLPATH NOTFOUND CACHE INTERNAL "full path to c compiler" FORCE)
|
||||||
FIND_PROGRAM(CMAKE_AR NAMES ar PATHS /bin /usr/bin /usr/local/bin)
|
FIND_PROGRAM(CMAKE_AR NAMES ar PATHS /bin /usr/bin /usr/local/bin)
|
||||||
|
|
||||||
FIND_PROGRAM(CMAKE_RANLIB NAMES ranlib PATHS /bin /usr/bin /usr/local/bin)
|
FIND_PROGRAM(CMAKE_RANLIB NAMES ranlib PATHS /bin /usr/bin /usr/local/bin)
|
||||||
IF(NOT CMAKE_RANLIB)
|
IF(NOT CMAKE_RANLIB)
|
||||||
SET(RANLIB :)
|
SET(CMAKE_RANLIB : CACHE INTERNAL "noop for ranlib")
|
||||||
ENDIF(NOT CMAKE_RANLIB)
|
ENDIF(NOT CMAKE_RANLIB)
|
||||||
|
MARK_AS_ADVANCED(CMAKE_RANLIB)
|
||||||
# test to see if the c compiler is gnu
|
# test to see if the c compiler is gnu
|
||||||
EXEC_PROGRAM(${CMAKE_C_COMPILER} ARGS -E ${CMAKE_ROOT}/Modules/CMakeTestGNU.c OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT RETURN_VALUE CMAKE_COMPILER_RETURN)
|
EXEC_PROGRAM(${CMAKE_C_COMPILER} ARGS -E ${CMAKE_ROOT}/Modules/CMakeTestGNU.c OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT RETURN_VALUE CMAKE_COMPILER_RETURN)
|
||||||
IF(NOT CMAKE_COMPILER_RETURN)
|
IF(NOT CMAKE_COMPILER_RETURN)
|
||||||
|
@ -19,6 +25,8 @@ IF(NOT CMAKE_COMPILER_RETURN)
|
||||||
ENDIF(${CMAKE_COMPILER_OUTPUT} MATCHES ".*THIS_IS_GNU.*" )
|
ENDIF(${CMAKE_COMPILER_OUTPUT} MATCHES ".*THIS_IS_GNU.*" )
|
||||||
ENDIF(NOT CMAKE_COMPILER_RETURN)
|
ENDIF(NOT CMAKE_COMPILER_RETURN)
|
||||||
|
|
||||||
|
|
||||||
# configure variables set in this file for fast reload later on
|
# configure variables set in this file for fast reload later on
|
||||||
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
|
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
|
||||||
${PROJECT_BINARY_DIR}/CMakeCCompiler.cmake)
|
${PROJECT_BINARY_DIR}/CMakeCCompiler.cmake IMMEDIATE)
|
||||||
|
MARK_AS_ADVANCED(CMAKE_AR CMAKE_C_COMPILER_FULLPATH)
|
||||||
|
|
|
@ -1,18 +1,27 @@
|
||||||
# determine the compiler to use for C++ programs
|
# determine the compiler to use for C++ programs
|
||||||
# NOTE, a generator may set CMAKE_CXX_COMPILER before
|
# NOTE, a generator may set CMAKE_CXX_COMPILER before
|
||||||
# loading this file to force a compiler.
|
# loading this file to force a compiler.
|
||||||
|
# use environment variable CXX first if defined by user, next use
|
||||||
|
# the cmake variable CMAKE_GENERATOR_CXX which can be defined by a generator
|
||||||
|
# as a default compiler
|
||||||
|
|
||||||
FIND_PROGRAM(CMAKE_CXX_COMPILER_FULLPATH NAMES $ENV{CXX} c++ g++ CC aCC cl bcc )
|
FIND_PROGRAM(CMAKE_CXX_COMPILER_FULLPATH NAMES $ENV{CXX} ${CMAKE_GENERATOR_CXX} c++ g++ CC aCC cl bcc )
|
||||||
GET_FILENAME_COMPONENT(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER_FULLPATH} NAME_WE)
|
GET_FILENAME_COMPONENT(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER_FULLPATH} NAME_WE)
|
||||||
|
|
||||||
|
# set this to notfound right after so that it is searched for each time this
|
||||||
|
# file is included
|
||||||
|
SET(CMAKE_CXX_COMPILER_FULLPATH NOTFOUND CACHE INTERNAL "full path to cxx compiler" FORCE)
|
||||||
|
|
||||||
|
|
||||||
# test to see if the cxx compiler is gnu
|
# test to see if the cxx compiler is gnu
|
||||||
EXEC_PROGRAM(${CMAKE_CXX_COMPILER} ARGS -E ${CMAKE_ROOT}/Modules/CMakeTestGNU.c OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT RETURN_VALUE CMAKE_COMPILER_RETURN)
|
EXEC_PROGRAM(${CMAKE_CXX_COMPILER} ARGS -E ${CMAKE_ROOT}/Modules/CMakeTestGNU.c OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT RETURN_VALUE CMAKE_COMPILER_RETURN)
|
||||||
IF(NOT CMAKE_COMPILER_RETURN)
|
IF(NOT CMAKE_COMPILER_RETURN)
|
||||||
IF(${CMAKE_COMPILER_OUTPUT} MATCHES ".*THIS_IS_GNU.*" )
|
IF(${CMAKE_COMPILER_OUTPUT} MATCHES ".*THIS_IS_GNU.*" )
|
||||||
SET(CMAKE_COMPILER_IS_GNUGXX 1)
|
SET(CMAKE_COMPILER_IS_GNUCXX 1)
|
||||||
ENDIF(${CMAKE_COMPILER_OUTPUT} MATCHES ".*THIS_IS_GNU.*" )
|
ENDIF(${CMAKE_COMPILER_OUTPUT} MATCHES ".*THIS_IS_GNU.*" )
|
||||||
ENDIF(NOT CMAKE_COMPILER_RETURN)
|
ENDIF(NOT CMAKE_COMPILER_RETURN)
|
||||||
|
|
||||||
# configure all variables set in this file
|
# configure all variables set in this file
|
||||||
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in
|
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in
|
||||||
${PROJECT_BINARY_DIR}/CMakeCXXCompiler.cmake)
|
${PROJECT_BINARY_DIR}/CMakeCXXCompiler.cmake IMMEDIATE)
|
||||||
|
MARK_AS_ADVANCED(CMAKE_CXX_COMPILER_FULLPATH)
|
||||||
|
|
|
@ -60,6 +60,8 @@ IF(CMAKE_SYSTEM_VERSION)
|
||||||
SET(CMAKE_SYSTEM ${CMAKE_SYSTEM}-${CMAKE_SYSTEM_VERSION})
|
SET(CMAKE_SYSTEM ${CMAKE_SYSTEM}-${CMAKE_SYSTEM_VERSION})
|
||||||
ENDIF(CMAKE_SYSTEM_VERSION)
|
ENDIF(CMAKE_SYSTEM_VERSION)
|
||||||
|
|
||||||
|
|
||||||
# configure variables set in this file for fast reload
|
# configure variables set in this file for fast reload
|
||||||
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeSystem.cmake.in
|
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeSystem.cmake.in
|
||||||
${PROJECT_BINARY_DIR}/CMakeSystem.cmake)
|
${PROJECT_BINARY_DIR}/CMakeSystem.cmake IMMEDIATE)
|
||||||
|
|
||||||
|
|
|
@ -8,12 +8,13 @@ MESSAGE("CMAKE_C_COMPILER is ${CMAKE_C_COMPILER}")
|
||||||
MESSAGE("CMAKE_CXX_COMPILER is ${CMAKE_CXX_COMPILER}")
|
MESSAGE("CMAKE_CXX_COMPILER is ${CMAKE_CXX_COMPILER}")
|
||||||
|
|
||||||
|
|
||||||
MESSAGE("CMAKE_SHARED_LIBRARY_CREATE_FLAGS is ${CMAKE_SHARED_LIBRARY_CREATE_FLAGS}")
|
MESSAGE("CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS is ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}")
|
||||||
|
MESSAGE("CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS is ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}")
|
||||||
MESSAGE("CMAKE_DL_LIBS is ${CMAKE_DL_LIBS}")
|
MESSAGE("CMAKE_DL_LIBS is ${CMAKE_DL_LIBS}")
|
||||||
MESSAGE("CMAKE_SHARED_LIBRARY_PREFIX is ${CMAKE_SHARED_LIBRARY_PREFIX}")
|
MESSAGE("CMAKE_SHARED_LIBRARY_PREFIX is ${CMAKE_SHARED_LIBRARY_PREFIX}")
|
||||||
MESSAGE("CMAKE_SHARED_LIBRARY_SUFFIX is ${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
MESSAGE("CMAKE_SHARED_LIBRARY_SUFFIX is ${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||||
MESSAGE("CMAKE_COMPILER_IS_GNUGCC = ${CMAKE_COMPILER_IS_GNUGCC}")
|
MESSAGE("CMAKE_COMPILER_IS_GNUGCC = ${CMAKE_COMPILER_IS_GNUGCC}")
|
||||||
MESSAGE("CMAKE_COMPILER_IS_GNUGXX = ${CMAKE_COMPILER_IS_GNUGXX}")
|
MESSAGE("CMAKE_COMPILER_IS_GNUCXX = ${CMAKE_COMPILER_IS_GNUCXX}")
|
||||||
|
|
||||||
MESSAGE("CMAKE_CXX_CREATE_SHARED_LIBRARY is ${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
|
MESSAGE("CMAKE_CXX_CREATE_SHARED_LIBRARY is ${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
|
||||||
MESSAGE("CMAKE_CXX_CREATE_SHARED_MODULE is ${CMAKE_CXX_CREATE_SHARED_MODULE}")
|
MESSAGE("CMAKE_CXX_CREATE_SHARED_MODULE is ${CMAKE_CXX_CREATE_SHARED_MODULE}")
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
SET(CMAKE_SYSTEM "@CMAKE_SYSTEM@")
|
SET(CMAKE_SYSTEM "@CMAKE_SYSTEM@")
|
||||||
SET(CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@")
|
SET(CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@")
|
||||||
SET(CMAKE_SYSTEM_VERSION "@CMAKE_SYSTEM_VERSION@")
|
SET(CMAKE_SYSTEM_VERSION "@CMAKE_SYSTEM_VERSION@")
|
||||||
|
|
||||||
|
|
|
@ -11,29 +11,34 @@
|
||||||
|
|
||||||
|
|
||||||
# 1. set default values that will work for most system
|
# 1. set default values that will work for most system
|
||||||
|
|
||||||
|
# suffix that needs to be added onto a library to link it .lib on windows
|
||||||
|
# not used on most unix systems
|
||||||
|
SET(CMAKE_LINK_LIBRARY_SUFFIX "")
|
||||||
|
|
||||||
SET(CMAKE_STATIC_LIBRARY_PREFIX "lib")
|
SET(CMAKE_STATIC_LIBRARY_PREFIX "lib")
|
||||||
SET(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
|
SET(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
|
||||||
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic
|
|
||||||
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "") # -pic
|
|
||||||
SET(CMAKE_SHARED_LIBRARY_CREATE_FLAGS "") # -shared
|
|
||||||
SET(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib
|
SET(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib
|
||||||
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so
|
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so
|
||||||
|
SET(CMAKE_DL_LIBS "-ldl")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") # -shared
|
||||||
SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "") # +s, flag for exe link to use shared lib
|
SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "") # +s, flag for exe link to use shared lib
|
||||||
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "") # -rpath
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "") # -rpath
|
||||||
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP "") # : or empty
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP "") # : or empty
|
||||||
SET(CMAKE_LIBRARY_PATH_FLAG "-L")
|
SET(CMAKE_LIBRARY_PATH_FLAG "-L")
|
||||||
SET(CMAKE_LINK_LIBRARY_FLAG "-l")
|
SET(CMAKE_LINK_LIBRARY_FLAG "-l")
|
||||||
IF(CMAKE_COMPILER_IS_GNUGXX)
|
IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic
|
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic
|
||||||
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-fPIC") # -pic
|
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-fPIC") # -pic
|
||||||
ENDIF(CMAKE_COMPILER_IS_GNUGXX)
|
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
|
||||||
|
|
||||||
SET (CMAKE_SKIP_RPATH "NO" CACHE BOOL
|
SET (CMAKE_SKIP_RPATH "NO" CACHE BOOL
|
||||||
"If set, runtime paths are not added when using shared libraries.")
|
"If set, runtime paths are not added when using shared libraries.")
|
||||||
|
MARK_AS_ADVANCED(CMAKE_SKIP_RPATH)
|
||||||
# 2. now include SystemName.cmake file to set the system specific information
|
# 2. now include SystemName.cmake file to set the system specific information
|
||||||
SET(CMAKE_SYSTEM_INFO_FILE ${CMAKE_ROOT}/Modules/${CMAKE_SYSTEM_NAME}.cmake)
|
SET(CMAKE_SYSTEM_INFO_FILE ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}.cmake)
|
||||||
IF(EXISTS ${CMAKE_SYSTEM_INFO_FILE})
|
IF(EXISTS ${CMAKE_SYSTEM_INFO_FILE})
|
||||||
INCLUDE(${CMAKE_SYSTEM_INFO_FILE})
|
INCLUDE(${CMAKE_SYSTEM_INFO_FILE})
|
||||||
ELSE(EXISTS ${CMAKE_SYSTEM_INFO_FILE})
|
ELSE(EXISTS ${CMAKE_SYSTEM_INFO_FILE})
|
||||||
|
@ -50,17 +55,17 @@ IF(CMAKE_C_COMPILER)
|
||||||
SET(CMAKE_BASE_NAME gcc)
|
SET(CMAKE_BASE_NAME gcc)
|
||||||
ENDIF(CMAKE_COMPILER_IS_GNUGCC)
|
ENDIF(CMAKE_COMPILER_IS_GNUGCC)
|
||||||
SET(CMAKE_SYSTEM_AND_C_COMPILER_INFO_FILE
|
SET(CMAKE_SYSTEM_AND_C_COMPILER_INFO_FILE
|
||||||
${CMAKE_ROOT}/Modules/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake)
|
${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake)
|
||||||
INCLUDE(${CMAKE_SYSTEM_AND_C_COMPILER_INFO_FILE} OPTIONAL)
|
INCLUDE(${CMAKE_SYSTEM_AND_C_COMPILER_INFO_FILE} OPTIONAL)
|
||||||
ENDIF(CMAKE_C_COMPILER)
|
ENDIF(CMAKE_C_COMPILER)
|
||||||
IF(CMAKE_CXX_COMPILER)
|
IF(CMAKE_CXX_COMPILER)
|
||||||
GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_CXX_COMPILER} NAME_WE)
|
GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_CXX_COMPILER} NAME_WE)
|
||||||
# since the gnu compiler has several names force gcc
|
# since the gnu compiler has several names force gcc
|
||||||
IF(CMAKE_COMPILER_IS_GNUGXX)
|
IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
SET(CMAKE_BASE_NAME g++)
|
SET(CMAKE_BASE_NAME g++)
|
||||||
ENDIF(CMAKE_COMPILER_IS_GNUGXX)
|
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
SET(CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE
|
SET(CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE
|
||||||
${CMAKE_ROOT}/Modules/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake)
|
${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake)
|
||||||
INCLUDE(${CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE} OPTIONAL)
|
INCLUDE(${CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE} OPTIONAL)
|
||||||
ENDIF(CMAKE_CXX_COMPILER)
|
ENDIF(CMAKE_CXX_COMPILER)
|
||||||
|
|
||||||
|
@ -71,7 +76,7 @@ ENDIF(CMAKE_CXX_COMPILER)
|
||||||
IF(NOT CMAKE_MODULE_EXISTS)
|
IF(NOT CMAKE_MODULE_EXISTS)
|
||||||
SET(CMAKE_SHARED_MODULE_C_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS)
|
SET(CMAKE_SHARED_MODULE_C_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS)
|
||||||
SET(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
|
SET(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
|
||||||
SET(CMAKE_SHARED_MODULE_CREATE_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_FLAGS})
|
SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
|
||||||
SET(CMAKE_SHARED_MODULE_PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX})
|
SET(CMAKE_SHARED_MODULE_PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX})
|
||||||
SET(CMAKE_SHARED_MODULE_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
|
SET(CMAKE_SHARED_MODULE_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||||
SET(CMAKE_SHARED_MODULE_LINK_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_FLAGS})
|
SET(CMAKE_SHARED_MODULE_LINK_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_FLAGS})
|
||||||
|
@ -79,6 +84,28 @@ IF(NOT CMAKE_MODULE_EXISTS)
|
||||||
SET(CMAKE_SHARED_MODULE_RUNTIME_FLAG_SEP ${CMAKE_SHARED_MODULE_RUNTIME_FLAG_SEP})
|
SET(CMAKE_SHARED_MODULE_RUNTIME_FLAG_SEP ${CMAKE_SHARED_MODULE_RUNTIME_FLAG_SEP})
|
||||||
ENDIF(NOT CMAKE_MODULE_EXISTS)
|
ENDIF(NOT CMAKE_MODULE_EXISTS)
|
||||||
|
|
||||||
|
|
||||||
|
IF(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS)
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
|
||||||
|
ENDIF(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS)
|
||||||
|
|
||||||
|
IF(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS)
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
|
||||||
|
ENDIF(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS)
|
||||||
|
|
||||||
|
IF(NOT CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_FLAGS})
|
||||||
|
ENDIF(NOT CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
|
||||||
|
|
||||||
|
IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG)
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_FLAG})
|
||||||
|
ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG)
|
||||||
|
|
||||||
|
IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP)
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP})
|
||||||
|
ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP)
|
||||||
|
|
||||||
|
|
||||||
# include default rules that work for most unix like systems and compilers
|
# include default rules that work for most unix like systems and compilers
|
||||||
# this file will not set anything if it is already set
|
# this file will not set anything if it is already set
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/CMakeDefaultMakeRuleVariables.cmake)
|
INCLUDE(${CMAKE_ROOT}/Modules/CMakeDefaultMakeRuleVariables.cmake)
|
||||||
|
@ -86,3 +113,19 @@ INCLUDE(${CMAKE_ROOT}/Modules/CMakeDefaultMakeRuleVariables.cmake)
|
||||||
IF(CMAKE_USER_MAKE_RULES_OVERRIDE)
|
IF(CMAKE_USER_MAKE_RULES_OVERRIDE)
|
||||||
INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE})
|
INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE})
|
||||||
ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE)
|
ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE)
|
||||||
|
|
||||||
|
FIND_PROGRAM(CMAKE_MAKE_PROGRAM NAMES nmake gmake make )
|
||||||
|
|
||||||
|
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.")
|
||||||
|
# default build type is none
|
||||||
|
SET (CMAKE_BUILD_TYPE "" CACHE STRING
|
||||||
|
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
|
||||||
|
MARK_AS_ADVANCED(
|
||||||
|
CMAKE_VERBOSE_MAKEFILE
|
||||||
|
CMAKE_CXX_FLAGS
|
||||||
|
CMAKE_CXX_FLAGS_RELEASE
|
||||||
|
CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
||||||
|
CMAKE_CXX_FLAGS_MINSIZEREL
|
||||||
|
CMAKE_CXX_FLAGS_DEBUG
|
||||||
|
CMAKE_C_FLAGS
|
||||||
|
)
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
SET(CMAKE_SHARED_LIBRARY_CREATE_FLAGS "-shared")
|
|
||||||
SET(CMAKE_DL_LIBS "-lgdi32" )
|
|
||||||
SET(CMAKE_SHARED_LIBRARY_PREFIX "")
|
|
||||||
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dll")
|
|
||||||
# no pic for gcc on cygwin
|
|
||||||
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "")
|
|
||||||
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "")
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
#include <${CHECK_INCLUDE_FILE_VAR}>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
#
|
||||||
|
# Check if the include file exists.
|
||||||
|
#
|
||||||
|
# CHECK_INCLUDE_FILE - macro which checks the include file exists.
|
||||||
|
# INCLUDE - name of include file
|
||||||
|
# VARIABLE - variable to return result
|
||||||
|
#
|
||||||
|
|
||||||
|
MACRO(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
|
||||||
|
SET(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
|
||||||
|
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
|
||||||
|
${PROJECT_BINARY_DIR}/CMakeTmp/CheckIncludeFile.cxx IMMEDIATE)
|
||||||
|
TRY_COMPILE(${VARIABLE}
|
||||||
|
${PROJECT_BINARY_DIR}
|
||||||
|
${PROJECT_BINARY_DIR}/CMakeTmp/CheckIncludeFile.cxx
|
||||||
|
OUTPUT_VARIABLE OUTPUT)
|
||||||
|
IF(${VARIABLE})
|
||||||
|
SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
|
||||||
|
ELSE(${VARIABLE})
|
||||||
|
SET(${VARIABLE} "" CACHE INTERNAL "Have include ${INCLUDE}")
|
||||||
|
WRITE_FILE(${PROJECT_BINARY_DIR}/CMakeError.log
|
||||||
|
"Determining if the include file ${INCLUDE} "
|
||||||
|
"exists failed with the following output:\n"
|
||||||
|
"${OUTPUT}\n")
|
||||||
|
ENDIF(${VARIABLE})
|
||||||
|
ENDMACRO(CHECK_INCLUDE_FILE_CXX)
|
|
@ -0,0 +1,9 @@
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_SUFFIX "..o") # .so
|
||||||
|
SET(CMAKE_DL_LIBS "-lld")
|
||||||
|
|
||||||
|
IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-G") # -shared
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "-Wl,-brtl") # +s, flag for exe link to use shared lib
|
||||||
|
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
|
@ -0,0 +1,11 @@
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
|
||||||
|
SET(CMAKE_DL_LIBS "-lgdi32" )
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_PREFIX "lib")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dll")
|
||||||
|
# no pic for gcc on cygwin
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "")
|
||||||
|
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake)
|
||||||
|
FIND_PROGRAM(CMAKE_MAKE_PROGRAM NAMES gmake make )
|
||||||
|
SET(CMAKE_BUILD_TOOL ${CMAKE_MAKE_PROGRAM} CACHE INTERNAL
|
||||||
|
"What is the target build tool cmake is generating for.")
|
|
@ -0,0 +1,18 @@
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_PREFIX "lib")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dylib")
|
||||||
|
SET(CMAKE_SHARED_MODULE_SUFFIX ".so")
|
||||||
|
SET(CMAKE_DL_LIBS "")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib")
|
||||||
|
SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -flat_namespace -undefined suppress")
|
||||||
|
|
||||||
|
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
|
||||||
|
"<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
||||||
|
|
||||||
|
SET(CMAKE_C_CREATE_SHARED_LIBRARY
|
||||||
|
"<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
||||||
|
|
||||||
|
SET(CMAKE_CXX_CREATE_SHARED_MODULE
|
||||||
|
"<CMAKE_CXX_COMPILER> <CMAKE_SHARED_MODULE_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
||||||
|
|
||||||
|
SET(CMAKE_C_CREATE_SHARED_MODULE
|
||||||
|
"<CMAKE_C_COMPILER> <CMAKE_SHARED_MODULE_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
|
@ -0,0 +1,8 @@
|
||||||
|
IF(EXISTS /usr/include/dlfcn.h)
|
||||||
|
SET(CMAKE_DL_LIBS "")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") # -shared
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "") # +s, flag for exe link to use shared lib
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "-Wl,-rpath,") # -rpath
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP ":") # : or empty
|
||||||
|
ENDIF(EXISTS /usr/include/dlfcn.h)
|
|
@ -0,0 +1,57 @@
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".sl") # .so
|
||||||
|
SET(CMAKE_DL_LIBS "-ldld")
|
||||||
|
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP ":") # : or empty
|
||||||
|
|
||||||
|
# C compiler
|
||||||
|
IF(CMAKE_COMPILER_IS_GNUCC)
|
||||||
|
# gnu gcc
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-E -Wl,-b") # -shared
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "-Wl,+s") # +s, flag for exe link to use shared lib
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "-Wl,+b") # -rpath
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP ":") # : or empty
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic
|
||||||
|
ELSE(CMAKE_COMPILER_IS_GNUCC)
|
||||||
|
# hp cc
|
||||||
|
SET(CMAKE_ANSI_CFLAGS "-Ae -Aa")
|
||||||
|
# use ld directly to create shared libraries for hp cc
|
||||||
|
SET(CMAKE_C_CREATE_SHARED_LIBRARY
|
||||||
|
"ld <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "+Z") # -pic
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-E -b -L/usr/lib") # -shared
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "+s") # +s, flag for exe link to use shared lib
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "+b") # -rpath
|
||||||
|
ENDIF(CMAKE_COMPILER_IS_GNUCC)
|
||||||
|
|
||||||
|
# CXX compiler
|
||||||
|
IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake)
|
||||||
|
# for gnu C++
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-fPIC") # -pic
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-shared -Wl,-E -Wl,-b") # -shared
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-Wl,+s") # +s, flag for exe link to use shared lib
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-Wl,+b") # -rpath
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-fPIC") # -pic
|
||||||
|
ELSE(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
# for hp aCC
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "+Z") # -pic
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "+Z -Wl,-E -b -L/usr/lib") # -shared
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-Wl,+s") # +s, flag for exe link to use shared lib
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-Wl,+b") # -rpath
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-fPIC") # -pic
|
||||||
|
|
||||||
|
SET (CMAKE_CXX_FLAGS "" CACHE STRING
|
||||||
|
"Flags used by the compiler during all build types.")
|
||||||
|
SET (CMAKE_CXX_FLAGS_DEBUG "-g" CACHE STRING
|
||||||
|
"Flags used by the compiler during debug builds.")
|
||||||
|
SET (CMAKE_CXX_FLAGS_MINSIZEREL "-O3" CACHE STRING
|
||||||
|
"Flags used by the compiler during release minsize builds.")
|
||||||
|
SET (CMAKE_CXX_FLAGS_RELEASE "-O2" CACHE STRING
|
||||||
|
"Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
|
||||||
|
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g" CACHE STRING
|
||||||
|
"Flags used by the compiler during Release with Debug Info builds.")
|
||||||
|
SET (CMAKE_C_FLAGS "" CACHE STRING
|
||||||
|
"Flags for C compiler.")
|
||||||
|
|
||||||
|
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
|
@ -0,0 +1,29 @@
|
||||||
|
SET(CMAKE_DL_LIBS "")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -rdata_shared")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-shared -rdata_shared")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "-Wl,-rpath,") # -rpath
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP "") # : or empty
|
||||||
|
IF(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
SET(CMAKE_CXX_CREATE_STATIC_LIBRARY
|
||||||
|
"<CMAKE_CXX_COMPILER> -ar -o <TARGET> <OBJECTS>")
|
||||||
|
SET (CMAKE_CXX_FLAGS "" CACHE STRING
|
||||||
|
"Flags used by the compiler during all build types.")
|
||||||
|
|
||||||
|
SET (CMAKE_CXX_FLAGS_DEBUG "-g" CACHE STRING
|
||||||
|
"Flags used by the compiler during debug builds.")
|
||||||
|
|
||||||
|
SET (CMAKE_CXX_FLAGS_MINSIZEREL "-O3" CACHE STRING
|
||||||
|
"Flags used by the compiler during release minsize builds.")
|
||||||
|
|
||||||
|
SET (CMAKE_CXX_FLAGS_RELEASE "-O2" CACHE STRING
|
||||||
|
"Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
|
||||||
|
|
||||||
|
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2" CACHE STRING
|
||||||
|
"Flags used by the compiler during Release with Debug Info builds.")
|
||||||
|
|
||||||
|
SET (CMAKE_C_FLAGS "" CACHE STRING
|
||||||
|
"Flags for C compiler.")
|
||||||
|
ELSE(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake)
|
||||||
|
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
SET(CMAKE_DL_LIBS "")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -rdata_shared")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-shared -rdata_shared")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "-Wl,-rpath,") # -rpath
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP "") # : or empty
|
||||||
|
IF(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
SET(CMAKE_CXX_CREATE_STATIC_LIBRARY
|
||||||
|
"<CMAKE_CXX_COMPILER> -ar -o <TARGET> <OBJECTS>")
|
||||||
|
SET(CMAKE_ANSI_CXXFLAGS -LANG:std)
|
||||||
|
SET (CMAKE_CXX_FLAGS "" CACHE STRING
|
||||||
|
"Flags used by the compiler during all build types.")
|
||||||
|
|
||||||
|
SET (CMAKE_CXX_FLAGS_DEBUG "-g" CACHE STRING
|
||||||
|
"Flags used by the compiler during debug builds.")
|
||||||
|
|
||||||
|
SET (CMAKE_CXX_FLAGS_MINSIZEREL "-O3" CACHE STRING
|
||||||
|
"Flags used by the compiler during release minsize builds.")
|
||||||
|
|
||||||
|
SET (CMAKE_CXX_FLAGS_RELEASE "-O2" CACHE STRING
|
||||||
|
"Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
|
||||||
|
|
||||||
|
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2" CACHE STRING
|
||||||
|
"Flags used by the compiler during Release with Debug Info builds.")
|
||||||
|
|
||||||
|
|
||||||
|
SET (CMAKE_C_FLAGS "" CACHE STRING
|
||||||
|
"Flags for C compiler.")
|
||||||
|
ELSE(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake)
|
||||||
|
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
SET(CMAKE_DL_LIBS "-ldl")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "-rdynamic")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "-Wl,-rpath,")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP ":")
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
IF(CMAKE_SYSTEM MATCHES "MP-RAS-02*.")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
|
||||||
|
ELSE(CMAKE_SYSTEM MATCHES "MP-RAS-02*.")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "-Wl,-Bexport")
|
||||||
|
ENDIF(CMAKE_SYSTEM MATCHES "MP-RAS-02*.")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
IF(EXISTS /usr/include/dlfcn.h)
|
||||||
|
SET(CMAKE_DL_LIBS "")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") # -shared
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "") # +s, flag for exe link to use shared lib
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "-Wl,-rpath,") # -rpath
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP ":") # : or empty
|
||||||
|
ENDIF(EXISTS /usr/include/dlfcn.h)
|
|
@ -0,0 +1,26 @@
|
||||||
|
SET(CMAKE_DL_LIBS "")
|
||||||
|
|
||||||
|
IF(CMAKE_SYSTEM MATCHES "OSF1-1.[012]")
|
||||||
|
ENDIF(CMAKE_SYSTEM MATCHES "OSF1-1.[012]")
|
||||||
|
IF(CMAKE_SYSTEM MATCHES "OSF1-1.*")
|
||||||
|
# OSF/1 1.3 from OSF using ELF, and derivatives, including AD2
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fpic") # -pic
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-fpic") # -pic
|
||||||
|
ENDIF(CMAKE_SYSTEM MATCHES "OSF1-1.*")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
IF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-expect_unresolved,\\*") # -shared
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-shared -Wl,-expect_unresolved,\\*") # -shared
|
||||||
|
IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "-Wl,-rpath,")
|
||||||
|
ELSE(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "-rpath,")
|
||||||
|
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP ":")
|
||||||
|
ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
|
||||||
|
|
||||||
|
IF(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
SET(CMAKE_ANSI_CXXFLAGS "-std strict_ansi -nopure_cname")
|
||||||
|
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
|
|
@ -0,0 +1,4 @@
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-G 0")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_SUFFIX "..o")
|
||||||
|
SET(CMAKE_DL_LIBS "")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "-Wl,-D,08000000")
|
|
@ -0,0 +1,4 @@
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-Kpic -belf")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-Kpic -belf")
|
||||||
|
SET(CMAKE_DL_LIBS "")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-belf -Wl,-Bexport")
|
|
@ -0,0 +1 @@
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
|
|
@ -0,0 +1,25 @@
|
||||||
|
IF(CMAKE_SYSTEM MATCHES "SunOS-4.*")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-PIC")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-r -nostdlib")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "-Wl,-R,")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP ":")
|
||||||
|
ENDIF(CMAKE_SYSTEM MATCHES "SunOS-4.*")
|
||||||
|
|
||||||
|
IF(CMAKE_SYSTEM MATCHES "SunOS-5*.")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-KPIC")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-G")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "-R,")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP ":")
|
||||||
|
IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -nostdlib")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "-Wl,-R,")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP ":")
|
||||||
|
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
ENDIF(CMAKE_SYSTEM MATCHES "SunOS-5*.")
|
||||||
|
|
||||||
|
IF(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
SET(CMAKE_CXX_CREATE_STATIC_LIBRARY
|
||||||
|
"<CMAKE_CXX_COMPILER> -xar -o <TARGET> <OBJECTS> "
|
||||||
|
"<CMAKE_RANLIB> <TARGET> ")
|
||||||
|
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-G 0")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_SUFFIX "..o")
|
||||||
|
SET(CMAKE_DL_LIBS "")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "-Wl,-D,08000000")
|
|
@ -0,0 +1,2 @@
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "-Wl,-Bexport")
|
|
@ -0,0 +1,2 @@
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-Wl,-Bexport")
|
|
@ -0,0 +1,78 @@
|
||||||
|
SET(CMAKE_LIBRARY_PATH_FLAG "-L")
|
||||||
|
SET(CMAKE_LINK_LIBRARY_FLAG "")
|
||||||
|
|
||||||
|
# create a shared C++ library
|
||||||
|
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
|
||||||
|
"<CMAKE_CXX_COMPILER> @&&|\n-e<TARGET> -tWD <OBJECTS> <LINK_LIBRARIES>\n|"
|
||||||
|
"implib @&&|\n-w <TARGET_BASE>.lib <TARGET_BASE>.dll\n|"
|
||||||
|
)
|
||||||
|
|
||||||
|
SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
|
||||||
|
|
||||||
|
# create a C shared library
|
||||||
|
SET(CMAKE_C_CREATE_SHARED_LIBRARY
|
||||||
|
"<CMAKE_CXX_COMPILER> @&&|\n-e<TARGET> -tWD <OBJECTS> <LINK_LIBRARIES>\n|"
|
||||||
|
"implib @&&|\n-w <TARGET_BASE>.lib <TARGET_BASE>.dll\n|"
|
||||||
|
)
|
||||||
|
|
||||||
|
# create a C shared module just copy the shared library rule
|
||||||
|
SET(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY})
|
||||||
|
|
||||||
|
|
||||||
|
# create a C++ static library
|
||||||
|
SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "tlib @&&|\n/p512 /a <TARGET> <OBJECTS_QUOTED>\n|")
|
||||||
|
|
||||||
|
# create a C static library
|
||||||
|
SET(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY})
|
||||||
|
|
||||||
|
# compile a C++ file into an object file
|
||||||
|
SET(CMAKE_CXX_COMPILE_OBJECT
|
||||||
|
"<CMAKE_CXX_COMPILER> @&&|\n-DWIN32 -o<OBJECT> <FLAGS> -c <SOURCE>\n|")
|
||||||
|
|
||||||
|
# compile a C file into an object file
|
||||||
|
SET(CMAKE_C_COMPILE_OBJECT
|
||||||
|
"<CMAKE_C_COMPILER> @&&|\n-DWIN32 -o<OBJECT> <FLAGS> -c <SOURCE>\n|")
|
||||||
|
|
||||||
|
|
||||||
|
SET(CMAKE_C_LINK_EXECUTABLE
|
||||||
|
"<CMAKE_C_COMPILER> @&&|\n-e<TARGET> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_LIBRARIES> <OBJECTS> \n|")
|
||||||
|
|
||||||
|
|
||||||
|
SET(CMAKE_CXX_LINK_EXECUTABLE
|
||||||
|
"<CMAKE_CXX_COMPILER> @&&|\n -e<TARGET> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_LIBRARIES> <OBJECTS> \n|")
|
||||||
|
|
||||||
|
SET (CMAKE_BUILD_TYPE Debug CACHE STRING
|
||||||
|
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel.")
|
||||||
|
|
||||||
|
# extra flags for a win32 exe
|
||||||
|
SET(CMAKE_CREATE_WIN32_EXE -tW -tWM )
|
||||||
|
# extra flags for a console app
|
||||||
|
SET(CMAKE_CREATE_CONSOLE_EXE -tWC )
|
||||||
|
|
||||||
|
SET (CMAKE_CXX_FLAGS "-w- -whid -waus -wpar -tWM -P" CACHE STRING
|
||||||
|
"Flags used to compile c++ files.")
|
||||||
|
|
||||||
|
SET (CMAKE_CXX_FLAGS_DEBUG "-Od -v" CACHE STRING
|
||||||
|
"Flags used by the compiler during debug builds.")
|
||||||
|
|
||||||
|
SET (CMAKE_CXX_FLAGS_MINSIZEREL "-O1" CACHE STRING
|
||||||
|
"Flags used by the compiler during release minsize builds.")
|
||||||
|
|
||||||
|
SET (CMAKE_CXX_FLAGS_RELEASE "-O2" CACHE STRING
|
||||||
|
"Release flags.")
|
||||||
|
|
||||||
|
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Od" CACHE STRING
|
||||||
|
"Flags used by the compiler during Release with Debug Info builds.")
|
||||||
|
|
||||||
|
|
||||||
|
SET (CMAKE_C_FLAGS "-w- -whid -waus -tWM" CACHE STRING
|
||||||
|
"Flags for C compiler.")
|
||||||
|
|
||||||
|
SET (CMAKE_STANDARD_LIBRARIES "import32.lib" CACHE STRING
|
||||||
|
"Libraries linked by defalut with all applications.")
|
||||||
|
|
||||||
|
FIND_PROGRAM(CMAKE_MAKE_PROGRAM NAMES make )
|
||||||
|
SET(CMAKE_BUILD_TOOL ${CMAKE_MAKE_PROGRAM} CACHE INTERNAL
|
||||||
|
"What is the target build tool cmake is generating for.")
|
||||||
|
MARK_AS_ADVANCED(CMAKE_STANDARD_LIBRARIES CMAKE_MAKE_PROGRAM)
|
||||||
|
|
|
@ -0,0 +1,70 @@
|
||||||
|
SET(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:")
|
||||||
|
SET(CMAKE_LINK_LIBRARY_FLAG "")
|
||||||
|
|
||||||
|
# create a shared C++ library
|
||||||
|
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
|
||||||
|
"link @<<\n /out:<TARGET> /dll <OBJECTS> <LINK_LIBRARIES> \n<<")
|
||||||
|
|
||||||
|
SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
|
||||||
|
|
||||||
|
# create a C shared library
|
||||||
|
SET(CMAKE_C_CREATE_SHARED_LIBRARY ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
|
||||||
|
|
||||||
|
# create a C shared module just copy the shared library rule
|
||||||
|
SET(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY})
|
||||||
|
|
||||||
|
|
||||||
|
# create a C++ static library
|
||||||
|
SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "lib /nologo /out:<TARGET> <OBJECTS> ")
|
||||||
|
|
||||||
|
# create a C static library
|
||||||
|
SET(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY})
|
||||||
|
|
||||||
|
# compile a C++ file into an object file
|
||||||
|
SET(CMAKE_CXX_COMPILE_OBJECT
|
||||||
|
"<CMAKE_CXX_COMPILER> @<<\n -DWIN32 /Fo<OBJECT> <FLAGS> -c <SOURCE>\n<<")
|
||||||
|
|
||||||
|
# compile a C file into an object file
|
||||||
|
SET(CMAKE_C_COMPILE_OBJECT
|
||||||
|
"<CMAKE_C_COMPILER> @<<\n -DWIN32 /Fo<OBJECT> <FLAGS> -c <SOURCE>\n<<")
|
||||||
|
|
||||||
|
|
||||||
|
SET(CMAKE_C_LINK_EXECUTABLE
|
||||||
|
"<CMAKE_C_COMPILER> @<<\n <CMAKE_C_LINK_FLAGS> <FLAGS> <OBJECTS> /Fe<TARGET> -link <LINK_FLAGS> <LINK_LIBRARIES>\n<<")
|
||||||
|
|
||||||
|
SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
|
||||||
|
|
||||||
|
SET(CMAKE_CXX_LINK_EXECUTABLE
|
||||||
|
"<CMAKE_CXX_COMPILER> @<<\n <CMAKE_CXX_LINK_FLAGS> <FLAGS> <OBJECTS> /Fe<TARGET> -link <LINK_FLAGS> <LINK_LIBRARIES>\n<<")
|
||||||
|
|
||||||
|
SET (CMAKE_BUILD_TYPE Debug CACHE STRING
|
||||||
|
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel.")
|
||||||
|
|
||||||
|
SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows)
|
||||||
|
|
||||||
|
SET (CMAKE_CXX_FLAGS "/nologo /W3 /Zm1000 /GX /GR" CACHE STRING
|
||||||
|
"Flags used by the compiler during all build types, /GX /GR are for exceptions and rtti in VC++, /Zm1000 increases the compiler's memory allocation to support ANSI C++/stdlib.")
|
||||||
|
|
||||||
|
SET (CMAKE_CXX_FLAGS_DEBUG "/MDd /Zi /Od /GZ" CACHE STRING
|
||||||
|
"Flags used by the compiler during debug builds.")
|
||||||
|
|
||||||
|
SET (CMAKE_CXX_FLAGS_MINSIZEREL "/MD /O1" CACHE STRING
|
||||||
|
"Flags used by the compiler during release minsize builds.")
|
||||||
|
|
||||||
|
SET (CMAKE_CXX_FLAGS_RELEASE "/MD /O2" CACHE STRING
|
||||||
|
"Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
|
||||||
|
|
||||||
|
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /Zi /O2" CACHE STRING
|
||||||
|
"Flags used by the compiler during Release with Debug Info builds.")
|
||||||
|
|
||||||
|
|
||||||
|
SET (CMAKE_C_FLAGS "/nologo /W3 /Zm1000" CACHE STRING
|
||||||
|
"Flags for C compiler.")
|
||||||
|
|
||||||
|
SET (CMAKE_STANDARD_LIBRARIES "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib" CACHE STRING
|
||||||
|
"Libraries linked by defalut with all applications.")
|
||||||
|
MARK_AS_ADVANCED(CMAKE_STANDARD_LIBRARIES)
|
||||||
|
|
||||||
|
FIND_PROGRAM(CMAKE_MAKE_PROGRAM NAMES nmake )
|
||||||
|
SET(CMAKE_BUILD_TOOL ${CMAKE_MAKE_PROGRAM} CACHE INTERNAL
|
||||||
|
"What is the target build tool cmake is generating for.")
|
|
@ -0,0 +1,6 @@
|
||||||
|
SET(CMAKE_STATIC_LIBRARY_PREFIX "")
|
||||||
|
SET(CMAKE_STATIC_LIBRARY_SUFFIX ".lib")
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_PREFIX "") # lib
|
||||||
|
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dll") # .so
|
||||||
|
SET(CMAKE_LINK_LIBRARY_SUFFIX ".lib")
|
||||||
|
SET(CMAKE_DL_LIBS "")
|
|
@ -0,0 +1,18 @@
|
||||||
|
SET (CMAKE_CXX_FLAGS "" CACHE STRING
|
||||||
|
"Flags used by the compiler during all build types.")
|
||||||
|
|
||||||
|
SET (CMAKE_CXX_FLAGS_DEBUG "-g" CACHE STRING
|
||||||
|
"Flags used by the compiler during debug builds.")
|
||||||
|
|
||||||
|
SET (CMAKE_CXX_FLAGS_MINSIZEREL "-O3" CACHE STRING
|
||||||
|
"Flags used by the compiler during release minsize builds.")
|
||||||
|
|
||||||
|
SET (CMAKE_CXX_FLAGS_RELEASE "-O2" CACHE STRING
|
||||||
|
"Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
|
||||||
|
|
||||||
|
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g" CACHE STRING
|
||||||
|
"Flags used by the compiler during Release with Debug Info builds.")
|
||||||
|
|
||||||
|
|
||||||
|
SET (CMAKE_C_FLAGS "" CACHE STRING
|
||||||
|
"Flags for C compiler.")
|
|
@ -0,0 +1,19 @@
|
||||||
|
#
|
||||||
|
# check if the compiler supports std:: on stl classes
|
||||||
|
#
|
||||||
|
# CMAKE_NO_STD_NAMESPACE - defined accoreding to the results
|
||||||
|
#
|
||||||
|
|
||||||
|
TRY_COMPILE(CMAKE_ANSI_FOR_SCOPE ${PROJECT_BINARY_DIR}
|
||||||
|
${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx)
|
||||||
|
IF (CMAKE_ANSI_FOR_SCOPE)
|
||||||
|
SET (CMAKE_NO_ANSI_FOR_SCOPE 0 CACHE INTERNAL
|
||||||
|
"Does the compiler support ansi for scope.")
|
||||||
|
ELSE (CMAKE_ANSI_FOR_SCOPE)
|
||||||
|
SET (CMAKE_NO_ANSI_FOR_SCOPE 1 CACHE INTERNAL
|
||||||
|
"Does the compiler support ansi for scope.")
|
||||||
|
ENDIF (CMAKE_ANSI_FOR_SCOPE)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
int main(int, char*[])
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for(int i=0; i < 1; ++i) ;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
#
|
||||||
|
# check if the compiler supports std:: on stl classes
|
||||||
|
#
|
||||||
|
# CMAKE_NO_STD_NAMESPACE - defined accoreding to the results
|
||||||
|
#
|
||||||
|
|
||||||
|
TRY_COMPILE(CMAKE_STD_NAMESPACE ${PROJECT_BINARY_DIR}
|
||||||
|
${CMAKE_ROOT}/Modules/TestForSTDNamespace.cxx)
|
||||||
|
IF (CMAKE_STD_NAMESPACE)
|
||||||
|
SET (CMAKE_NO_STD_NAMESPACE 0 CACHE INTERNAL
|
||||||
|
"Does the compiler support std::.")
|
||||||
|
ELSE (CMAKE_STD_NAMESPACE)
|
||||||
|
SET (CMAKE_NO_STD_NAMESPACE 1 CACHE INTERNAL
|
||||||
|
"Does the compiler support std::.")
|
||||||
|
ENDIF (CMAKE_STD_NAMESPACE)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
#include <list>
|
||||||
|
int main(int, char*[])
|
||||||
|
{
|
||||||
|
std::list<int>();
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -1,4 +0,0 @@
|
||||||
SET(CMAKE_SHARED_LIBRARY_CREATE_FLAGS "")
|
|
||||||
SET(CMAKE_DL_LIBS "" )
|
|
||||||
SET(CMAKE_SHARED_LIBRARY_PREFIX "")
|
|
||||||
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dll")
|
|
|
@ -61,9 +61,7 @@ IF (WIN32)
|
||||||
IF(NOT UNIX)
|
IF(NOT UNIX)
|
||||||
SET(SRCS ${SRCS}
|
SET(SRCS ${SRCS}
|
||||||
cmGlobalBorlandMakefileGenerator.cxx
|
cmGlobalBorlandMakefileGenerator.cxx
|
||||||
cmLocalBorlandMakefileGenerator.cxx
|
|
||||||
cmGlobalNMakeMakefileGenerator.cxx
|
cmGlobalNMakeMakefileGenerator.cxx
|
||||||
cmLocalNMakeMakefileGenerator.cxx
|
|
||||||
cmGlobalVisualStudio6Generator.cxx
|
cmGlobalVisualStudio6Generator.cxx
|
||||||
cmLocalVisualStudio6Generator.cxx
|
cmLocalVisualStudio6Generator.cxx
|
||||||
cmGlobalVisualStudio7Generator.cxx
|
cmGlobalVisualStudio7Generator.cxx
|
||||||
|
|
|
@ -122,6 +122,7 @@ CMakeSetupDialog::CMakeSetupDialog(const CMakeCommandLineInfo& cmdInfo,
|
||||||
CWnd* pParent /*=NULL*/)
|
CWnd* pParent /*=NULL*/)
|
||||||
: CDialog(CMakeSetupDialog::IDD, pParent)
|
: CDialog(CMakeSetupDialog::IDD, pParent)
|
||||||
{
|
{
|
||||||
|
cmSystemTools::SetRunCommandHideConsole(true);
|
||||||
cmSystemTools::SetErrorCallback(MFCMessageCallback);
|
cmSystemTools::SetErrorCallback(MFCMessageCallback);
|
||||||
m_RegistryKey = "Software\\Kitware\\CMakeSetup\\Settings\\StartPath";
|
m_RegistryKey = "Software\\Kitware\\CMakeSetup\\Settings\\StartPath";
|
||||||
m_CacheEntriesList.m_CMakeSetupDialog = this;
|
m_CacheEntriesList.m_CMakeSetupDialog = this;
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
Variables:
|
||||||
|
|
||||||
|
CMAKE_SYSTEM
|
||||||
|
|
||||||
|
CMAKE_BUILD_TOOL borlandmake make nmake msdev devenv
|
||||||
|
CMAKE_MAKE_PROGRAM make nmake msdev devenv *** HAS TO BE IN CACHE for try compile to work
|
||||||
|
CMAKE_BUILD_TYPE Debug Release RelWithDebInfo MinSizeRel
|
||||||
|
BUILD_COMMAND needs to be removed
|
||||||
|
|
||||||
|
CMAKE_ANSI_CFLAGS
|
||||||
|
CMAKE_ANSI_CXXFLAGS
|
||||||
|
CMAKE_NO_ANSI_STRING_STREAM
|
||||||
|
CMAKE_NO_STD_NAMESPACE
|
||||||
|
CMAKE_NO_ANSI_FOR_SCOPE
|
||||||
|
CMAKE_COMPILER_IS_GNUCXX
|
||||||
|
CMAKE_NO_EXPLICIT_TEMPLATE_INSTANTIATION
|
||||||
|
|
||||||
|
|
||||||
|
CMAKE_CXX_FLAGS
|
||||||
|
CMAKE_CXX_FLAGS_DEBUG
|
||||||
|
CMAKE_CXX_FLAGS_MINSIZEREL
|
||||||
|
CMAKE_CXX_FLAGS_RELEASE
|
||||||
|
CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
||||||
|
|
||||||
|
CMAKE_C_FLAGS
|
||||||
|
CMAKE_C_FLAGS_DEBUG
|
||||||
|
CMAKE_C_FLAGS_MINSIZEREL
|
||||||
|
CMAKE_C_FLAGS_RELEASE
|
||||||
|
CMAKE_C_FLAGS_RELWITHDEBINFO
|
||||||
|
|
||||||
|
CMAKE_CXX_LINK_DEBUG_FLAGS
|
||||||
|
CMAKE_CXX_LINK_RELEASE_FLAGS
|
||||||
|
CMAKE_CXX_LINK_RELWITHDEBINFO_FLAGS
|
||||||
|
CMAKE_CXX_LINK_MINSIZEREL_FLAGS
|
||||||
|
|
||||||
|
CMAKE_C_LINK_DEBUG_FLAGS
|
||||||
|
CMAKE_C_LINK_RELEASE_FLAGS
|
||||||
|
CMAKE_C_LINK_RELWITHDEBINFO_FLAGS
|
||||||
|
CMAKE_C_LINK_MINSIZEREL_FLAGS
|
||||||
|
|
||||||
|
|
||||||
|
CMAKE_USE_WIN32_THREADS
|
||||||
|
CMAKE_USE_SPROC
|
||||||
|
CMAKE_USE_PTHREADS
|
||||||
|
CMAKE_HP_PTHREADS
|
||||||
|
CMAKE_THREAD_LIBS
|
||||||
|
CMAKE_DL_LIBS
|
||||||
|
|
||||||
|
CMAKE_X_LIBS
|
||||||
|
CMAKE_X_CFLAGS
|
||||||
|
CMAKE_HAS_X
|
||||||
|
|
|
@ -118,6 +118,15 @@ bool cmExecProgramCommand::InitialPass(std::vector<std::string> const& args)
|
||||||
{
|
{
|
||||||
std::string::size_type first = output.find_first_not_of(" \n\t\r");
|
std::string::size_type first = output.find_first_not_of(" \n\t\r");
|
||||||
std::string::size_type last = output.find_last_not_of(" \n\t\r");
|
std::string::size_type last = output.find_last_not_of(" \n\t\r");
|
||||||
|
if(first == std::string::npos)
|
||||||
|
{
|
||||||
|
first = 0;
|
||||||
|
}
|
||||||
|
if(last == std::string::npos)
|
||||||
|
{
|
||||||
|
last = output.size()-1;
|
||||||
|
}
|
||||||
|
|
||||||
std::string coutput = std::string(output, first, last-first+1);
|
std::string coutput = std::string(output, first, last-first+1);
|
||||||
m_Makefile->AddDefinition(output_variable.c_str(), coutput.c_str());
|
m_Makefile->AddDefinition(output_variable.c_str(), coutput.c_str());
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,11 +15,11 @@
|
||||||
|
|
||||||
=========================================================================*/
|
=========================================================================*/
|
||||||
#include "cmGlobalBorlandMakefileGenerator.h"
|
#include "cmGlobalBorlandMakefileGenerator.h"
|
||||||
#include "cmLocalBorlandMakefileGenerator.h"
|
#include "cmLocalUnixMakefileGenerator.h"
|
||||||
#include "cmMakefile.h"
|
#include "cmMakefile.h"
|
||||||
#include "cmake.h"
|
#include "cmake.h"
|
||||||
|
|
||||||
void cmGlobalBorlandMakefileGenerator::EnableLanguage(const char*,
|
void cmGlobalBorlandMakefileGenerator::EnableLanguage(const char* l,
|
||||||
cmMakefile *mf)
|
cmMakefile *mf)
|
||||||
{
|
{
|
||||||
// now load the settings
|
// now load the settings
|
||||||
|
@ -37,20 +37,21 @@ void cmGlobalBorlandMakefileGenerator::EnableLanguage(const char*,
|
||||||
message += outdir;
|
message += outdir;
|
||||||
cmSystemTools::Error(message.c_str());
|
cmSystemTools::Error(message.c_str());
|
||||||
}
|
}
|
||||||
if(!this->GetLanguageEnabled("CXX"))
|
mf->AddDefinition("BORLAND", "1");
|
||||||
{
|
mf->AddDefinition("CMAKE_GENERATOR_CC", "bcc32");
|
||||||
std::string fpath =
|
mf->AddDefinition("CMAKE_GENERATOR_CXX", "bcc32");
|
||||||
mf->GetDefinition("CMAKE_ROOT");
|
|
||||||
fpath += "/Templates/CMakeBorlandWindowsSystemConfig.cmake";
|
this->cmGlobalUnixMakefileGenerator::EnableLanguage(l, mf);
|
||||||
mf->ReadListFile(NULL,fpath.c_str());
|
|
||||||
this->SetLanguageEnabled("CXX");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///! Create a local generator appropriate to this Global Generator
|
///! Create a local generator appropriate to this Global Generator
|
||||||
cmLocalGenerator *cmGlobalBorlandMakefileGenerator::CreateLocalGenerator()
|
cmLocalGenerator *cmGlobalBorlandMakefileGenerator::CreateLocalGenerator()
|
||||||
{
|
{
|
||||||
cmLocalGenerator *lg = new cmLocalBorlandMakefileGenerator;
|
cmLocalUnixMakefileGenerator *lg = new cmLocalUnixMakefileGenerator;
|
||||||
|
lg->SetIncludeDirective("!include");
|
||||||
|
lg->SetWindowsShell(true);
|
||||||
|
lg->SetMakefileVariableSize(32);
|
||||||
|
|
||||||
lg->SetGlobalGenerator(this);
|
lg->SetGlobalGenerator(this);
|
||||||
return lg;
|
return lg;
|
||||||
}
|
}
|
||||||
|
|
|
@ -213,8 +213,7 @@ cmLocalGenerator *cmGlobalGenerator::CreateLocalGenerator()
|
||||||
return lg;
|
return lg;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmGlobalGenerator::EnableLanguagesFromGenerator(cmGlobalGenerator *gen,
|
void cmGlobalGenerator::EnableLanguagesFromGenerator(cmGlobalGenerator *gen )
|
||||||
cmMakefile *)
|
|
||||||
{
|
{
|
||||||
// create a temp generator
|
// create a temp generator
|
||||||
cmLocalGenerator *lg = this->CreateLocalGenerator();
|
cmLocalGenerator *lg = this->CreateLocalGenerator();
|
||||||
|
|
|
@ -79,8 +79,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Try to determine system infomation, get it from another generator
|
* Try to determine system infomation, get it from another generator
|
||||||
*/
|
*/
|
||||||
virtual void EnableLanguagesFromGenerator(cmGlobalGenerator *gen,
|
virtual void EnableLanguagesFromGenerator(cmGlobalGenerator *gen);
|
||||||
cmMakefile *mf);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Try running cmake and building a file. This is used for dynalically
|
* Try running cmake and building a file. This is used for dynalically
|
||||||
|
@ -98,7 +97,9 @@ public:
|
||||||
cmake *GetCMakeInstance() {
|
cmake *GetCMakeInstance() {
|
||||||
return this->m_CMakeInstance; };
|
return this->m_CMakeInstance; };
|
||||||
|
|
||||||
|
void SetConfiguredFilesPath(const char* s){m_ConfiguredFilesPath = s;}
|
||||||
protected:
|
protected:
|
||||||
|
cmStdString m_ConfiguredFilesPath;
|
||||||
cmake *m_CMakeInstance;
|
cmake *m_CMakeInstance;
|
||||||
std::vector<cmLocalGenerator *> m_LocalGenerators;
|
std::vector<cmLocalGenerator *> m_LocalGenerators;
|
||||||
|
|
||||||
|
|
|
@ -15,33 +15,25 @@
|
||||||
|
|
||||||
=========================================================================*/
|
=========================================================================*/
|
||||||
#include "cmGlobalNMakeMakefileGenerator.h"
|
#include "cmGlobalNMakeMakefileGenerator.h"
|
||||||
#include "cmLocalNMakeMakefileGenerator.h"
|
#include "cmLocalUnixMakefileGenerator.h"
|
||||||
#include "cmMakefile.h"
|
#include "cmMakefile.h"
|
||||||
|
|
||||||
void cmGlobalNMakeMakefileGenerator::EnableLanguage(const char*,
|
void cmGlobalNMakeMakefileGenerator::EnableLanguage(const char* l,
|
||||||
cmMakefile *mf)
|
cmMakefile *mf)
|
||||||
{
|
{
|
||||||
// now load the settings
|
// pick a default
|
||||||
if(!mf->GetDefinition("CMAKE_ROOT"))
|
mf->AddDefinition("CMAKE_GENERATOR_CC", "cl");
|
||||||
{
|
mf->AddDefinition("CMAKE_GENERATOR_CXX", "cl");
|
||||||
cmSystemTools::Error(
|
|
||||||
"CMAKE_ROOT has not been defined, bad GUI or driver program");
|
this->cmGlobalUnixMakefileGenerator::EnableLanguage(l, mf);
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(!this->GetLanguageEnabled("CXX"))
|
|
||||||
{
|
|
||||||
std::string fpath =
|
|
||||||
mf->GetDefinition("CMAKE_ROOT");
|
|
||||||
fpath += "/Templates/CMakeNMakeWindowsSystemConfig.cmake";
|
|
||||||
mf->ReadListFile(NULL,fpath.c_str());
|
|
||||||
this->SetLanguageEnabled("CXX");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///! Create a local generator appropriate to this Global Generator
|
///! Create a local generator appropriate to this Global Generator
|
||||||
cmLocalGenerator *cmGlobalNMakeMakefileGenerator::CreateLocalGenerator()
|
cmLocalGenerator *cmGlobalNMakeMakefileGenerator::CreateLocalGenerator()
|
||||||
{
|
{
|
||||||
cmLocalGenerator *lg = new cmLocalNMakeMakefileGenerator;
|
cmLocalUnixMakefileGenerator *lg = new cmLocalUnixMakefileGenerator;
|
||||||
|
lg->SetWindowsShell(true);
|
||||||
|
lg->SetMakeSilentFlag("/nologo");
|
||||||
lg->SetGlobalGenerator(this);
|
lg->SetGlobalGenerator(this);
|
||||||
return lg;
|
return lg;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,15 +41,6 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual void EnableLanguage(const char*,cmMakefile *mf);
|
virtual void EnableLanguage(const char*,cmMakefile *mf);
|
||||||
|
|
||||||
/**
|
|
||||||
* Try to determine system infomation from another generator
|
|
||||||
*/
|
|
||||||
virtual void EnableLanguagesFromGenerator(cmGlobalGenerator *gen,
|
|
||||||
cmMakefile *mf)
|
|
||||||
{
|
|
||||||
this->cmGlobalGenerator::EnableLanguagesFromGenerator(gen,mf);
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -23,47 +23,83 @@
|
||||||
void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang,
|
void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang,
|
||||||
cmMakefile *mf)
|
cmMakefile *mf)
|
||||||
{
|
{
|
||||||
// only do for global runs
|
// if no lang specified use CXX
|
||||||
if (!m_CMakeInstance->GetLocal())
|
if(!lang )
|
||||||
{
|
{
|
||||||
std::string output;
|
lang = "CXX";
|
||||||
std::string root
|
}
|
||||||
= cmSystemTools::ConvertToOutputPath(mf->GetDefinition("CMAKE_ROOT"));
|
std::string root
|
||||||
// if no lang specified use CXX
|
= cmSystemTools::ConvertToOutputPath(mf->GetDefinition("CMAKE_ROOT"));
|
||||||
if(!lang )
|
std::string rootBin = mf->GetHomeOutputDirectory();
|
||||||
|
if(m_ConfiguredFilesPath.size())
|
||||||
|
{
|
||||||
|
rootBin = m_ConfiguredFilesPath;
|
||||||
|
}
|
||||||
|
bool needCBackwards = false;
|
||||||
|
bool needCXXBackwards = false;
|
||||||
|
|
||||||
|
// check for a C compiler and configure it
|
||||||
|
if(!m_CMakeInstance->GetLocal() &&
|
||||||
|
!this->GetLanguageEnabled("C") &&
|
||||||
|
lang[0] == 'C')
|
||||||
|
{
|
||||||
|
if (m_CMakeInstance->GetIsInTryCompile())
|
||||||
{
|
{
|
||||||
lang = "CXX";
|
cmSystemTools::Error("This should not have happen. "
|
||||||
|
"If you see this message, you are probably using a "
|
||||||
|
"broken CMakeLists.txt file or a problematic release of "
|
||||||
|
"CMake");
|
||||||
}
|
}
|
||||||
// if CXX or C, then enable C
|
needCBackwards = true;
|
||||||
if((!this->GetLanguageEnabled("C") && lang[0] == 'C'))
|
// Read the DetermineSystem file
|
||||||
|
std::string systemFile = root;
|
||||||
|
systemFile += "/Modules/CMakeDetermineSystem.cmake";
|
||||||
|
mf->ReadListFile(0, systemFile.c_str());
|
||||||
|
// read determine C compiler
|
||||||
|
std::string determineCFile = root;
|
||||||
|
determineCFile += "/Modules/CMakeDetermineCCompiler.cmake";
|
||||||
|
mf->ReadListFile(0,determineCFile.c_str());
|
||||||
|
this->SetLanguageEnabled("C");
|
||||||
|
}
|
||||||
|
|
||||||
|
// check for a CXX compiler and configure it
|
||||||
|
if(!m_CMakeInstance->GetLocal() &&
|
||||||
|
!this->GetLanguageEnabled("CXX") &&
|
||||||
|
strcmp(lang, "CXX") == 0)
|
||||||
|
{
|
||||||
|
needCXXBackwards = true;
|
||||||
|
std::string determineCFile = root;
|
||||||
|
determineCFile += "/Modules/CMakeDetermineCXXCompiler.cmake";
|
||||||
|
mf->ReadListFile(0,determineCFile.c_str());
|
||||||
|
this->SetLanguageEnabled("CXX");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
std::string fpath = rootBin;
|
||||||
|
fpath += "/CMakeSystem.cmake";
|
||||||
|
mf->ReadListFile(0,fpath.c_str());
|
||||||
|
// if C, then enable C
|
||||||
|
if(lang[0] == 'C')
|
||||||
|
{
|
||||||
|
fpath = rootBin;
|
||||||
|
fpath += "/CMakeCCompiler.cmake";
|
||||||
|
mf->ReadListFile(0,fpath.c_str());
|
||||||
|
}
|
||||||
|
if(strcmp(lang, "CXX") == 0)
|
||||||
|
{
|
||||||
|
fpath = rootBin;
|
||||||
|
fpath += "/CMakeCXXCompiler.cmake";
|
||||||
|
mf->ReadListFile(0,fpath.c_str());
|
||||||
|
}
|
||||||
|
fpath = root;
|
||||||
|
fpath += "/Modules/CMakeSystemSpecificInformation.cmake";
|
||||||
|
mf->ReadListFile(0,fpath.c_str());
|
||||||
|
if(!m_CMakeInstance->GetLocal())
|
||||||
|
{
|
||||||
|
// At this point we should have enough info for a try compile
|
||||||
|
// which is used in the backward stuff
|
||||||
|
if(needCBackwards)
|
||||||
{
|
{
|
||||||
static char envCC[5000];
|
|
||||||
if(mf->GetDefinition("CMAKE_C_COMPILER"))
|
|
||||||
{
|
|
||||||
std::string env = "CC=${CMAKE_C_COMPILER}";
|
|
||||||
mf->ExpandVariablesInString(env);
|
|
||||||
strncpy(envCC, env.c_str(), 4999);
|
|
||||||
envCC[4999] = 0;
|
|
||||||
putenv(envCC);
|
|
||||||
}
|
|
||||||
if (m_CMakeInstance->GetIsInTryCompile())
|
|
||||||
{
|
|
||||||
cmSystemTools::Error("This should not have happen. "
|
|
||||||
"If you see this message, you are probably using a "
|
|
||||||
"broken CMakeLists.txt file or a problematic release of "
|
|
||||||
"CMake");
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string cmd = root;
|
|
||||||
cmd += "/Templates/cconfigure";
|
|
||||||
cmSystemTools::RunCommand(cmd.c_str(), output,
|
|
||||||
cmSystemTools::ConvertToOutputPath(
|
|
||||||
mf->GetHomeOutputDirectory()).c_str());
|
|
||||||
|
|
||||||
std::string fpath = mf->GetHomeOutputDirectory();
|
|
||||||
fpath += "/CCMakeSystemConfig.cmake";
|
|
||||||
mf->ReadListFile(0,fpath.c_str());
|
|
||||||
this->SetLanguageEnabled("C");
|
|
||||||
if (!m_CMakeInstance->GetIsInTryCompile())
|
if (!m_CMakeInstance->GetIsInTryCompile())
|
||||||
{
|
{
|
||||||
// for old versions of CMake ListFiles
|
// for old versions of CMake ListFiles
|
||||||
|
@ -72,41 +108,12 @@ void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang,
|
||||||
if (!versionValue || atof(versionValue) <= 1.4)
|
if (!versionValue || atof(versionValue) <= 1.4)
|
||||||
{
|
{
|
||||||
std::string ifpath = root + "/Modules/CMakeBackwardCompatibilityC.cmake";
|
std::string ifpath = root + "/Modules/CMakeBackwardCompatibilityC.cmake";
|
||||||
mf->ReadListFile(0,ifpath.c_str());
|
mf->ReadListFile(0,ifpath.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if CXX
|
if(needCXXBackwards)
|
||||||
if(!this->GetLanguageEnabled("CXX") && strcmp(lang, "CXX") == 0)
|
|
||||||
{
|
{
|
||||||
// see man putenv for explaination of this stupid code....
|
|
||||||
static char envCXX[5000];
|
|
||||||
if(mf->GetDefinition("CMAKE_CXX_COMPILER"))
|
|
||||||
{
|
|
||||||
std::string env = "CXX=${CMAKE_CXX_COMPILER}";
|
|
||||||
mf->ExpandVariablesInString(env);
|
|
||||||
strncpy(envCXX, env.c_str(), 4999);
|
|
||||||
envCXX[4999] = 0;
|
|
||||||
putenv(envCXX);
|
|
||||||
}
|
|
||||||
std::string cmd = root;
|
|
||||||
if (m_CMakeInstance->GetIsInTryCompile())
|
|
||||||
{
|
|
||||||
cmSystemTools::Error("This should not have happen. "
|
|
||||||
"If you see this message, you are probably using a "
|
|
||||||
"broken CMakeLists.txt file or a problematic release of "
|
|
||||||
"CMake");
|
|
||||||
}
|
|
||||||
cmd += "/Templates/cxxconfigure";
|
|
||||||
cmSystemTools::RunCommand(cmd.c_str(), output,
|
|
||||||
cmSystemTools::ConvertToOutputPath(
|
|
||||||
mf->GetHomeOutputDirectory()).c_str());
|
|
||||||
|
|
||||||
std::string fpath = mf->GetHomeOutputDirectory();
|
|
||||||
fpath += "/CXXCMakeSystemConfig.cmake";
|
|
||||||
mf->ReadListFile(0,fpath.c_str());
|
|
||||||
this->SetLanguageEnabled("CXX");
|
|
||||||
|
|
||||||
if (!m_CMakeInstance->GetIsInTryCompile())
|
if (!m_CMakeInstance->GetIsInTryCompile())
|
||||||
{
|
{
|
||||||
// for old versions of CMake ListFiles
|
// for old versions of CMake ListFiles
|
||||||
|
@ -114,12 +121,11 @@ void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang,
|
||||||
= mf->GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION");
|
= mf->GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION");
|
||||||
if (!versionValue || atof(versionValue) <= 1.4)
|
if (!versionValue || atof(versionValue) <= 1.4)
|
||||||
{
|
{
|
||||||
fpath = root + "/Modules/CMakeBackwardCompatibilityCXX.cmake";
|
std::string fpath = root + "/Modules/CMakeBackwardCompatibilityCXX.cmake";
|
||||||
mf->ReadListFile(0,fpath.c_str());
|
mf->ReadListFile(0,fpath.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we are from the top, always define this
|
// if we are from the top, always define this
|
||||||
mf->AddDefinition("RUN_CONFIGURE", true);
|
mf->AddDefinition("RUN_CONFIGURE", true);
|
||||||
}
|
}
|
||||||
|
@ -133,33 +139,18 @@ cmLocalGenerator *cmGlobalUnixMakefileGenerator::CreateLocalGenerator()
|
||||||
return lg;
|
return lg;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmGlobalUnixMakefileGenerator::EnableLanguagesFromGenerator(
|
void cmGlobalUnixMakefileGenerator::EnableLanguagesFromGenerator(cmGlobalGenerator *gen)
|
||||||
cmGlobalGenerator *gen, cmMakefile *mf)
|
|
||||||
{
|
{
|
||||||
// for UNIX we just want to read in the configured files
|
this->SetConfiguredFilesPath(gen->GetCMakeInstance()->GetHomeOutputDirectory());
|
||||||
cmLocalGenerator *lg = this->CreateLocalGenerator();
|
|
||||||
|
|
||||||
// set the Start directories
|
|
||||||
lg->GetMakefile()->SetStartDirectory(m_CMakeInstance->GetStartDirectory());
|
|
||||||
lg->GetMakefile()->SetStartOutputDirectory(m_CMakeInstance->GetStartOutputDirectory());
|
|
||||||
lg->GetMakefile()->MakeStartDirectoriesCurrent();
|
|
||||||
|
|
||||||
// if C, then enable C
|
// if C, then enable C
|
||||||
if(gen->GetLanguageEnabled("C"))
|
if(gen->GetLanguageEnabled("C"))
|
||||||
{
|
{
|
||||||
std::string fpath = mf->GetHomeOutputDirectory();
|
|
||||||
fpath += "/CCMakeSystemConfig.cmake";
|
|
||||||
lg->GetMakefile()->ReadListFile(0,fpath.c_str());
|
|
||||||
this->SetLanguageEnabled("C");
|
this->SetLanguageEnabled("C");
|
||||||
}
|
}
|
||||||
|
|
||||||
// if CXX
|
// if CXX
|
||||||
if(gen->GetLanguageEnabled("CXX"))
|
if(gen->GetLanguageEnabled("CXX"))
|
||||||
{
|
{
|
||||||
std::string fpath = mf->GetHomeOutputDirectory();
|
|
||||||
fpath += "/CXXCMakeSystemConfig.cmake";
|
|
||||||
lg->GetMakefile()->ReadListFile(0,fpath.c_str());
|
|
||||||
this->SetLanguageEnabled("CXX");
|
this->SetLanguageEnabled("CXX");
|
||||||
}
|
}
|
||||||
delete lg;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Try to determine system infomation, get it from another generator
|
* Try to determine system infomation, get it from another generator
|
||||||
*/
|
*/
|
||||||
virtual void EnableLanguagesFromGenerator(cmGlobalGenerator *, cmMakefile *);
|
virtual void EnableLanguagesFromGenerator(cmGlobalGenerator *);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,13 @@ bool cmIfCommand::InitialPass(std::vector<std::string> const& args)
|
||||||
|
|
||||||
if (!isValid)
|
if (!isValid)
|
||||||
{
|
{
|
||||||
this->SetError("An IF command had incorrect arguments");
|
std::string err = "An IF command had incorrect arguments: ";
|
||||||
|
for(int i =0; i < args.size(); ++i)
|
||||||
|
{
|
||||||
|
err += args[i];
|
||||||
|
err += " ";
|
||||||
|
}
|
||||||
|
this->SetError(err.c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,6 +183,15 @@ bool cmIfCommand::IsTrue(const std::vector<std::string> &args, bool &isValid,
|
||||||
isValid = true;
|
isValid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (args.size() == 2 && (args[0] == "MATCHES"))
|
||||||
|
{
|
||||||
|
if(!cmSystemTools::FileExists(args[1].c_str()))
|
||||||
|
{
|
||||||
|
isTrue = false;
|
||||||
|
}
|
||||||
|
isValid = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (args.size() == 3 && (args[1] == "AND"))
|
if (args.size() == 3 && (args[1] == "AND"))
|
||||||
{
|
{
|
||||||
def = makefile->GetDefinition(args[0].c_str());
|
def = makefile->GetDefinition(args[0].c_str());
|
||||||
|
@ -263,7 +278,6 @@ bool cmIfCommand::IsTrue(const std::vector<std::string> &args, bool &isValid,
|
||||||
}
|
}
|
||||||
isValid = true;
|
isValid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return isTrue;
|
return isTrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -176,7 +176,6 @@ bool cmLoadCommandCommand::InitialPass(std::vector<std::string> const& argsIn)
|
||||||
// the file must exist
|
// the file must exist
|
||||||
std::string fullPath = cmDynamicLoader::LibPrefix();
|
std::string fullPath = cmDynamicLoader::LibPrefix();
|
||||||
fullPath += "cm" + argsIn[0] + cmDynamicLoader::LibExtension();
|
fullPath += "cm" + argsIn[0] + cmDynamicLoader::LibExtension();
|
||||||
|
|
||||||
std::vector<std::string> args;
|
std::vector<std::string> args;
|
||||||
cmSystemTools::ExpandListArguments(argsIn, args);
|
cmSystemTools::ExpandListArguments(argsIn, args);
|
||||||
|
|
||||||
|
@ -196,7 +195,10 @@ bool cmLoadCommandCommand::InitialPass(std::vector<std::string> const& argsIn)
|
||||||
fullPath = cmSystemTools::FindFile(fullPath.c_str(), path);
|
fullPath = cmSystemTools::FindFile(fullPath.c_str(), path);
|
||||||
if (fullPath == "")
|
if (fullPath == "")
|
||||||
{
|
{
|
||||||
this->SetError("Attempt to load command failed.");
|
fullPath = "Attempt to load command failed from file : ";
|
||||||
|
fullPath += cmDynamicLoader::LibPrefix();
|
||||||
|
fullPath += "cm" + argsIn[0] + cmDynamicLoader::LibExtension();
|
||||||
|
this->SetError(fullPath.c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -60,12 +60,45 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual void OutputCheckDepends(std::ostream&);
|
virtual void OutputCheckDepends(std::ostream&);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to true if the shell being used is the windows shell.
|
||||||
|
* This controls if statements in the makefile and the SHELL variable.
|
||||||
|
* The default is false.
|
||||||
|
*/
|
||||||
|
void SetWindowsShell(bool v) {m_WindowsShell = v;}
|
||||||
|
|
||||||
|
///! Set the string used to include one makefile into another default is include.
|
||||||
|
void SetIncludeDirective(const char* s) { m_IncludeDirective = s; }
|
||||||
|
|
||||||
|
///! Set the flag used to keep the make program silent.
|
||||||
|
void SetMakeSilentFlag(const char* s) { m_MakeSilentFlag = s; }
|
||||||
|
|
||||||
|
///! Set max makefile variable size, default is 0 which means unlimited.
|
||||||
|
void SetMakefileVariableSize(int s) { m_MakefileVariableSize = s; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual const char* GetSafeDefinition(const char*);
|
||||||
virtual void ProcessDepends(const cmMakeDepend &md);
|
virtual void ProcessDepends(const cmMakeDepend &md);
|
||||||
virtual void OutputMakefile(const char* file, bool withDepends);
|
virtual void OutputMakefile(const char* file, bool withDepends);
|
||||||
virtual void OutputTargetRules(std::ostream& fout);
|
virtual void OutputTargetRules(std::ostream& fout);
|
||||||
virtual void OutputLinkLibraries(std::ostream&, const char* name, const cmTarget &);
|
virtual void OutputLinkLibraries(std::ostream&, const char* name, const cmTarget &);
|
||||||
|
void OutputLibraryRule(std::ostream& fout,
|
||||||
|
const char* name,
|
||||||
|
const cmTarget &t,
|
||||||
|
const char* prefix,
|
||||||
|
const char* suffix,
|
||||||
|
const char* createRule,
|
||||||
|
const char* comment
|
||||||
|
);
|
||||||
|
void ExpandRuleVariables(std::string& string,
|
||||||
|
const char* objects=0,
|
||||||
|
const char* target=0,
|
||||||
|
const char* linkLibs=0,
|
||||||
|
const char* source=0,
|
||||||
|
const char* object =0,
|
||||||
|
const char* flags = 0,
|
||||||
|
const char* objectsquoted = 0,
|
||||||
|
const char* targetBase = 0);
|
||||||
virtual void OutputSharedLibraryRule(std::ostream&, const char* name,
|
virtual void OutputSharedLibraryRule(std::ostream&, const char* name,
|
||||||
const cmTarget &);
|
const cmTarget &);
|
||||||
virtual void OutputModuleLibraryRule(std::ostream&, const char* name,
|
virtual void OutputModuleLibraryRule(std::ostream&, const char* name,
|
||||||
|
@ -99,6 +132,12 @@ protected:
|
||||||
const char* target2,
|
const char* target2,
|
||||||
bool silent = false);
|
bool silent = false);
|
||||||
|
|
||||||
|
virtual void BuildInSubDirectoryWindows(std::ostream& fout,
|
||||||
|
const char* directory,
|
||||||
|
const char* target1,
|
||||||
|
const char* target2,
|
||||||
|
bool silent = false);
|
||||||
|
|
||||||
virtual void OutputSubDirectoryVars(std::ostream& fout,
|
virtual void OutputSubDirectoryVars(std::ostream& fout,
|
||||||
const char* var,
|
const char* var,
|
||||||
const char* target,
|
const char* target,
|
||||||
|
@ -109,6 +148,12 @@ protected:
|
||||||
SubDirectories,
|
SubDirectories,
|
||||||
bool silent = false);
|
bool silent = false);
|
||||||
|
|
||||||
|
virtual void OutputMakeRule(std::ostream&,
|
||||||
|
const char* comment,
|
||||||
|
const char* target,
|
||||||
|
const char* depends,
|
||||||
|
const std::vector<std::string>& commands);
|
||||||
|
|
||||||
virtual void OutputMakeRule(std::ostream&,
|
virtual void OutputMakeRule(std::ostream&,
|
||||||
const char* comment,
|
const char* comment,
|
||||||
const char* target,
|
const char* target,
|
||||||
|
@ -125,33 +170,25 @@ protected:
|
||||||
///! return true if the two paths are the same
|
///! return true if the two paths are the same
|
||||||
virtual bool SamePath(const char* path1, const char* path2);
|
virtual bool SamePath(const char* path1, const char* path2);
|
||||||
virtual std::string GetOutputExtension(const char* sourceExtension);
|
virtual std::string GetOutputExtension(const char* sourceExtension);
|
||||||
virtual void OutputIncludeMakefile(std::ostream&, const char* file);
|
|
||||||
void SetObjectFileExtension(const char* e) { m_ObjectFileExtension = e;}
|
|
||||||
void SetExecutableExtension(const char* e) { m_ExecutableExtension = e;}
|
|
||||||
void SetStaticLibraryExtension(const char* e) {m_StaticLibraryExtension = e;}
|
|
||||||
void SetSharedLibraryExtension(const char* e) {m_SharedLibraryExtension = e;}
|
|
||||||
void SetLibraryPrefix(const char* e) { m_LibraryPrefix = e;}
|
|
||||||
std::string CreateTargetRules(const cmTarget &target,
|
std::string CreateTargetRules(const cmTarget &target,
|
||||||
const char* targetName);
|
const char* targetName);
|
||||||
virtual std::string CreateMakeVariable(const char* s, const char* s2)
|
virtual std::string CreateMakeVariable(const char* s, const char* s2);
|
||||||
{
|
|
||||||
return std::string(s) + std::string(s2);
|
|
||||||
}
|
|
||||||
|
|
||||||
///! if the OS is case insensitive then return a lower case of the path.
|
///! if the OS is case insensitive then return a lower case of the path.
|
||||||
virtual std::string LowerCasePath(const char* path)
|
virtual std::string LowerCasePath(const char* path);
|
||||||
{
|
|
||||||
return std::string(path);
|
///! for existing files convert to output path and short path if spaces
|
||||||
}
|
std::string ConvertToOutputForExisting(const char*);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
int m_MakefileVariableSize;
|
||||||
|
std::map<cmStdString, cmStdString> m_MakeVariableMap;
|
||||||
|
std::map<cmStdString, cmStdString> m_ShortMakeVariableMap;
|
||||||
|
|
||||||
|
std::string m_IncludeDirective;
|
||||||
|
std::string m_MakeSilentFlag;
|
||||||
std::string m_ExecutableOutputPath;
|
std::string m_ExecutableOutputPath;
|
||||||
std::string m_LibraryOutputPath;
|
std::string m_LibraryOutputPath;
|
||||||
std::string m_SharedLibraryExtension;
|
bool m_WindowsShell;
|
||||||
std::string m_ObjectFileExtension;
|
|
||||||
std::string m_ExecutableExtension;
|
|
||||||
std::string m_StaticLibraryExtension;
|
|
||||||
std::string m_LibraryPrefix;
|
|
||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1403,8 +1403,7 @@ int cmMakefile::TryCompile(const char *srcdir, const char *bindir,
|
||||||
cm.SetCacheArgs(*cmakeArgs);
|
cm.SetCacheArgs(*cmakeArgs);
|
||||||
}
|
}
|
||||||
// to save time we pass the EnableLanguage info directly
|
// to save time we pass the EnableLanguage info directly
|
||||||
gg->EnableLanguagesFromGenerator(m_LocalGenerator->GetGlobalGenerator(),
|
gg->EnableLanguagesFromGenerator(m_LocalGenerator->GetGlobalGenerator());
|
||||||
this);
|
|
||||||
|
|
||||||
if (cm.Configure() != 0)
|
if (cm.Configure() != 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -219,9 +219,9 @@ class cmIStringStream: private std::string, public std::istrstream
|
||||||
public:
|
public:
|
||||||
typedef std::string StdString;
|
typedef std::string StdString;
|
||||||
typedef std::istrstream IStrStream;
|
typedef std::istrstream IStrStream;
|
||||||
cmIStringStream(): StdString(), IStrStream(this->StdString::c_str()) {}
|
cmIStringStream(): StdString(), IStrStream(StdString::c_str()) {}
|
||||||
cmIStringStream(const std::string& s):
|
cmIStringStream(const std::string& s):
|
||||||
StdString(s), IStrStream(this->StdString::c_str()) {}
|
StdString(s), IStrStream(StdString::c_str()) {}
|
||||||
std::string str() const { return *this; }
|
std::string str() const { return *this; }
|
||||||
void str(const std::string& s)
|
void str(const std::string& s)
|
||||||
{
|
{
|
||||||
|
|
|
@ -124,7 +124,7 @@ cmSystemTools::GetTime(void)
|
||||||
#endif /* !HAVE_FTIME */
|
#endif /* !HAVE_FTIME */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
bool cmSystemTools::s_RunCommandHideConsole = false;
|
||||||
bool cmSystemTools::s_DisableRunCommandOutput = false;
|
bool cmSystemTools::s_DisableRunCommandOutput = false;
|
||||||
bool cmSystemTools::s_ErrorOccured = false;
|
bool cmSystemTools::s_ErrorOccured = false;
|
||||||
bool cmSystemTools::s_DisableMessages = false;
|
bool cmSystemTools::s_DisableMessages = false;
|
||||||
|
@ -251,10 +251,15 @@ void cmSystemTools::ReplaceString(std::string& source,
|
||||||
const char* replace,
|
const char* replace,
|
||||||
const char* with)
|
const char* with)
|
||||||
{
|
{
|
||||||
|
// get out quick if string is not found
|
||||||
|
std::string::size_type start = source.find(replace);
|
||||||
|
if(start == std::string::npos)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
std::string rest;
|
||||||
std::string::size_type lengthReplace = strlen(replace);
|
std::string::size_type lengthReplace = strlen(replace);
|
||||||
std::string::size_type lengthWith = strlen(with);
|
std::string::size_type lengthWith = strlen(with);
|
||||||
std::string rest;
|
|
||||||
std::string::size_type start = source.find(replace);
|
|
||||||
while(start != std::string::npos)
|
while(start != std::string::npos)
|
||||||
{
|
{
|
||||||
rest = source.substr(start+lengthReplace);
|
rest = source.substr(start+lengthReplace);
|
||||||
|
@ -1330,7 +1335,8 @@ bool RunCommandViaWin32(const char* command,
|
||||||
#if defined(__BORLANDC__)
|
#if defined(__BORLANDC__)
|
||||||
return cmWin32ProcessExecution::BorlandRunCommand(command, dir, output,
|
return cmWin32ProcessExecution::BorlandRunCommand(command, dir, output,
|
||||||
retVal,
|
retVal,
|
||||||
verbose, timeout);
|
verbose, timeout,
|
||||||
|
cmSystemTools::GetRunCommandHideConsole());
|
||||||
#else // Visual studio
|
#else // Visual studio
|
||||||
::SetLastError(ERROR_SUCCESS);
|
::SetLastError(ERROR_SUCCESS);
|
||||||
if ( ! command )
|
if ( ! command )
|
||||||
|
@ -1338,13 +1344,13 @@ bool RunCommandViaWin32(const char* command,
|
||||||
cmSystemTools::Error("No command specified");
|
cmSystemTools::Error("No command specified");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//std::cout << "Command: " << command << std::endl;
|
|
||||||
if ( dir )
|
|
||||||
{
|
|
||||||
//std::cout << "Dir: " << dir << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
cmWin32ProcessExecution resProc;
|
cmWin32ProcessExecution resProc;
|
||||||
|
if(cmSystemTools::GetRunCommandHideConsole())
|
||||||
|
{
|
||||||
|
resProc.SetHideWindows(true);
|
||||||
|
}
|
||||||
|
|
||||||
if ( cmSystemTools::GetWindows9xComspecSubstitute() )
|
if ( cmSystemTools::GetWindows9xComspecSubstitute() )
|
||||||
{
|
{
|
||||||
resProc.SetConsoleSpawn(cmSystemTools::GetWindows9xComspecSubstitute() );
|
resProc.SetConsoleSpawn(cmSystemTools::GetWindows9xComspecSubstitute() );
|
||||||
|
@ -2367,7 +2373,7 @@ bool cmSystemTools::SimpleGlob(const std::string& glob,
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
cmSystemTools::e_FileFormat cmSystemTools::GetFileFormat(const char* cext)
|
cmSystemTools::FileFormat cmSystemTools::GetFileFormat(const char* cext)
|
||||||
{
|
{
|
||||||
if ( ! cext || *cext == 0 )
|
if ( ! cext || *cext == 0 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -321,7 +321,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Come constants for different file formats.
|
* Come constants for different file formats.
|
||||||
*/
|
*/
|
||||||
enum e_FileFormat {
|
enum FileFormat {
|
||||||
NO_FILE_FORMAT = 0,
|
NO_FILE_FORMAT = 0,
|
||||||
C_FILE_FORMAT,
|
C_FILE_FORMAT,
|
||||||
CXX_FILE_FORMAT,
|
CXX_FILE_FORMAT,
|
||||||
|
@ -339,7 +339,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Determine the file type based on the extension
|
* Determine the file type based on the extension
|
||||||
*/
|
*/
|
||||||
static e_FileFormat GetFileFormat(const char* ext);
|
static FileFormat GetFileFormat(const char* ext);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* On Windows 9x we need a comspec (command.com) substitute to run
|
* On Windows 9x we need a comspec (command.com) substitute to run
|
||||||
|
@ -349,6 +349,11 @@ public:
|
||||||
static void SetWindows9xComspecSubstitute(const char*);
|
static void SetWindows9xComspecSubstitute(const char*);
|
||||||
static const char* GetWindows9xComspecSubstitute();
|
static const char* GetWindows9xComspecSubstitute();
|
||||||
|
|
||||||
|
/** Windows if this is true, the CreateProcess in RunCommand will
|
||||||
|
* not show new consol windows when running programs.
|
||||||
|
*/
|
||||||
|
static void SetRunCommandHideConsole(bool v){s_RunCommandHideConsole = v;}
|
||||||
|
static bool GetRunCommandHideConsole(){ return s_RunCommandHideConsole;}
|
||||||
protected:
|
protected:
|
||||||
// these two functions can be called from ConvertToOutputPath
|
// these two functions can be called from ConvertToOutputPath
|
||||||
/**
|
/**
|
||||||
|
@ -366,6 +371,7 @@ protected:
|
||||||
static std::string ConvertToWindowsOutputPath(const char*);
|
static std::string ConvertToWindowsOutputPath(const char*);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
static bool s_RunCommandHideConsole;
|
||||||
static bool s_ErrorOccured;
|
static bool s_ErrorOccured;
|
||||||
static bool s_DisableMessages;
|
static bool s_DisableMessages;
|
||||||
static bool s_DisableRunCommandOutput;
|
static bool s_DisableRunCommandOutput;
|
||||||
|
|
|
@ -135,7 +135,7 @@ int cmTryCompileCommand::CoreTryCompileCode(
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string source = argv[2];
|
std::string source = argv[2];
|
||||||
cmSystemTools::e_FileFormat format =
|
cmSystemTools::FileFormat format =
|
||||||
cmSystemTools::GetFileFormat(
|
cmSystemTools::GetFileFormat(
|
||||||
cmSystemTools::GetFilenameExtension(source).c_str());
|
cmSystemTools::GetFilenameExtension(source).c_str());
|
||||||
if ( format == cmSystemTools::C_FILE_FORMAT )
|
if ( format == cmSystemTools::C_FILE_FORMAT )
|
||||||
|
|
|
@ -110,7 +110,7 @@ inline bool IsWinNT()
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
bool cmWin32ProcessExecution::BorlandRunCommand(
|
bool cmWin32ProcessExecution::BorlandRunCommand(
|
||||||
const char* command, const char* dir,
|
const char* command, const char* dir,
|
||||||
std::string& output, int& retVal, bool verbose, int /* timeout */)
|
std::string& output, int& retVal, bool verbose, int /* timeout */, bool hideWindows)
|
||||||
{
|
{
|
||||||
//verbose = true;
|
//verbose = true;
|
||||||
//std::cerr << std::endl
|
//std::cerr << std::endl
|
||||||
|
@ -170,7 +170,11 @@ bool cmWin32ProcessExecution::BorlandRunCommand(
|
||||||
si.dwFlags = STARTF_USESTDHANDLES|STARTF_USESHOWWINDOW;
|
si.dwFlags = STARTF_USESTDHANDLES|STARTF_USESHOWWINDOW;
|
||||||
si.hStdOutput = newstdout;
|
si.hStdOutput = newstdout;
|
||||||
si.hStdError = newstdout;
|
si.hStdError = newstdout;
|
||||||
si.wShowWindow = SW_SHOWDEFAULT; // SW_HIDE;
|
si.wShowWindow = SW_SHOWDEFAULT;
|
||||||
|
if(hideWindows)
|
||||||
|
{
|
||||||
|
si.wShowWindow = SW_HIDE;
|
||||||
|
}
|
||||||
|
|
||||||
//set the new handles for the child process si.hStdInput = newstdin;
|
//set the new handles for the child process si.hStdInput = newstdin;
|
||||||
char* commandAndArgs = strcpy(new char[strlen(command)+1], command);
|
char* commandAndArgs = strcpy(new char[strlen(command)+1], command);
|
||||||
|
@ -285,7 +289,8 @@ static BOOL RealPopenCreateProcess(const char *cmdstring,
|
||||||
HANDLE hStdin,
|
HANDLE hStdin,
|
||||||
HANDLE hStdout,
|
HANDLE hStdout,
|
||||||
HANDLE hStderr,
|
HANDLE hStderr,
|
||||||
HANDLE *hProcess)
|
HANDLE *hProcess,
|
||||||
|
bool hideWindows)
|
||||||
{
|
{
|
||||||
PROCESS_INFORMATION piProcInfo;
|
PROCESS_INFORMATION piProcInfo;
|
||||||
STARTUPINFO siStartInfo;
|
STARTUPINFO siStartInfo;
|
||||||
|
@ -404,7 +409,11 @@ static BOOL RealPopenCreateProcess(const char *cmdstring,
|
||||||
siStartInfo.hStdInput = hStdin;
|
siStartInfo.hStdInput = hStdin;
|
||||||
siStartInfo.hStdOutput = hStdout;
|
siStartInfo.hStdOutput = hStdout;
|
||||||
siStartInfo.hStdError = hStderr;
|
siStartInfo.hStdError = hStderr;
|
||||||
siStartInfo.wShowWindow = SW_SHOWDEFAULT; // SW_HIDE;
|
siStartInfo.wShowWindow = SW_SHOWDEFAULT;
|
||||||
|
if(hideWindows)
|
||||||
|
{
|
||||||
|
siStartInfo.wShowWindow = SW_HIDE;
|
||||||
|
}
|
||||||
|
|
||||||
//std::cout << "Create process: " << s2 << std::endl;
|
//std::cout << "Create process: " << s2 << std::endl;
|
||||||
if (CreateProcess(NULL,
|
if (CreateProcess(NULL,
|
||||||
|
@ -617,7 +626,7 @@ bool cmWin32ProcessExecution::PrivateOpen(const char *cmdstring,
|
||||||
hChildStdinRd,
|
hChildStdinRd,
|
||||||
hChildStdoutWr,
|
hChildStdoutWr,
|
||||||
hChildStdoutWr,
|
hChildStdoutWr,
|
||||||
&hProcess))
|
&hProcess, m_HideWindows))
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -628,7 +637,7 @@ bool cmWin32ProcessExecution::PrivateOpen(const char *cmdstring,
|
||||||
hChildStdinRd,
|
hChildStdinRd,
|
||||||
hChildStdoutWr,
|
hChildStdoutWr,
|
||||||
hChildStderrWr,
|
hChildStderrWr,
|
||||||
&hProcess))
|
&hProcess, m_HideWindows))
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,10 +45,13 @@ class cmWin32ProcessExecution
|
||||||
public:
|
public:
|
||||||
cmWin32ProcessExecution()
|
cmWin32ProcessExecution()
|
||||||
{
|
{
|
||||||
|
m_HideWindows = false;
|
||||||
this->SetConsoleSpawn("w9xpopen.exe");
|
this->SetConsoleSpawn("w9xpopen.exe");
|
||||||
this->Initialize();
|
this->Initialize();
|
||||||
}
|
}
|
||||||
|
///! If true windows will be created hidden.
|
||||||
|
void SetHideWindows(bool v) { m_HideWindows = v; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the process execution datastructure. Do not call while
|
* Initialize the process execution datastructure. Do not call while
|
||||||
* running the process.
|
* running the process.
|
||||||
|
@ -133,7 +136,7 @@ public:
|
||||||
*/
|
*/
|
||||||
static bool BorlandRunCommand(const char* command, const char* dir,
|
static bool BorlandRunCommand(const char* command, const char* dir,
|
||||||
std::string& output, int& retVal, bool verbose,
|
std::string& output, int& retVal, bool verbose,
|
||||||
int timeout);
|
int timeout, bool hideWindows);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool PrivateOpen(const char*, const char*, int, int);
|
bool PrivateOpen(const char*, const char*, int, int);
|
||||||
|
@ -156,6 +159,7 @@ private:
|
||||||
std::string m_Output;
|
std::string m_Output;
|
||||||
std::string m_ConsoleSpawn;
|
std::string m_ConsoleSpawn;
|
||||||
bool m_Verbose;
|
bool m_Verbose;
|
||||||
|
bool m_HideWindows;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -195,6 +195,10 @@ void ctest::Initialize()
|
||||||
fin.getline(buffer, 1023);
|
fin.getline(buffer, 1023);
|
||||||
buffer[1023] = 0;
|
buffer[1023] = 0;
|
||||||
std::string line = ::CleanString(buffer);
|
std::string line = ::CleanString(buffer);
|
||||||
|
if(line.size() == 0)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
while ( fin && (line[line.size()-1] == '\\') )
|
while ( fin && (line[line.size()-1] == '\\') )
|
||||||
{
|
{
|
||||||
line = line.substr(0, line.size()-1);
|
line = line.substr(0, line.size()-1);
|
||||||
|
@ -207,10 +211,6 @@ void ctest::Initialize()
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ( line.size() == 0 )
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
std::string::size_type cpos = line.find_first_of(":");
|
std::string::size_type cpos = line.find_first_of(":");
|
||||||
if ( cpos == line.npos )
|
if ( cpos == line.npos )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue