Commit 72b38e3a authored by Bill Hoffman's avatar Bill Hoffman
Browse files

ENH: merge changes from the main tree to the 2.4 branch

parent 8883613c
......@@ -15,9 +15,9 @@ SET(BUILD_SHARED_LIBS OFF)
# install tree.
SET(CMAKE_SKIP_RPATH ON CACHE INTERNAL "CMake does not need RPATHs.")
SET(CMAKE_DATA_DIR "/share/CMake" CACHE STRING
SET(CMAKE_DATA_DIR "/share/cmake-${CMake_VERSION}" CACHE STRING
"Install location for data (relative to prefix).")
SET(CMAKE_DOC_DIR "/doc/CMake" CACHE STRING
SET(CMAKE_DOC_DIR "/doc/cmake-${CMake_VERSION}" CACHE STRING
"Install location for documentation (relative to prefix).")
SET(CMAKE_MAN_DIR "/man" CACHE STRING
"Install location for man pages (relative to prefix).")
......@@ -88,11 +88,17 @@ SET(CMAKE_CURL_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/Utilities")
SET(CMAKE_CURL_LIBRARIES "cmcurl")
#-----------------------------------------------------------------------------
# Build Curl library for CTest.
# Build Tar library for CTest.
SUBDIRS(Utilities/cmtar)
SET(CMAKE_TAR_INCLUDES "${CMAKE_CURRENT_BINARY_DIR}/Utilities/cmtar")
SET(CMAKE_TAR_LIBRARIES "cmtar")
#-----------------------------------------------------------------------------
# Build Compress library for CTest.
SUBDIRS(Utilities/cmcompress)
SET(CMAKE_COMPRESS_INCLUDES "${CMAKE_CURRENT_BINARY_DIR}/Utilities/cmcompress")
SET(CMAKE_COMPRESS_LIBRARIES "cmcompress")
#-----------------------------------------------------------------------------
# Build expat library for CMake and CTest.
SUBDIRS(Utilities/cmexpat)
......
Changes in CMake 2.4.4
* CMake Version numbers on module directory
* elseif added
* Fix docs in CheckCSourceCompiles CheckCXXSourceCompiles and diagnostic
output.
* added Check(C/CXX)SourceRuns.cmake, CheckCXXCompilerFlag.cmake, Check
* add static and shared flags to make sure the specified versions of
libraries are used with -static -lfoo -shared -lbar
* Search for the compiler only once and store a full path. avoids problems
with PATH changes in cmake re-runs.
* make sure manifest files are generated with VS 8
* added FindASPELL.cmake, FindBZip2.cmake FindHPELL.cmake, FindJasper.cmake
FindLibXml2.cmake, FindLibXslt.cmake, FindOpenSSL.cmake
* fix for bug#3646 GLUT not Glut for framework name
* many fixes for FindKDE3.cmake
* Better FindPNG that honors REQUIRED and looks in more places.
* Support to find python 2.5
* Find Qt3 better
* Find Qt4 better and work with qmake and qmake-qt4 on the same machine.
* Much better FindRuby.cmake
* More stuff marked as advanced in FindTcl and FindSDL
* FindwxWidgets runs shell script wx-config with sh
* Support for cpack and vs8 install libraries
* Darwin shared library create and Fortran now work
* Support for isystem directories INCLUDE_DIRECTORIES (SYSTEM)
* Targets in makefiles to create pre-processed files and assembly files
can be turned off with these variables:
CMAKE_SKIP_PREPROCESSED_SOURCE_RULES CMAKE_SKIP_ASSEMBLY_SOURCE_RULES
* Support for QNX
* Better default search paths for unix and FIND_* stuff
* Use link /lib and not lib to create static libraries with MS
* Useqt4 works with static qt4 and other fixes
* UseSwig.cmake interface to add extra dependencies.
* Added APPEND option to ADD_CUSTOM_COMMAND, Added VERBATIM option to
ADD_CUSTOM_COMMAND and ADD_CUSTOM_TARGET
* add NOT_IN_ALL option for ADD_LIBRARY and ADD_EXECUTABLE
* Fix automatic computation of binary path to work for subdirectories of out
of source directories. This addresses bug#3592.
* --debug-ouput to cmake that gives stack trace to message send error commands.
The stack trace is no longer there without it.
* + can be in a variable
* Do not replace @VAR@ syntax in list files. This addresses bug #2722
* much faster depend scanning
* do depends on system include directories
* Permission and install directory fixes
* New target property <CONFIG>_LOCATION (Debug, Release, etc)
* fix exclude from all in VS
* fix code completion problem in KDevelop
* Define MSYS when using msys generator
* fix referencece to projects outside the build tree VS 7,8
* Fix ZERO_CHECK to not always try and rebuild
* Fix Xcode universal binary rebuild problem
* add FILE_IS_NEWER to if command
* Add OPTIONAL to INSTALL command fix bug@2922
* add SORT and REVERSE to LIST command
* fix for seg fault bug #3815
* add SYBOLIC as a source file property see SET_SOURCE_FILES_PROPERTIES
* fix ctest valgrind if no coverage is done
* better message if bogus generator is specified.
Changes in CMake 2.4.3
* fix for 3557 - Under MSVC8 hardcoded TargetEnvironment for MIDL Compiler
......
......@@ -65,8 +65,8 @@ fun! CMakeGetIndent(lnum)
\ ')\s*' .
\ '\(' . cmake_regex_comment . '\)\?$'
let cmake_indent_begin_regex = '^\s*\(IF\|MACRO\|FOREACH\|ELSE\|WHILE\)\s*('
let cmake_indent_end_regex = '^\s*\(ENDIF\|ENDFOREACH\|ENDMACRO\|ELSE\|ENDWHILE\)\s*('
let cmake_indent_begin_regex = '^\s*\(IF\|MACRO\|FOREACH\|ELSE\|ELSEIF\|WHILE\)\s*('
let cmake_indent_end_regex = '^\s*\(ENDIF\|ENDFOREACH\|ENDMACRO\|ELSE\|ELSEIF\|ENDWHILE\)\s*('
" Add
if previous_line =~? cmake_indent_comment_line " Handle comments
......
......@@ -55,9 +55,9 @@
"\\|" "[ \t\r\n]"
"\\)*"))
(defconst cmake-regex-block-open
"^\\(IF\\|MACRO\\|FOREACH\\|ELSE\\|WHILE\\)$")
"^\\(IF\\|MACRO\\|FOREACH\\|ELSE\\|ELSEIF\\|WHILE\\)$")
(defconst cmake-regex-block-close
"^[ \t]*\\(ENDIF\\|ENDFOREACH\\|ENDMACRO\\|ELSE\\|ENDWHILE\\)[ \t]*(")
"^[ \t]*\\(ENDIF\\|ENDFOREACH\\|ENDMACRO\\|ELSE\\|ELSEIF\\|ENDWHILE\\)[ \t]*(")
;------------------------------------------------------------------------------
......
......@@ -49,7 +49,7 @@ syn region cmakeArguments start=/\s*(/ end=/)/
syn keyword cmakeDeprecated ABSTRACT_FILES BUILD_NAME SOURCE_FILES SOURCE_FILES_REMOVE VTK_MAKE_INSTANTIATOR VTK_WRAP_JAVA VTK_WRAP_PYTHON VTK_WRAP_TCL WRAP_EXCLUDE_FILES
\ nextgroup=cmakeArgument
syn keyword cmakeStatement
\ ADD_CUSTOM_COMMAND ADD_CUSTOM_TARGET ADD_DEFINITIONS ADD_DEPENDENCIES ADD_EXECUTABLE ADD_LIBRARY ADD_SUBDIRECTORY ADD_TEST AUX_SOURCE_DIRECTORY BUILD_COMMAND BUILD_NAME CMAKE_MINIMUM_REQUIRED CONFIGURE_FILE CREATE_TEST_SOURCELIST ELSE ENABLE_LANGUAGE ENABLE_TESTING ENDFOREACH ENDIF ENDWHILE EXEC_PROGRAM EXECUTE_PROCESS EXPORT_LIBRARY_DEPENDENCIES FILE FIND_FILE FIND_LIBRARY FIND_PACKAGE FIND_PATH FIND_PROGRAM FLTK_WRAP_UI FOREACH GET_CMAKE_PROPERTY GET_DIRECTORY_PROPERTY GET_FILENAME_COMPONENT GET_SOURCE_FILE_PROPERTY GET_TARGET_PROPERTY GET_TEST_PROPERTY IF INCLUDE INCLUDE_DIRECTORIES INCLUDE_EXTERNAL_MSPROJECT INCLUDE_REGULAR_EXPRESSION INSTALL INSTALL_FILES INSTALL_PROGRAMS INSTALL_TARGETS LINK_DIRECTORIES LINK_LIBRARIES LIST LOAD_CACHE LOAD_COMMAND MACRO MAKE_DIRECTORY MARK_AS_ADVANCED MATH MESSAGE OPTION OUTPUT_REQUIRED_FILES PROJECT QT_WRAP_CPP QT_WRAP_UI REMOVE REMOVE_DEFINITIONS SEPARATE_ARGUMENTS SET SET_DIRECTORY_PROPERTIES SET_SOURCE_FILES_PROPERTIES SET_TARGET_PROPERTIES SET_TESTS_PROPERTIES SITE_NAME SOURCE_GROUP STRING SUBDIR_DEPENDS SUBDIRS TARGET_LINK_LIBRARIES TRY_COMPILE TRY_RUN USE_MANGLED_MESA UTILITY_SOURCE VARIABLE_REQUIRES VTK_MAKE_INSTANTIATOR VTK_WRAP_JAVA VTK_WRAP_PYTHON VTK_WRAP_TCL WHILE WRITE_FILE ENDMACRO
\ ADD_CUSTOM_COMMAND ADD_CUSTOM_TARGET ADD_DEFINITIONS ADD_DEPENDENCIES ADD_EXECUTABLE ADD_LIBRARY ADD_SUBDIRECTORY ADD_TEST AUX_SOURCE_DIRECTORY BUILD_COMMAND BUILD_NAME CMAKE_MINIMUM_REQUIRED CONFIGURE_FILE CREATE_TEST_SOURCELIST ELSE ELSEIF ENABLE_LANGUAGE ENABLE_TESTING ENDFOREACH ENDIF ENDWHILE EXEC_PROGRAM EXECUTE_PROCESS EXPORT_LIBRARY_DEPENDENCIES FILE FIND_FILE FIND_LIBRARY FIND_PACKAGE FIND_PATH FIND_PROGRAM FLTK_WRAP_UI FOREACH GET_CMAKE_PROPERTY GET_DIRECTORY_PROPERTY GET_FILENAME_COMPONENT GET_SOURCE_FILE_PROPERTY GET_TARGET_PROPERTY GET_TEST_PROPERTY IF INCLUDE INCLUDE_DIRECTORIES INCLUDE_EXTERNAL_MSPROJECT INCLUDE_REGULAR_EXPRESSION INSTALL INSTALL_FILES INSTALL_PROGRAMS INSTALL_TARGETS LINK_DIRECTORIES LINK_LIBRARIES LIST LOAD_CACHE LOAD_COMMAND MACRO MAKE_DIRECTORY MARK_AS_ADVANCED MATH MESSAGE OPTION OUTPUT_REQUIRED_FILES PROJECT QT_WRAP_CPP QT_WRAP_UI REMOVE REMOVE_DEFINITIONS SEPARATE_ARGUMENTS SET SET_DIRECTORY_PROPERTIES SET_SOURCE_FILES_PROPERTIES SET_TARGET_PROPERTIES SET_TESTS_PROPERTIES SITE_NAME SOURCE_GROUP STRING SUBDIR_DEPENDS SUBDIRS TARGET_LINK_LIBRARIES TRY_COMPILE TRY_RUN USE_MANGLED_MESA UTILITY_SOURCE VARIABLE_REQUIRES VTK_MAKE_INSTANTIATOR VTK_WRAP_JAVA VTK_WRAP_PYTHON VTK_WRAP_TCL WHILE WRITE_FILE ENDMACRO
\ nextgroup=cmakeArgumnts
"syn match cmakeMacro /^\s*[A-Z_]\+/ nextgroup=cmakeArgumnts
......
......@@ -72,10 +72,6 @@ IF(NOT CMAKE_SHARED_MODULE_CXX_FLAGS)
SET(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
ENDIF(NOT CMAKE_SHARED_MODULE_CXX_FLAGS)
IF(NOT CMAKE_SHARED_MODULE_LINK_CXX_FLAGS)
SET(CMAKE_SHARED_MODULE_LINK_CXX_FLAGS ${CMAKE_SHARED_MODULE_LINK_C_FLAGS})
ENDIF(NOT CMAKE_SHARED_MODULE_LINK_CXX_FLAGS)
IF(NOT CMAKE_SHARED_MODULE_RUNTIME_CXX_FLAG)
SET(CMAKE_SHARED_MODULE_RUNTIME_CXX_FLAG ${CMAKE_SHARED_MODULE_RUNTIME_FLAG})
ENDIF(NOT CMAKE_SHARED_MODULE_RUNTIME_CXX_FLAG)
......@@ -84,6 +80,18 @@ IF(NOT CMAKE_SHARED_MODULE_RUNTIME_CXX_FLAG_SEP)
SET(CMAKE_SHARED_MODULE_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_MODULE_RUNTIME_FLAG_SEP})
ENDIF(NOT CMAKE_SHARED_MODULE_RUNTIME_CXX_FLAG_SEP)
# Initialize CXX link type selection flags from C versions.
FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
IF(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS)
SET(CMAKE_${type}_LINK_STATIC_CXX_FLAGS
${CMAKE_${type}_LINK_STATIC_C_FLAGS})
ENDIF(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS)
IF(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS)
SET(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS
${CMAKE_${type}_LINK_DYNAMIC_C_FLAGS})
ENDIF(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS)
ENDFOREACH(type)
# add the flags to the cache based
# on the initial values computed in the platform/*.cmake files
# use _INIT variables so that this only happens the first time
......
......@@ -28,17 +28,18 @@ IF(NOT CMAKE_C_COMPILER)
ENDIF(NOT CMAKE_C_COMPILER_INIT)
ENDIF(CMAKE_GENERATOR_CC)
# if no compiler has been specified yet, then look for one
IF(NOT CMAKE_C_COMPILER_INIT)
# if not in the envionment then search for the compiler in the path
# finally list compilers to try
IF(CMAKE_C_COMPILER_INIT)
SET(CMAKE_C_COMPILER_LIST ${CMAKE_C_COMPILER_INIT})
ELSE(CMAKE_C_COMPILER_INIT)
SET(CMAKE_C_COMPILER_LIST gcc cc cl bcc xlc)
FIND_PROGRAM(CMAKE_C_COMPILER_FULLPATH NAMES ${CMAKE_C_COMPILER_LIST} )
GET_FILENAME_COMPONENT(CMAKE_C_COMPILER_INIT
${CMAKE_C_COMPILER_FULLPATH} NAME)
SET(CMAKE_C_COMPILER_FULLPATH "${CMAKE_C_COMPILER_FULLPATH}" CACHE INTERNAL "full path to the compiler cmake found")
ENDIF(NOT CMAKE_C_COMPILER_INIT)
ENDIF(CMAKE_C_COMPILER_INIT)
SET(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_INIT} CACHE STRING "C compiler")
# Find the compiler.
FIND_PROGRAM(CMAKE_C_COMPILER NAMES ${CMAKE_C_COMPILER_LIST} DOC "C compiler")
IF(CMAKE_C_COMPILER_INIT AND NOT CMAKE_C_COMPILER)
SET(CMAKE_C_COMPILER "${CMAKE_C_COMPILER_INIT}" CACHE FILEPATH "C compiler" FORCE)
ENDIF(CMAKE_C_COMPILER_INIT AND NOT CMAKE_C_COMPILER)
ENDIF(NOT CMAKE_C_COMPILER)
MARK_AS_ADVANCED(CMAKE_C_COMPILER)
GET_FILENAME_COMPONENT(COMPILER_LOCATION "${CMAKE_C_COMPILER}"
......
......@@ -28,17 +28,18 @@ IF(NOT CMAKE_CXX_COMPILER)
ENDIF(NOT CMAKE_CXX_COMPILER_INIT)
ENDIF(CMAKE_GENERATOR_CXX)
# if no compiler has been found yet, then try to find one
IF(NOT CMAKE_CXX_COMPILER_INIT)
# if not in the envionment then search for the compiler in the path
# finally list compilers to try
IF(CMAKE_CXX_COMPILER_INIT)
SET(CMAKE_CXX_COMPILER_LIST ${CMAKE_CXX_COMPILER_INIT})
ELSE(CMAKE_CXX_COMPILER_INIT)
SET(CMAKE_CXX_COMPILER_LIST c++ g++ CC aCC cl bcc xlC)
FIND_PROGRAM(CMAKE_CXX_COMPILER_FULLPATH NAMES ${CMAKE_CXX_COMPILER_LIST})
GET_FILENAME_COMPONENT(CMAKE_CXX_COMPILER_INIT
${CMAKE_CXX_COMPILER_FULLPATH} NAME)
SET(CMAKE_CXX_COMPILER_FULLPATH "${CMAKE_CXX_COMPILER_FULLPATH}" CACHE INTERNAL "full path to the compiler cmake found")
ENDIF(NOT CMAKE_CXX_COMPILER_INIT)
SET(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER_INIT}
CACHE STRING "C++ compiler")
ENDIF(CMAKE_CXX_COMPILER_INIT)
# Find the compiler.
FIND_PROGRAM(CMAKE_CXX_COMPILER NAMES ${CMAKE_CXX_COMPILER_LIST} DOC "C++ compiler")
IF(CMAKE_CXX_COMPILER_INIT AND NOT CMAKE_CXX_COMPILER)
SET(CMAKE_CXX_COMPILER "${CMAKE_CXX_COMPILER_INIT}" CACHE FILEPATH "C++ compiler" FORCE)
ENDIF(CMAKE_CXX_COMPILER_INIT AND NOT CMAKE_CXX_COMPILER)
ENDIF(NOT CMAKE_CXX_COMPILER)
MARK_AS_ADVANCED(CMAKE_CXX_COMPILER)
......
......@@ -25,10 +25,10 @@ IF(NOT CMAKE_Fortran_COMPILER)
ENDIF(NOT CMAKE_Fortran_COMPILER_INIT)
ENDIF(CMAKE_GENERATOR_FC)
# if no compiler has been specified yet, then look for one
IF(NOT CMAKE_Fortran_COMPILER_INIT)
# if not in the envionment then search for the compiler in the path
# finally list compilers to try
IF(CMAKE_Fortran_COMPILER_INIT)
SET(CMAKE_Fortran_COMPILER_LIST ${CMAKE_Fortran_COMPILER_INIT})
ELSE(CMAKE_Fortran_COMPILER_INIT)
# Known compilers:
# f77/f90/f95: generic compiler names
# g77: GNU Fortran 77 compiler
......@@ -51,16 +51,17 @@ IF(NOT CMAKE_Fortran_COMPILER)
# NOTE for testing purposes this list is DUPLICATED in
# CMake/Source/CMakeLists.txt, IF YOU CHANGE THIS LIST,
# PLEASE UPDATE THAT FILE AS WELL!
SET(CMAKE_Fortran_COMPILER_LIST ifort ifc efc f95 pgf95
lf95 xlf95 fort gfortran f90 pgf90 xlf90 epcf90 fort77 frt pgf77 xlf fl32 af77 g77 f77 )
FIND_PROGRAM(CMAKE_Fortran_COMPILER_FULLPATH NAMES ${CMAKE_Fortran_COMPILER_LIST} )
GET_FILENAME_COMPONENT(CMAKE_Fortran_COMPILER_INIT
${CMAKE_Fortran_COMPILER_FULLPATH} NAME)
SET(CMAKE_Fortran_COMPILER_FULLPATH "${CMAKE_Fortran_COMPILER_FULLPATH}"
CACHE INTERNAL "full path to the compiler cmake found")
ENDIF(NOT CMAKE_Fortran_COMPILER_INIT)
SET(CMAKE_Fortran_COMPILER_LIST
ifort ifc efc f95 pgf95 lf95 xlf95 fort gfortran f90
pgf90 xlf90 epcf90 fort77 frt pgf77 xlf fl32 af77 g77 f77
)
ENDIF(CMAKE_Fortran_COMPILER_INIT)
SET(CMAKE_Fortran_COMPILER ${CMAKE_Fortran_COMPILER_INIT} CACHE STRING "Fortran compiler")
# Find the compiler.
FIND_PROGRAM(CMAKE_Fortran_COMPILER NAMES ${CMAKE_Fortran_COMPILER_LIST} DOC "Fortran compiler")
IF(CMAKE_Fortran_COMPILER_INIT AND NOT CMAKE_Fortran_COMPILER)
SET(CMAKE_Fortran_COMPILER "${CMAKE_Fortran_COMPILER_INIT}" CACHE FILEPATH "Fortran compiler" FORCE)
ENDIF(CMAKE_Fortran_COMPILER_INIT AND NOT CMAKE_Fortran_COMPILER)
ENDIF(NOT CMAKE_Fortran_COMPILER)
MARK_AS_ADVANCED(CMAKE_Fortran_COMPILER)
......
......@@ -25,18 +25,18 @@ IF(NOT CMAKE_RC_COMPILER)
ENDIF(NOT CMAKE_RC_COMPILER_INIT)
ENDIF(CMAKE_GENERATOR_RC)
# if no compiler has been specified yet, then look for one
IF(NOT CMAKE_RC_COMPILER_INIT)
# finally list compilers to try
IF(CMAKE_RC_COMPILER_INIT)
SET(CMAKE_RC_COMPILER_LIST ${CMAKE_RC_COMPILER_INIT})
ELSE(CMAKE_RC_COMPILER_INIT)
SET(CMAKE_RC_COMPILER_LIST rc)
FIND_PROGRAM(CMAKE_RC_COMPILER_FULLPATH NAMES ${CMAKE_RC_COMPILER_LIST} )
GET_FILENAME_COMPONENT(CMAKE_RC_COMPILER_INIT
${CMAKE_RC_COMPILER_FULLPATH} NAME)
SET(CMAKE_RC_COMPILER_FULLPATH "${CMAKE_RC_COMPILER_FULLPATH}"
CACHE INTERNAL "full path to the compiler cmake found")
ENDIF(NOT CMAKE_RC_COMPILER_INIT)
ENDIF(CMAKE_RC_COMPILER_INIT)
SET(CMAKE_RC_COMPILER ${CMAKE_RC_COMPILER_INIT} CACHE STRING "RC compiler")
# Find the compiler.
FIND_PROGRAM(CMAKE_RC_COMPILER NAMES ${CMAKE_RC_COMPILER_LIST} DOC "RC compiler")
IF(CMAKE_RC_COMPILER_INIT AND NOT CMAKE_RC_COMPILER)
SET(CMAKE_RC_COMPILER "${CMAKE_RC_COMPILER_INIT}" CACHE FILEPATH "RC compiler" FORCE)
ENDIF(CMAKE_RC_COMPILER_INIT AND NOT CMAKE_RC_COMPILER)
ENDIF(NOT CMAKE_RC_COMPILER)
MARK_AS_ADVANCED(CMAKE_RC_COMPILER)
......
......@@ -63,10 +63,6 @@ IF(NOT CMAKE_SHARED_MODULE_Fortran_FLAGS)
SET(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
ENDIF(NOT CMAKE_SHARED_MODULE_Fortran_FLAGS)
IF(NOT CMAKE_SHARED_MODULE_LINK_Fortran_FLAGS)
SET(CMAKE_SHARED_MODULE_LINK_Fortran_FLAGS ${CMAKE_SHARED_MODULE_LINK_C_FLAGS})
ENDIF(NOT CMAKE_SHARED_MODULE_LINK_Fortran_FLAGS)
IF(NOT CMAKE_SHARED_MODULE_RUNTIME_Fortran_FLAG)
SET(CMAKE_SHARED_MODULE_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_MODULE_RUNTIME_C_FLAG})
ENDIF(NOT CMAKE_SHARED_MODULE_RUNTIME_Fortran_FLAG)
......
......@@ -30,7 +30,6 @@ ENDIF(EXISTS ${CMAKE_SYSTEM_INFO_FILE})
IF(NOT CMAKE_MODULE_EXISTS)
SET(CMAKE_SHARED_MODULE_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}")
SET(CMAKE_SHARED_MODULE_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}")
SET(CMAKE_SHARED_MODULE_LINK_C_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
SET(CMAKE_SHARED_MODULE_RUNTIME_C_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
SET(CMAKE_SHARED_MODULE_RUNTIME_C_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
ENDIF(NOT CMAKE_MODULE_EXISTS)
......
# Leave the first line of this file empty so this module will not be
# included in the documentation.
# This script is invoked from Windows-cl.cmake and passed the TARGET
# variable on the command line.
# Conditionally embed the manifest in the executable if it exists.
IF(EXISTS "${TARGET}.manifest")
# Construct the manifest embedding command.
SET(CMD
mt ${CMAKE_CL_NOLOGO} /manifest ${TARGET}.manifest
/outputresource:${TARGET}
)
# Run the embedding command.
EXECUTE_PROCESS(COMMAND ${CMD}\;\#2 RESULT_VARIABLE RESULT)
# Check whether the command failed.
IF(NOT "${RESULT}" MATCHES "^0$")
# The embedding failed remove the target and the manifest.
FILE(REMOVE ${TARGET} ${TARGET}.manifest)
# Describe the failure in a message.
STRING(REGEX REPLACE ";" " " CMD "${CMD}")
MESSAGE(FATAL_ERROR
"Failed to embed manifest in ${TARGET} using command \"${CMD};#2\""
)
ENDIF(NOT "${RESULT}" MATCHES "^0$")
ENDIF(EXISTS "${TARGET}.manifest")
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# - Check whether the C compiler supports a given flag.
# CHECK_C_COMPILER_FLAG(FLAG VARIABLE)
#
# FLAG - the compiler flag
# VARIABLE - variable to store the result
# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
INCLUDE(CheckCSourceCompiles)
MACRO (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
SET(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
CHECK_C_SOURCE_COMPILES("int main() { return 0;}" ${_RESULT})
SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
ENDMACRO (CHECK_C_COMPILER_FLAG)
......@@ -2,7 +2,7 @@
# CHECK_C_SOURCE_COMPILES(SOURCE VAR)
# - macro which checks if the source code compiles
# SOURCE - source code to try to compile
# VAR - variable to store size if the type exists.
# VAR - variable to store whether the source code compiled
#
# The following variables may be set before calling this macro to
# modify the way the check is run:
......@@ -41,16 +41,16 @@ MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR)
"${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
OUTPUT_VARIABLE OUTPUT)
IF(${VAR})
SET(${VAR} 1 CACHE INTERNAL "Test ${FUNCTION}")
SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
MESSAGE(STATUS "Performing Test ${VAR} - Success")
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
"${OUTPUT}\n"
"Source file was:\n${SOURCE}\n")
ELSE(${VAR})
MESSAGE(STATUS "Performing Test ${VAR} - Failed")
SET(${VAR} "" CACHE INTERNAL "Test ${FUNCTION}")
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log
SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
"${OUTPUT}\n"
"Source file was:\n${SOURCE}\n")
......
# - Check if the source code provided in the SOURCE argument compiles and runs.
# CHECK_C_SOURCE_RUNS(SOURCE VAR)
# - macro which checks if the source code runs
# SOURCE - source code to try to compile
# VAR - variable to store size if the type exists.
#
# The following variables may be set before calling this macro to
# modify the way the check is run:
#
# CMAKE_REQUIRED_FLAGS = string of compile command line flags
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
# CMAKE_REQUIRED_INCLUDES = list of include directories
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
IF("${VAR}" MATCHES "^${VAR}$")
SET(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
IF(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
ELSE(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
ENDIF(CMAKE_REQUIRED_LIBRARIES)
IF(CMAKE_REQUIRED_INCLUDES)
SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
ELSE(CMAKE_REQUIRED_INCLUDES)
SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
ENDIF(CMAKE_REQUIRED_INCLUDES)
FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
"${SOURCE}\n")
MESSAGE(STATUS "Performing Test ${VAR}")
TRY_RUN(${VAR} ${VAR}_COMPILED
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
"${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}"
"${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
OUTPUT_VARIABLE OUTPUT)
# if it did not compile make the return value fail code of 1
IF(NOT ${VAR}_COMPILED)
SET(${VAR} 1)
ENDIF(NOT ${VAR}_COMPILED)
# if the return value was 0 then it worked
SET(result_var ${${VAR}})
IF("${result_var}" EQUAL 0)
SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
MESSAGE(STATUS "Performing Test ${VAR} - Success")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
"${OUTPUT}\n"
"Return value: ${${VAR}}\n"
"Source file was:\n${SOURCE}\n")
ELSE("${result_var}" EQUAL 0)
MESSAGE(STATUS "Performing Test ${VAR} - Failed")
SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
"${OUTPUT}\n"
"Return value: ${result_var}\n"
"Source file was:\n${SOURCE}\n")
ENDIF("${result_var}" EQUAL 0)
ENDIF("${VAR}" MATCHES "^${VAR}$")
ENDMACRO(CHECK_C_SOURCE_RUNS)
# - Check whether the CXX compiler supports a given flag.
# CHECK_CXX_COMPILER_FLAG(FLAG VARIABLE)
#
# FLAG - the compiler flag
# VARIABLE - variable to store the result
# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
INCLUDE(CheckCXXSourceCompiles)
MACRO (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
SET(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
CHECK_CXX_SOURCE_COMPILES("int main() { return 0;}" ${_RESULT})
SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
ENDMACRO (CHECK_CXX_COMPILER_FLAG)
# - Check if the source code provided in the SOURCE argument compiles.
# CHECK_CXX_SOURCE_COMPILES(SOURCE VAR)
# - macro which checks if the source code compiles\
# - macro which checks if the source code compiles
# SOURCE - source code to try to compile
# VAR - variable to store size if the type exists.
# VAR - variable to store whether the source code compiled
#
# The following variables may be set before calling this macro to
# modify the way the check is run:
......@@ -41,7 +41,7 @@ MACRO(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
"${CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES}"
OUTPUT_VARIABLE OUTPUT)
IF(${VAR})
SET(${VAR} 1 CACHE INTERNAL "Test ${FUNCTION}")
SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
MESSAGE(STATUS "Performing Test ${VAR} - Success")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n"
......@@ -49,7 +49,7 @@ MACRO(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
"Source file was:\n${SOURCE}\n")
ELSE(${VAR})
MESSAGE(STATUS "Performing Test ${VAR} - Failed")
SET(${VAR} "" CACHE INTERNAL "Test ${FUNCTION}")
SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n"
"${OUTPUT}\n"
......
# - Check if the source code provided in the SOURCE argument compiles and runs.
# CHECK_CXX_SOURCE_RUNS(SOURCE VAR)
# - macro which checks if the source code compiles
# SOURCE - source code to try to compile
# VAR - variable to store size if the type exists.
#
# The following variables may be set before calling this macro to
# modify the way the check is run:
#
# CMAKE_REQUIRED_FLAGS = string of compile command line flags
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
# CMAKE_REQUIRED_INCLUDES = list of include directories
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
MACRO(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
IF("${VAR}" MATCHES "^${VAR}$")
SET(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
IF(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
ELSE(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)