summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeCCompilerId.c.in6
-rw-r--r--Modules/CMakeCXXCompilerId.cpp.in6
-rw-r--r--Modules/CheckCCompilerFlag.cmake1
-rw-r--r--Modules/CheckCXXCompilerFlag.cmake1
-rw-r--r--Modules/FindOpenMP.cmake12
-rw-r--r--Modules/FindPythonInterp.cmake4
-rw-r--r--Modules/FindPythonLibs.cmake70
-rw-r--r--Modules/GenerateExportHeader.cmake46
-rw-r--r--Modules/Platform/Windows-Borland-C.cmake3
-rw-r--r--Modules/Platform/Windows-Borland-CXX.cmake3
-rw-r--r--Modules/Platform/Windows-Embarcadero-C.cmake3
-rw-r--r--Modules/Platform/Windows-Embarcadero-CXX.cmake3
-rw-r--r--Modules/Platform/Windows-Embarcadero.cmake (renamed from Modules/Platform/Windows-Borland.cmake)58
-rw-r--r--Modules/UseSWIG.cmake13
14 files changed, 138 insertions, 91 deletions
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in
index b0f5eb6..06aa9bf 100644
--- a/Modules/CMakeCCompilerId.c.in
+++ b/Modules/CMakeCCompilerId.c.in
@@ -26,6 +26,12 @@
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
+#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
+# define COMPILER_ID "Embarcadero"
+# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
+# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
+# define COMPILER_VERSION_PATCH HEX(__CODEGEARC_VERSION__ & 0xFFFF)
+
#elif defined(__BORLANDC__)
# define COMPILER_ID "Borland"
/* __BORLANDC__ = 0xVRR */
diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in
index 927f7f4..95fc852 100644
--- a/Modules/CMakeCXXCompilerId.cpp.in
+++ b/Modules/CMakeCXXCompilerId.cpp.in
@@ -28,6 +28,12 @@
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
+#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
+# define COMPILER_ID "Embarcadero"
+# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
+# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
+# define COMPILER_VERSION_PATCH HEX(__CODEGEARC_VERSION__ & 0xFFFF)
+
#elif defined(__BORLANDC__)
# define COMPILER_ID "Borland"
/* __BORLANDC__ = 0xVRR */
diff --git a/Modules/CheckCCompilerFlag.cmake b/Modules/CheckCCompilerFlag.cmake
index 3618bdf..1c08c59 100644
--- a/Modules/CheckCCompilerFlag.cmake
+++ b/Modules/CheckCCompilerFlag.cmake
@@ -33,6 +33,7 @@ MACRO (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
FAIL_REGEX "unknown .*option" # Clang
FAIL_REGEX "ignoring unknown option" # MSVC
FAIL_REGEX "warning D9002" # MSVC, any lang
+ FAIL_REGEX "option .*not supported" # Intel
FAIL_REGEX "[Uu]nknown option" # HP
FAIL_REGEX "[Ww]arning: [Oo]ption" # SunPro
FAIL_REGEX "command option .* is not recognized" # XL
diff --git a/Modules/CheckCXXCompilerFlag.cmake b/Modules/CheckCXXCompilerFlag.cmake
index 134f875..6fa69b1 100644
--- a/Modules/CheckCXXCompilerFlag.cmake
+++ b/Modules/CheckCXXCompilerFlag.cmake
@@ -33,6 +33,7 @@ MACRO (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
FAIL_REGEX "unknown .*option" # Clang
FAIL_REGEX "ignoring unknown option" # MSVC
FAIL_REGEX "warning D9002" # MSVC, any lang
+ FAIL_REGEX "option .*not supported" # Intel
FAIL_REGEX "[Uu]nknown option" # HP
FAIL_REGEX "[Ww]arning: [Oo]ption" # SunPro
FAIL_REGEX "command option .* is not recognized" # XL
diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake
index e1af15e..b96a2ec 100644
--- a/Modules/FindOpenMP.cmake
+++ b/Modules/FindOpenMP.cmake
@@ -25,11 +25,6 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-get_property(_ENABLED_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
-list(FIND _ENABLED_LANGUAGES "C" _HAVE_LANGUAGE_C)
-list(FIND _ENABLED_LANGUAGES "CXX" _HAVE_LANGUAGE_CXX)
-unset(_ENABLED_LANGUAGES)
-
set(_OPENMP_REQUIRED_VARS)
function(_OPENMP_FLAG_CANDIDATES LANG)
@@ -93,7 +88,7 @@ int main() {
")
# check c compiler
-if(NOT _HAVE_LANGUAGE_C EQUAL -1)
+if(CMAKE_C_COMPILER_LOADED)
# if these are set then do not try to find them again,
# by avoiding any try_compiles for the flags
if(OpenMP_C_FLAGS)
@@ -124,7 +119,7 @@ if(NOT _HAVE_LANGUAGE_C EQUAL -1)
endif()
# check cxx compiler
-if(NOT _HAVE_LANGUAGE_CXX EQUAL -1)
+if(CMAKE_CXX_COMPILER_LOADED)
# if these are set then do not try to find them again,
# by avoiding any try_compiles for the flags
if(OpenMP_CXX_FLAGS)
@@ -158,9 +153,6 @@ if(NOT _HAVE_LANGUAGE_CXX EQUAL -1)
unset(OpenMP_CXX_TEST_SOURCE)
endif()
-unset(_HAVE_LANGUAGE_C)
-unset(_HAVE_LANGUAGE_CXX)
-
if(_OPENMP_REQUIRED_VARS)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake
index 5c1d56b..930f675 100644
--- a/Modules/FindPythonInterp.cmake
+++ b/Modules/FindPythonInterp.cmake
@@ -10,7 +10,9 @@
# PYTHON_VERSION_MINOR - Python minor version found e.g. 5
# PYTHON_VERSION_PATCH - Python patch version found e.g. 2
#
-# Python_ADDITIONAL_VERSIONS - list of additional Python versions to search for
+# The Python_ADDITIONAL_VERSIONS variable can be used to specify a list of
+# version numbers that should be taken into account when searching for Python.
+# You need to set this variable before calling find_package(PythonInterp).
#=============================================================================
# Copyright 2005-2010 Kitware, Inc.
diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
index da7a1ac..fcd0838 100644
--- a/Modules/FindPythonLibs.cmake
+++ b/Modules/FindPythonLibs.cmake
@@ -7,8 +7,12 @@
# PYTHON_LIBRARIES - path to the python library
# PYTHON_INCLUDE_PATH - path to where Python.h is found (deprecated)
# PYTHON_INCLUDE_DIRS - path to where Python.h is found
-# PYTHON_DEBUG_LIBRARIES - path to the debug library
-# Python_ADDITIONAL_VERSIONS - list of additional Python versions to search for
+# PYTHON_DEBUG_LIBRARIES - path to the debug library (deprecated)
+# PYTHONLIBS_VERSION_STRING - version of the Python libs found (since CMake 2.8.8)
+#
+# The Python_ADDITIONAL_VERSIONS variable can be used to specify a list of
+# version numbers that should be taken into account when searching for Python.
+# You need to set this variable before calling find_package(PythonLibs).
#=============================================================================
# Copyright 2001-2009 Kitware, Inc.
@@ -27,11 +31,42 @@ INCLUDE(CMakeFindFrameworks)
# Search for the python framework on Apple.
CMAKE_FIND_FRAMEWORKS(Python)
+SET(_PYTHON1_VERSIONS 1.6 1.5)
+SET(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
+SET(_PYTHON3_VERSIONS 3.3 3.2 3.1 3.0)
+
+IF(PythonLibs_FIND_VERSION)
+ IF(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
+ STRING(REGEX REPLACE "^([0-9]+\\.[0-9]+).*" "\\1" _PYTHON_FIND_MAJ_MIN "${PythonLibs_FIND_VERSION}")
+ STRING(REGEX REPLACE "^([0-9]+).*" "\\1" _PYTHON_FIND_MAJ "${_PYTHON_FIND_MAJ_MIN}")
+ UNSET(_PYTHON_FIND_OTHER_VERSIONS)
+ IF(NOT PythonLibs_FIND_VERSION_EXACT)
+ FOREACH(_PYTHON_V ${_PYTHON${_PYTHON_FIND_MAJ}_VERSIONS})
+ IF(NOT _PYTHON_V VERSION_LESS _PYTHON_FIND_MAJ_MIN)
+ LIST(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V})
+ ENDIF()
+ ENDFOREACH()
+ ENDIF(NOT PythonLibs_FIND_VERSION_EXACT)
+ UNSET(_PYTHON_FIND_MAJ_MIN)
+ UNSET(_PYTHON_FIND_MAJ)
+ ELSE(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
+ SET(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON${PythonLibs_FIND_VERSION}_VERSIONS})
+ ENDIF(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
+ELSE(PythonLibs_FIND_VERSION)
+ SET(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS})
+ENDIF(PythonLibs_FIND_VERSION)
+
# Set up the versions we know about, in the order we will search. Always add
# the user supplied additional versions to the front.
-set(_Python_VERSIONS
+SET(_Python_VERSIONS
${Python_ADDITIONAL_VERSIONS}
- 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5)
+ ${_PYTHON_FIND_OTHER_VERSIONS}
+ )
+
+UNSET(_PYTHON_FIND_OTHER_VERSIONS)
+UNSET(_PYTHON1_VERSIONS)
+UNSET(_PYTHON2_VERSIONS)
+UNSET(_PYTHON3_VERSIONS)
FOREACH(_CURRENT_VERSION ${_Python_VERSIONS})
STRING(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION})
@@ -92,6 +127,17 @@ FOREACH(_CURRENT_VERSION ${_Python_VERSIONS})
SET(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}" CACHE INTERNAL
"Path to where Python.h is found (deprecated)")
+ IF(PYTHON_INCLUDE_DIR AND EXISTS "${PYTHON_INCLUDE_DIR}/patchlevel.h")
+ FILE(STRINGS "${PYTHON_INCLUDE_DIR}/patchlevel.h" python_version_str
+ REGEX "^#define[ \t]+PY_VERSION[ \t]+\"[^\"]+\"")
+ STRING(REGEX REPLACE "^#define[ \t]+PY_VERSION[ \t]+\"([^\"]+)\".*" "\\1"
+ PYTHONLIBS_VERSION_STRING "${python_version_str}")
+ UNSET(python_version_str)
+ ENDIF(PYTHON_INCLUDE_DIR AND EXISTS "${PYTHON_INCLUDE_DIR}/patchlevel.h")
+
+ IF(PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR)
+ BREAK()
+ ENDIF(PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR)
ENDFOREACH(_CURRENT_VERSION)
MARK_AS_ADVANCED(
@@ -105,13 +151,23 @@ MARK_AS_ADVANCED(
# library. We now set the variables listed by the documentation for this
# module.
SET(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
-SET(PYTHON_LIBRARIES "${PYTHON_LIBRARY}")
SET(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}")
+# These variables have been historically named in this module different from
+# what SELECT_LIBRARY_CONFIGURATIONS() expects.
+SET(PYTHON_LIBRARY_DEBUG "${PYTHON_DEBUG_LIBRARY}")
+SET(PYTHON_LIBRARY_RELEASE "${PYTHON_LIBRARY}")
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
+SELECT_LIBRARY_CONFIGURATIONS(PYTHON)
+# SELECT_LIBRARY_CONFIGURATIONS() sets ${PREFIX}_FOUND if it has a library.
+# Unset this, this prefix doesn't match the module prefix, they are different
+# for historical reasons.
+UNSET(PYTHON_FOUND)
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs DEFAULT_MSG PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
-
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs
+ REQUIRED_VARS PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS
+ VERSION_VAR PYTHONLIBS_VERSION_STRING)
# PYTHON_ADD_MODULE(<name> src1 src2 ... srcN) is used to build modules for python.
# PYTHON_WRITE_MODULES_HEADER(<filename>) writes a header file you can include
diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake
index f3f61f6..ce23d5d 100644
--- a/Modules/GenerateExportHeader.cmake
+++ b/Modules/GenerateExportHeader.cmake
@@ -18,7 +18,7 @@
# [PREFIX_NAME <prefix_name>]
# )
#
-# ADD_COMPILER_EXPORT_FLAGS( [FATAL_WARNINGS] )
+# ADD_COMPILER_EXPORT_FLAGS( [<output_variable>] )
#
# By default GENERATE_EXPORT_HEADER() generates macro names in a file name
# determined by the name of the library. The ADD_COMPILER_EXPORT_FLAGS function
@@ -149,46 +149,20 @@ include(CheckCXXCompilerFlag)
macro(_check_cxx_compiler_attribute _ATTRIBUTE _RESULT)
check_cxx_source_compiles("${_ATTRIBUTE} int somefunc() { return 0; }
int main() { return somefunc();}" ${_RESULT}
- # Some compilers do not fail with a bad flag
- FAIL_REGEX "unrecognized .*option" # GNU
- FAIL_REGEX "ignoring unknown option" # MSVC
- FAIL_REGEX "warning D9002" # MSVC, any lang
- FAIL_REGEX "[Uu]nknown option" # HP
- FAIL_REGEX "[Ww]arning: [Oo]ption" # SunPro
- FAIL_REGEX "command option .* is not recognized" # XL
)
endmacro()
macro(_test_compiler_hidden_visibility)
- if(CMAKE_COMPILER_IS_GNUCXX)
- exec_program(${CMAKE_C_COMPILER} ARGS --version
- OUTPUT_VARIABLE _gcc_version_info)
- string(REGEX MATCH "[345]\\.[0-9]\\.[0-9]"
- _gcc_version "${_gcc_version_info}")
- # gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the
- # patch level, handle this here:
- if(NOT _gcc_version)
- string(REGEX REPLACE ".*\\(GCC\\).* ([34]\\.[0-9]) .*" "\\1.0"
- _gcc_version "${_gcc_version_info}")
- endif()
-
- if("${_gcc_version}" VERSION_LESS "4.2")
- set(GCC_TOO_OLD TRUE)
- message(WARNING "GCC version older than 4.2")
- endif()
- endif()
-
- if(CMAKE_CXX_COMPILER_ID MATCHES Intel)
- exec_program(${CMAKE_CXX_COMPILER} ARGS -V
- OUTPUT_VARIABLE _intel_version_info)
- string(REGEX REPLACE ".*Version ([0-9]+(\\.[0-9]+)+).*" "\\1"
- _intel_version "${_intel_version_info}")
-
- if(${_intel_version} VERSION_LESS "12.0")
- set(_INTEL_TOO_OLD TRUE)
- message(WARNING "Intel compiler older than 12.0")
- endif()
+ if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.2")
+ set(GCC_TOO_OLD TRUE)
+ message(WARNING "GCC version older than 4.2")
+ elseif(CMAKE_COMPILER_IS_GNUC AND CMAKE_C_COMPILER_VERSION VERSION_LESS "4.2")
+ set(GCC_TOO_OLD TRUE)
+ message(WARNING "GCC version older than 4.2")
+ elseif(CMAKE_CXX_COMPILER_ID MATCHES Intel AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "12.0")
+ set(_INTEL_TOO_OLD TRUE)
+ message(WARNING "Intel compiler older than 12.0")
endif()
diff --git a/Modules/Platform/Windows-Borland-C.cmake b/Modules/Platform/Windows-Borland-C.cmake
index ebb74a1..e2f76aa 100644
--- a/Modules/Platform/Windows-Borland-C.cmake
+++ b/Modules/Platform/Windows-Borland-C.cmake
@@ -1,2 +1 @@
-include(Platform/Windows-Borland)
-__borland_language(C)
+include(Platform/Windows-Embarcadero-C)
diff --git a/Modules/Platform/Windows-Borland-CXX.cmake b/Modules/Platform/Windows-Borland-CXX.cmake
index 1260c0e..809490f 100644
--- a/Modules/Platform/Windows-Borland-CXX.cmake
+++ b/Modules/Platform/Windows-Borland-CXX.cmake
@@ -1,2 +1 @@
-include(Platform/Windows-Borland)
-__borland_language(CXX)
+include(Platform/Windows-Embarcadero-CXX)
diff --git a/Modules/Platform/Windows-Embarcadero-C.cmake b/Modules/Platform/Windows-Embarcadero-C.cmake
new file mode 100644
index 0000000..607fd4e
--- /dev/null
+++ b/Modules/Platform/Windows-Embarcadero-C.cmake
@@ -0,0 +1,3 @@
+set(_lang C)
+include(Platform/Windows-Embarcadero)
+__embarcadero_language(C)
diff --git a/Modules/Platform/Windows-Embarcadero-CXX.cmake b/Modules/Platform/Windows-Embarcadero-CXX.cmake
new file mode 100644
index 0000000..279a4de
--- /dev/null
+++ b/Modules/Platform/Windows-Embarcadero-CXX.cmake
@@ -0,0 +1,3 @@
+set(_lang CXX)
+include(Platform/Windows-Embarcadero)
+__embarcadero_language(CXX)
diff --git a/Modules/Platform/Windows-Borland.cmake b/Modules/Platform/Windows-Embarcadero.cmake
index 5c402bd..87b3767 100644
--- a/Modules/Platform/Windows-Borland.cmake
+++ b/Modules/Platform/Windows-Embarcadero.cmake
@@ -1,6 +1,6 @@
#=============================================================================
-# Copyright 2002-2009 Kitware, Inc.
+# Copyright 2002-2012 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -13,26 +13,33 @@
# License text for the above reference.)
# This module is shared by multiple languages; use include blocker.
-if(__WINDOWS_BORLAND)
+if(__WINDOWS_EMBARCADERO)
return()
endif()
-set(__WINDOWS_BORLAND 1)
+set(__WINDOWS_EMBARCADERO 1)
SET(BORLAND 1)
-# Borland target type flags (bcc32 -h -t):
-# -tW GUI App (implies -U__CONSOLE__)
-# -tWC Console App (implies -D__CONSOLE__=1)
-# -tWD Build a DLL (implies -D__DLL__=1 -D_DLL=1)
-# -tWM Enable threads (implies -D__MT__=1 -D_MT=1)
-# -tWR Use DLL runtime (implies -D_RTLDLL, and '-tW' too!!)
-#
-# Notes:
-# - The flags affect linking so we pass them to the linker.
-# - The flags affect preprocessing so we pass them to the compiler.
-# - Since '-tWR' implies '-tW' we use '-tWR -tW-' instead.
-# - Since '-tW-' disables '-tWD' we use '-tWR -tW- -tWD' for DLLs.
-set(_RTLDLL "-tWR -tW-")
+if("${CMAKE_${_lang}_COMPILER_VERSION}" VERSION_LESS 6.30)
+ # Borland target type flags (bcc32 -h -t):
+ set(_tW "-tW") # -tW GUI App (implies -U__CONSOLE__)
+ set(_tC "-tWC") # -tWC Console App (implies -D__CONSOLE__=1)
+ set(_tD "-tWD") # -tWD Build a DLL (implies -D__DLL__=1 -D_DLL=1)
+ set(_tM "-tWM") # -tWM Enable threads (implies -D__MT__=1 -D_MT=1)
+ set(_tR "-tWR -tW-") # -tWR Use DLL runtime (implies -D_RTLDLL, and '-tW' too!!)
+ # Notes:
+ # - The flags affect linking so we pass them to the linker.
+ # - The flags affect preprocessing so we pass them to the compiler.
+ # - Since '-tWR' implies '-tW' we use '-tWR -tW-' instead.
+ # - Since '-tW-' disables '-tWD' we use '-tWR -tW- -tWD' for DLLs.
+else()
+ set(EMBARCADERO 1)
+ set(_tC "-tC") # Target is a console application
+ set(_tD "-tD") # Target is a shared library
+ set(_tM "-tM") # Target is multi-threaded
+ set(_tR "-tR") # Target uses the dynamic RTL
+ set(_tW "-tW") # Target is a Windows application
+endif()
set(_COMPILE_C "-c")
set(_COMPILE_CXX "-P -c")
@@ -50,14 +57,14 @@ SET(CMAKE_FIND_LIBRARY_SUFFIXES "-bcc.lib" ".lib")
SET (CMAKE_MANGLE_OBJECT_FILE_NAMES "ON")
# extra flags for a win32 exe
-SET(CMAKE_CREATE_WIN32_EXE "-tW" )
+SET(CMAKE_CREATE_WIN32_EXE "${_tW}" )
# extra flags for a console app
-SET(CMAKE_CREATE_CONSOLE_EXE "-tWC" )
+SET(CMAKE_CREATE_CONSOLE_EXE "${_tC}" )
SET (CMAKE_BUILD_TYPE Debug CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel.")
-SET (CMAKE_EXE_LINKER_FLAGS_INIT "-tWM -lS:10000000 -lSc:10000000 ")
+SET (CMAKE_EXE_LINKER_FLAGS_INIT "${_tM} -lS:10000000 -lSc:10000000 ")
SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "-v")
SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "-v")
SET (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT})
@@ -67,18 +74,19 @@ SET (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT})
SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT})
SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT})
-macro(__borland_language lang)
- set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-tWD")
+
+macro(__embarcadero_language lang)
+ set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "${_tD}")
# compile a source file into an object file
# place <DEFINES> outside the response file because Borland refuses
# to parse quotes from the response file.
set(CMAKE_${lang}_COMPILE_OBJECT
- "<CMAKE_${lang}_COMPILER> ${_RTLDLL} <DEFINES> ${CMAKE_START_TEMP_FILE}-DWIN32 -o<OBJECT> <FLAGS> ${_COMPILE_${lang}} <SOURCE>${CMAKE_END_TEMP_FILE}"
+ "<CMAKE_${lang}_COMPILER> ${_tR} <DEFINES> ${CMAKE_START_TEMP_FILE}-DWIN32 -o<OBJECT> <FLAGS> ${_COMPILE_${lang}} <SOURCE>${CMAKE_END_TEMP_FILE}"
)
set(CMAKE_${lang}_LINK_EXECUTABLE
- "<CMAKE_${lang}_COMPILER> ${_RTLDLL} -e<TARGET> ${CMAKE_START_TEMP_FILE}<LINK_FLAGS> <FLAGS> <LINK_LIBRARIES> <OBJECTS>${CMAKE_END_TEMP_FILE}"
+ "<CMAKE_${lang}_COMPILER> ${_tR} -e<TARGET> ${CMAKE_START_TEMP_FILE}<LINK_FLAGS> <FLAGS> <LINK_LIBRARIES> <OBJECTS>${CMAKE_END_TEMP_FILE}"
# "implib -c -w <TARGET_IMPLIB> <TARGET>"
)
@@ -91,7 +99,7 @@ macro(__borland_language lang)
# Create a module library.
set(CMAKE_${lang}_CREATE_SHARED_MODULE
- "<CMAKE_${lang}_COMPILER> ${_RTLDLL} -tWD ${CMAKE_START_TEMP_FILE}-e<TARGET> <LINK_FLAGS> <LINK_LIBRARIES> <OBJECTS>${CMAKE_END_TEMP_FILE}"
+ "<CMAKE_${lang}_COMPILER> ${_tR} ${_tD} ${CMAKE_START_TEMP_FILE}-e<TARGET> <LINK_FLAGS> <LINK_LIBRARIES> <OBJECTS>${CMAKE_END_TEMP_FILE}"
)
# Create an import library for another target.
@@ -112,7 +120,7 @@ macro(__borland_language lang)
)
# Initial configuration flags.
- set(CMAKE_${lang}_FLAGS_INIT "-tWM")
+ set(CMAKE_${lang}_FLAGS_INIT "${_tM}")
set(CMAKE_${lang}_FLAGS_DEBUG_INIT "-Od -v")
set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "-O1 -DNDEBUG")
set(CMAKE_${lang}_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index 2a83045..ef76724 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -47,20 +47,17 @@ MACRO(SWIG_MODULE_INITIALIZE name language)
SET(SWIG_MODULE_${name}_LANGUAGE "${swig_uppercase_language}")
SET(SWIG_MODULE_${name}_SWIG_LANGUAGE_FLAG "${swig_lowercase_language}")
- IF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xUNKNOWNx$")
- MESSAGE(FATAL_ERROR "SWIG Error: Language \"${language}\" not found")
- ENDIF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xUNKNOWNx$")
-
SET(SWIG_MODULE_${name}_REAL_NAME "${name}")
- IF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xPYTHONx$")
+ IF("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "UNKNOWN")
+ MESSAGE(FATAL_ERROR "SWIG Error: Language \"${language}\" not found")
+ ELSEIF("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "PYTHON")
# when swig is used without the -interface it will produce in the module.py
# a 'import _modulename' statement, which implies having a corresponding
# _modulename.so (*NIX), _modulename.pyd (Win32).
SET(SWIG_MODULE_${name}_REAL_NAME "_${name}")
- ENDIF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xPYTHONx$")
- IF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xPERLx$")
+ ELSEIF("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "PERL")
SET(SWIG_MODULE_${name}_EXTRA_FLAGS "-shadow")
- ENDIF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xPERLx$")
+ ENDIF()
ENDMACRO(SWIG_MODULE_INITIALIZE)
#