summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-01-27 14:39:55 -0500
committerBrad King <brad.king@kitware.com>2011-01-27 14:39:55 -0500
commitdd2f81491e6e17681dd18882a8ccfa01fa32a3f7 (patch)
tree6b782de32aeb462333d70747f269b1725e723e00 /Modules
parent949d32c3067830a1376950fc78dbcde39bc378a8 (diff)
parent7679f9fab099e729b61320927a9e0b8d03546f7f (diff)
downloadcmake-dd2f81491e6e17681dd18882a8ccfa01fa32a3f7.tar.gz
Merge branch 'dev/add_test-working-directory' into dev/strict-mode
Conflicts: Tests/CMakeLists.txt
Diffstat (limited to 'Modules')
-rw-r--r--Modules/BundleUtilities.cmake42
-rw-r--r--Modules/CMakeASM_NASMInformation.cmake46
-rw-r--r--Modules/CMakeCCompilerId.c.in3
-rw-r--r--Modules/CMakeCXXCompilerId.cpp.in3
-rw-r--r--Modules/CMakeDetermineASMCompiler.cmake1
-rw-r--r--Modules/CMakeDetermineASM_NASMCompiler.cmake27
-rw-r--r--Modules/CMakeDetermineCompilerABI.cmake3
-rw-r--r--Modules/CMakeDetermineFortranCompiler.cmake3
-rw-r--r--Modules/CMakeFindEclipseCDT4.cmake6
-rw-r--r--Modules/CMakeFortranCompilerId.F.in2
-rw-r--r--Modules/CMakeFortranInformation.cmake42
-rw-r--r--Modules/CMakeParseImplicitLinkInfo.cmake7
-rw-r--r--Modules/CMakePlatformId.h.in2
-rw-r--r--Modules/CMakeTestASM-ATTCompiler.cmake8
-rw-r--r--Modules/CMakeTestASMCompiler.cmake9
-rw-r--r--Modules/CMakeTestASM_MASMCompiler.cmake8
-rw-r--r--Modules/CMakeTestASM_NASMCompiler.cmake23
-rwxr-xr-xModules/CPack.STGZ_Header.sh.in2
-rw-r--r--Modules/CPackRPM.cmake42
-rw-r--r--Modules/CheckCCompilerFlag.cmake3
-rw-r--r--Modules/CheckCXXCompilerFlag.cmake3
-rw-r--r--Modules/Compiler/Cray-C.cmake1
-rw-r--r--Modules/Compiler/Cray-CXX.cmake1
-rw-r--r--Modules/Compiler/Cray-Fortran.cmake4
-rw-r--r--Modules/Compiler/NAG-Fortran.cmake32
-rw-r--r--Modules/ExternalProject.cmake60
-rw-r--r--Modules/FindBISON.cmake15
-rw-r--r--Modules/FindBoost.cmake55
-rw-r--r--Modules/FindBullet.cmake5
-rw-r--r--Modules/FindCxxTest.cmake7
-rw-r--r--Modules/FindFLEX.cmake4
-rw-r--r--Modules/FindGTK2.cmake13
-rw-r--r--Modules/FindITK.cmake78
-rw-r--r--Modules/FindPerlLibs.cmake28
-rw-r--r--Modules/FindQt3.cmake6
-rw-r--r--Modules/FindQt4.cmake4
-rw-r--r--Modules/FindTCL.cmake4
-rw-r--r--Modules/FortranCInterface/CMakeLists.txt2
-rw-r--r--Modules/Platform/CYGWIN.cmake2
-rw-r--r--Modules/Platform/Darwin-NAG-Fortran.cmake5
-rw-r--r--Modules/Platform/Darwin.cmake8
-rw-r--r--Modules/Platform/Linux-NAG-Fortran.cmake10
-rw-r--r--Modules/Platform/Windows-cl.cmake2
-rw-r--r--Modules/Qt4ConfigDependentSettings.cmake23
-rw-r--r--Modules/Qt4Macros.cmake15
45 files changed, 484 insertions, 185 deletions
diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake
index c7ead5bd06..44f2c202e8 100644
--- a/Modules/BundleUtilities.cmake
+++ b/Modules/BundleUtilities.cmake
@@ -27,6 +27,11 @@
# drag-n-drop copied to another machine and run on that machine as long as all
# of the system libraries are compatible.
#
+# If you pass plugins to fixup_bundle as the libs parameter, you should install
+# them or copy them into the bundle before calling fixup_bundle. The "libs"
+# parameter is a list of libraries that must be fixed up, but that cannot be
+# determined by otool output analysis. (i.e., plugins)
+#
# Gather all the keys for all the executables and libraries in a bundle, and
# then, for each key, copy each prerequisite into the bundle. Then fix each one
# up according to its own list of prerequisites.
@@ -112,6 +117,13 @@
# _EMBEDDED_ITEM keyed variable for that prerequisite. (Most likely changing to
# an "@executable_path" style reference.)
#
+# This function requires that the resolved_embedded_item be "inside" the bundle
+# already. In other words, if you pass plugins to fixup_bundle as the libs
+# parameter, you should install them or copy them into the bundle before
+# calling fixup_bundle. The "libs" parameter is a list of libraries that must
+# be fixed up, but that cannot be determined by otool output analysis. (i.e.,
+# plugins)
+#
# Also, change the id of the item being fixed up to its own _EMBEDDED_ITEM
# value.
#
@@ -472,11 +484,11 @@ function(copy_resolved_item_into_bundle resolved_item resolved_embedded_item)
else()
#message(STATUS "copying COMMAND ${CMAKE_COMMAND} -E copy ${resolved_item} ${resolved_embedded_item}")
execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${resolved_item}" "${resolved_embedded_item}")
+ if(UNIX AND NOT APPLE)
+ file(RPATH_REMOVE FILE "${resolved_embedded_item}")
+ endif(UNIX AND NOT APPLE)
endif()
- if(UNIX AND NOT APPLE)
- file(RPATH_REMOVE FILE "${resolved_embedded_item}")
- endif(UNIX AND NOT APPLE)
endfunction(copy_resolved_item_into_bundle)
@@ -514,11 +526,11 @@ function(copy_resolved_framework_into_bundle resolved_item resolved_embedded_ite
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${resolved_resources}" "${resolved_embedded_resources}")
endif()
endif()
+ if(UNIX AND NOT APPLE)
+ file(RPATH_REMOVE FILE "${resolved_embedded_item}")
+ endif(UNIX AND NOT APPLE)
endif()
- if(UNIX AND NOT APPLE)
- file(RPATH_REMOVE FILE "${resolved_embedded_item}")
- endif(UNIX AND NOT APPLE)
endfunction(copy_resolved_framework_into_bundle)
@@ -527,6 +539,24 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs)
#
get_item_key("${resolved_embedded_item}" ikey)
+ # Ensure the item is "inside the .app bundle" -- it should not be fixed up if
+ # it is not in the .app bundle... Otherwise, we'll modify files in the build
+ # tree, or in other varied locations around the file system, with our call to
+ # install_name_tool. Make sure that doesn't happen here:
+ #
+ get_dotapp_dir("${exepath}" exe_dotapp_dir)
+ string(LENGTH "${exe_dotapp_dir}/" exe_dotapp_dir_length)
+ string(SUBSTRING "${resolved_embedded_item}" 0 ${exe_dotapp_dir_length} item_substring)
+ if(NOT "${exe_dotapp_dir}/" STREQUAL "${item_substring}")
+ message(" exe_dotapp_dir/='${exe_dotapp_dir}/'")
+ message(" item_substring='${item_substring}'")
+ message(" resolved_embedded_item='${resolved_embedded_item}'")
+ message("")
+ message("Install or copy the item into the bundle before calling fixup_bundle")
+ message("")
+ message(FATAL_ERROR "cannot fixup an item that is not in the bundle...")
+ endif()
+
set(prereqs "")
get_prerequisites("${resolved_embedded_item}" prereqs 1 0 "${exepath}" "${dirs}")
diff --git a/Modules/CMakeASM_NASMInformation.cmake b/Modules/CMakeASM_NASMInformation.cmake
new file mode 100644
index 0000000000..9da7d306c2
--- /dev/null
+++ b/Modules/CMakeASM_NASMInformation.cmake
@@ -0,0 +1,46 @@
+
+#=============================================================================
+# Copyright 2010 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+# support for the nasm assembler
+
+set(CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS nasm asm)
+
+if(NOT CMAKE_ASM_NASM_OBJECT_FORMAT)
+ if(WIN32)
+ if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
+ SET(CMAKE_ASM_NASM_OBJECT_FORMAT win64)
+ else()
+ SET(CMAKE_ASM_NASM_OBJECT_FORMAT win32)
+ endif()
+ elseif(APPLE)
+ if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
+ SET(CMAKE_ASM_NASM_OBJECT_FORMAT macho64)
+ else()
+ SET(CMAKE_ASM_NASM_OBJECT_FORMAT macho)
+ endif()
+ else()
+ if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
+ SET(CMAKE_ASM_NASM_OBJECT_FORMAT elf64)
+ else()
+ SET(CMAKE_ASM_NASM_OBJECT_FORMAT elf)
+ endif()
+ endif()
+endif()
+
+set(CMAKE_ASM_NASM_COMPILE_OBJECT "<CMAKE_ASM_NASM_COMPILER> <FLAGS> -f ${CMAKE_ASM_NASM_OBJECT_FORMAT} -o <OBJECT> <SOURCE>")
+
+# Load the generic ASMInformation file:
+set(ASM_DIALECT "_NASM")
+include(CMakeASMInformation)
+set(ASM_DIALECT)
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in
index accda32570..2b80c886aa 100644
--- a/Modules/CMakeCCompilerId.c.in
+++ b/Modules/CMakeCCompilerId.c.in
@@ -42,6 +42,9 @@
#elif defined(__PATHSCALE__)
# define COMPILER_ID "PathScale"
+#elif defined(_CRAYC)
+# define COMPILER_ID "Cray"
+
#elif defined(__GNUC__)
# define COMPILER_ID "GNU"
diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in
index 4a32823f8b..91f116aa99 100644
--- a/Modules/CMakeCXXCompilerId.cpp.in
+++ b/Modules/CMakeCXXCompilerId.cpp.in
@@ -44,6 +44,9 @@
#elif defined(__PATHSCALE__)
# define COMPILER_ID "PathScale"
+#elif defined(_CRAYC)
+# define COMPILER_ID "Cray"
+
#elif defined(__GNUC__)
# define COMPILER_ID "GNU"
diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake
index 06dd6b86f9..8353be4162 100644
--- a/Modules/CMakeDetermineASMCompiler.cmake
+++ b/Modules/CMakeDetermineASMCompiler.cmake
@@ -65,6 +65,7 @@ IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_GNU "--version")
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_GNU "GNU assembler")
+ INCLUDE(CMakeDetermineCompilerId)
CMAKE_DETERMINE_COMPILER_ID_VENDOR(ASM${ASM_DIALECT})
IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
diff --git a/Modules/CMakeDetermineASM_NASMCompiler.cmake b/Modules/CMakeDetermineASM_NASMCompiler.cmake
new file mode 100644
index 0000000000..d184c0a810
--- /dev/null
+++ b/Modules/CMakeDetermineASM_NASMCompiler.cmake
@@ -0,0 +1,27 @@
+
+#=============================================================================
+# Copyright 2010 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+# Find the nasm assembler. yasm (http://www.tortall.net/projects/yasm/) is nasm compatible
+
+SET(CMAKE_ASM_NASM_COMPILER_INIT nasm yasm)
+
+IF(NOT CMAKE_ASM_NASM_COMPILER)
+ FIND_PROGRAM(CMAKE_ASM_NASM_COMPILER nasm
+ "$ENV{ProgramFiles}/NASM")
+ENDIF(NOT CMAKE_ASM_NASM_COMPILER)
+
+# Load the generic DetermineASM compiler file with the DIALECT set properly:
+SET(ASM_DIALECT "_NASM")
+INCLUDE(CMakeDetermineASMCompiler)
+SET(ASM_DIALECT)
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake
index 81ec71ccd7..7f918e6df0 100644
--- a/Modules/CMakeDetermineCompilerABI.cmake
+++ b/Modules/CMakeDetermineCompilerABI.cmake
@@ -78,7 +78,8 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ABI lang src)
AND NOT MULTI_ARCH
# Skip this with Xcode for now.
AND NOT "${CMAKE_GENERATOR}" MATCHES Xcode)
- CMAKE_PARSE_IMPLICIT_LINK_INFO("${OUTPUT}" implicit_libs implicit_dirs log)
+ CMAKE_PARSE_IMPLICIT_LINK_INFO("${OUTPUT}" implicit_libs implicit_dirs log
+ "${CMAKE_${lang}_IMPLICIT_OBJECT_REGEX}")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Parsed ${lang} implicit link information from above output:\n${log}\n\n")
ENDIF()
diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake
index 03ddd78eb3..3801d7d882 100644
--- a/Modules/CMakeDetermineFortranCompiler.cmake
+++ b/Modules/CMakeDetermineFortranCompiler.cmake
@@ -169,6 +169,9 @@ IF(NOT CMAKE_Fortran_COMPILER_ID_RUN)
LIST(APPEND CMAKE_Fortran_COMPILER_ID_VENDORS Compaq)
SET(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_Compaq "-what")
SET(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_Compaq "Compaq Visual Fortran")
+ LIST(APPEND CMAKE_Fortran_COMPILER_ID_VENDORS NAG) # Numerical Algorithms Group
+ SET(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_NAG "-V")
+ SET(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_NAG "NAG Fortran Compiler")
# Try to identify the compiler.
SET(CMAKE_Fortran_COMPILER_ID)
diff --git a/Modules/CMakeFindEclipseCDT4.cmake b/Modules/CMakeFindEclipseCDT4.cmake
index 836e4c9bfb..fbcdc98416 100644
--- a/Modules/CMakeFindEclipseCDT4.cmake
+++ b/Modules/CMakeFindEclipseCDT4.cmake
@@ -17,6 +17,12 @@
FIND_PROGRAM(CMAKE_ECLIPSE_EXECUTABLE NAMES eclipse DOC "The Eclipse executable")
+# This variable is used by the Eclipse generator and appended to the make invocation commands.
+SET(CMAKE_ECLIPSE_MAKE_ARGUMENTS "" CACHE STRING "Additional command line arguments when Eclipse invokes make. Enter e.g. -j<some_number> to get parallel builds")
+
+# This variable is used by the Eclipse generator in out-of-source builds only.
+SET(ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT FALSE CACHE BOOL "If enabled, CMake will generate a source project for Eclipse in CMAKE_SOURCE_DIR")
+MARK_AS_ADVANCED(ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT)
# The Eclipse generator needs to know the standard include path
# so that Eclipse ca find the headers at runtime and parsing etc. works better
diff --git a/Modules/CMakeFortranCompilerId.F.in b/Modules/CMakeFortranCompilerId.F.in
index 107470cd02..4080cc1179 100644
--- a/Modules/CMakeFortranCompilerId.F.in
+++ b/Modules/CMakeFortranCompilerId.F.in
@@ -6,6 +6,8 @@
PRINT *, 'INFO:compiler[Intel]'
#elif defined(__SUNPRO_F90) || defined(__SUNPRO_F95)
PRINT *, 'INFO:compiler[SunPro]'
+#elif defined(_CRAYFTN)
+ PRINT *, 'INFO:compiler[Cray]'
#elif defined(__G95__)
PRINT *, 'INFO:compiler[G95]'
#elif defined(__PATHSCALE__)
diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake
index f6a52c6eb2..1e9b4e09b9 100644
--- a/Modules/CMakeFortranInformation.cmake
+++ b/Modules/CMakeFortranInformation.cmake
@@ -67,29 +67,29 @@ SET(CMAKE_NEEDS_REQUIRES_STEP_Fortran_FLAG 1)
# Create a set of shared library variable specific to Fortran
# For 90% of the systems, these are the same flags as the C versions
# so if these are not set just copy the flags from the c version
-IF(NOT CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS)
+IF(NOT DEFINED CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS)
SET(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
-ENDIF(NOT CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS)
+ENDIF()
-IF(NOT CMAKE_SHARED_LIBRARY_Fortran_FLAGS)
+IF(NOT DEFINED CMAKE_SHARED_LIBRARY_Fortran_FLAGS)
SET(CMAKE_SHARED_LIBRARY_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
-ENDIF(NOT CMAKE_SHARED_LIBRARY_Fortran_FLAGS)
+ENDIF()
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS)
SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
-ENDIF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS)
+ENDIF()
-IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG)
+IF(NOT DEFINED CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG)
SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
-ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG)
+ENDIF()
-IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP)
+IF(NOT DEFINED CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP)
SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
-ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP)
+ENDIF()
-IF(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG)
+IF(NOT DEFINED CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG)
SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
-ENDIF(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG)
+ENDIF()
IF(NOT DEFINED CMAKE_EXE_EXPORTS_Fortran_FLAG)
SET(CMAKE_EXE_EXPORTS_Fortran_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG})
@@ -100,25 +100,25 @@ IF(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG)
ENDIF()
# repeat for modules
-IF(NOT CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS)
+IF(NOT DEFINED CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS)
SET(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
-ENDIF(NOT CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS)
+ENDIF()
-IF(NOT CMAKE_SHARED_MODULE_Fortran_FLAGS)
+IF(NOT DEFINED CMAKE_SHARED_MODULE_Fortran_FLAGS)
SET(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
-ENDIF(NOT CMAKE_SHARED_MODULE_Fortran_FLAGS)
+ENDIF()
-IF(NOT CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG)
+IF(NOT DEFINED CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG)
SET(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG})
-ENDIF(NOT CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG)
+ENDIF()
-IF(NOT CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP)
+IF(NOT DEFINED CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP)
SET(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP})
-ENDIF(NOT CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP)
+ENDIF()
-IF(NOT CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG)
+IF(NOT DEFINED CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG)
SET(CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG})
-ENDIF(NOT CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG)
+ENDIF()
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH)
SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH})
diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake
index defdb472d7..5405bda586 100644
--- a/Modules/CMakeParseImplicitLinkInfo.cmake
+++ b/Modules/CMakeParseImplicitLinkInfo.cmake
@@ -16,7 +16,7 @@
# This is used internally by CMake and should not be included by user
# code.
-function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var log_var)
+function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var log_var obj_regex)
set(implicit_libs_tmp "")
set(implicit_dirs_tmp)
set(log "")
@@ -59,6 +59,11 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var log_var)
# Unix library full path.
list(APPEND implicit_libs_tmp ${arg})
set(log "${log} arg [${arg}] ==> lib [${arg}]\n")
+ elseif("${arg}" MATCHES "^(.:)?[/\\].*\\.o$"
+ AND obj_regex AND "${arg}" MATCHES "${obj_regex}")
+ # Object file full path.
+ list(APPEND implicit_libs_tmp ${arg})
+ set(log "${log} arg [${arg}] ==> obj [${arg}]\n")
elseif("${arg}" MATCHES "^-Y(P,)?")
# Sun search path.
string(REGEX REPLACE "^-Y(P,)?" "" dirs "${arg}")
diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in
index e20348aac3..1c63cca16b 100644
--- a/Modules/CMakePlatformId.h.in
+++ b/Modules/CMakePlatformId.h.in
@@ -83,7 +83,7 @@
#endif
/* For windows compilers MSVC and Intel we can determine
- the architecture of the compiler being used. This is becase
+ the architecture of the compiler being used. This is because
the compilers do not have flags that can change the architecture,
but rather depend on which compiler is being used
*/
diff --git a/Modules/CMakeTestASM-ATTCompiler.cmake b/Modules/CMakeTestASM-ATTCompiler.cmake
index 3b7a74f187..581ad0c23f 100644
--- a/Modules/CMakeTestASM-ATTCompiler.cmake
+++ b/Modules/CMakeTestASM-ATTCompiler.cmake
@@ -13,10 +13,10 @@
# License text for the above reference.)
# This file is used by EnableLanguage in cmGlobalGenerator to
-# determine that that selected ASM-ATT compiler can actually compile
-# and link the most basic of programs. If not, a fatal error
-# is set and cmake stops processing commands and will not generate
-# any makefiles or projects.
+# determine that the selected ASM-ATT "compiler" works.
+# For assembler this can only check whether the compiler has been found,
+# because otherwise there would have to be a separate assembler source file
+# for each assembler on every architecture.
SET(ASM_DIALECT "-ATT")
INCLUDE(CMakeTestASMCompiler)
diff --git a/Modules/CMakeTestASMCompiler.cmake b/Modules/CMakeTestASMCompiler.cmake
index 54def81364..56cf3325ec 100644
--- a/Modules/CMakeTestASMCompiler.cmake
+++ b/Modules/CMakeTestASMCompiler.cmake
@@ -13,10 +13,11 @@
# License text for the above reference.)
# This file is used by EnableLanguage in cmGlobalGenerator to
-# determine that that selected ASM compiler can actually compile
-# and link the most basic of programs. If not, a fatal error
-# is set and cmake stops processing commands and will not generate
-# any makefiles or projects.
+# determine that the selected ASM compiler works.
+# For assembler this can only check whether the compiler has been found,
+# because otherwise there would have to be a separate assembler source file
+# for each assembler on every architecture.
+
IF(CMAKE_ASM${ASM_DIALECT}_COMPILER)
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_WORKS 1 CACHE INTERNAL "")
ELSE(CMAKE_ASM${ASM_DIALECT}_COMPILER)
diff --git a/Modules/CMakeTestASM_MASMCompiler.cmake b/Modules/CMakeTestASM_MASMCompiler.cmake
index 84ca98f43a..8369b942c8 100644
--- a/Modules/CMakeTestASM_MASMCompiler.cmake
+++ b/Modules/CMakeTestASM_MASMCompiler.cmake
@@ -13,10 +13,10 @@
# License text for the above reference.)
# This file is used by EnableLanguage in cmGlobalGenerator to
-# determine that the selected ASM_MASM "compiler" (should be masm or masm64)
-# can actually "compile" and link the most basic of programs. If not, a
-# fatal error is set and cmake stops processing commands and will not generate
-# any makefiles or projects.
+# determine that the selected ASM_MASM "compiler" (should be masm or masm64)
+# works. For assembler this can only check whether the compiler has been found,
+# because otherwise there would have to be a separate assembler source file
+# for each assembler on every architecture.
SET(ASM_DIALECT "_MASM")
INCLUDE(CMakeTestASMCompiler)
diff --git a/Modules/CMakeTestASM_NASMCompiler.cmake b/Modules/CMakeTestASM_NASMCompiler.cmake
new file mode 100644
index 0000000000..a5e2bea0a7
--- /dev/null
+++ b/Modules/CMakeTestASM_NASMCompiler.cmake
@@ -0,0 +1,23 @@
+
+#=============================================================================
+# Copyright 2010 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+# This file is used by EnableLanguage in cmGlobalGenerator to
+# determine that the selected ASM_NASM "compiler" works.
+# For assembler this can only check whether the compiler has been found,
+# because otherwise there would have to be a separate assembler source file
+# for each assembler on every architecture.
+
+SET(ASM_DIALECT "_NASM")
+INCLUDE(CMakeTestASMCompiler)
+SET(ASM_DIALECT)
diff --git a/Modules/CPack.STGZ_Header.sh.in b/Modules/CPack.STGZ_Header.sh.in
index 3b50e74eea..dee576fb57 100755
--- a/Modules/CPack.STGZ_Header.sh.in
+++ b/Modules/CPack.STGZ_Header.sh.in
@@ -80,7 +80,7 @@ then
if [ "x${cpack_skip_license}x" != "xTRUEx" ]
then
- more << ____cpack__here_doc____
+ more << '____cpack__here_doc____'
@CPACK_RESOURCE_FILE_LICENSE_CONTENT@
____cpack__here_doc____
echo
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index e2d788029b..026c45a6fd 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -331,7 +331,7 @@ ELSE(CPACK_RPM_COMPRESSION_TYPE)
ENDIF(CPACK_RPM_COMPRESSION_TYPE)
if(CPACK_PACKAGE_RELOCATABLE)
- set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE)
+ set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE)
endif(CPACK_PACKAGE_RELOCATABLE)
if(CPACK_RPM_PACKAGE_RELOCATABLE)
if(CPACK_RPM_PACKAGE_DEBUG)
@@ -453,6 +453,17 @@ SET(CPACK_RPM_FILE_NAME "${CPACK_OUTPUT_FILE_NAME}")
#STRING(REGEX REPLACE " " "\\\\ " CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
SET(CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
+
+# Are we packaging components ?
+IF(CPACK_RPM_PACKAGE_COMPONENT)
+ SET(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "-${CPACK_RPM_PACKAGE_COMPONENT}")
+ SET(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "/${CPACK_RPM_PACKAGE_COMPONENT}")
+ SET(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${CPACK_RPM_PACKAGE_COMPONENT}")
+ELSE(CPACK_RPM_PACKAGE_COMPONENT)
+ SET(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "")
+ SET(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "")
+ SET(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
+ENDIF(CPACK_RPM_PACKAGE_COMPONENT)
# Use files tree to construct files command (spec file)
# We should not forget to include symlinks (thus -o -type l)
# We must remove the './' due to the local search and escape the
@@ -460,10 +471,10 @@ SET(CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
# Then we must authorize any man pages extension (adding * at the end)
# because rpmbuild may automatically compress those files
EXECUTE_PROCESS(COMMAND find -type f -o -type l
- COMMAND sed {s:.*/man.*/.*:&*:}
- COMMAND sed {s/\\.\\\(.*\\\)/\"\\1\"/}
- WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}"
- OUTPUT_VARIABLE CPACK_RPM_INSTALL_FILES)
+ COMMAND sed {s:.*/man.*/.*:&*:}
+ COMMAND sed {s/\\.\\\(.*\\\)/\"\\1\"/}
+ WORKING_DIRECTORY "${WDIR}"
+ OUTPUT_VARIABLE CPACK_RPM_INSTALL_FILES)
if (CPACK_ABSOLUTE_DESTINATION_FILES)
IF(CPACK_RPM_PACKAGE_DEBUG)
@@ -494,7 +505,7 @@ if (CPACK_ABSOLUTE_DESTINATION_FILES)
endif(CPACK_ABSOLUTE_DESTINATION_FILES)
# The name of the final spec file to be used by rpmbuild
-SET(CPACK_RPM_BINARY_SPECFILE "${CPACK_RPM_ROOTDIR}/SPECS/${CPACK_RPM_PACKAGE_NAME}.spec")
+SET(CPACK_RPM_BINARY_SPECFILE "${CPACK_RPM_ROOTDIR}/SPECS/${CPACK_RPM_PACKAGE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.spec")
# Print out some debug information if we were asked for that
IF(CPACK_RPM_PACKAGE_DEBUG)
@@ -517,7 +528,7 @@ ENDIF(CPACK_RPM_PACKAGE_DEBUG)
IF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE)
FILE(WRITE ${CPACK_RPM_BINARY_SPECFILE}.in
"# -*- rpm-spec -*-
-BuildRoot: \@CPACK_RPM_DIRECTORY\@/\@CPACK_PACKAGE_FILE_NAME\@
+BuildRoot: \@CPACK_RPM_DIRECTORY\@/\@CPACK_PACKAGE_FILE_NAME\@\@CPACK_RPM_PACKAGE_COMPONENT_PART_PATH\@
Summary: \@CPACK_RPM_PACKAGE_SUMMARY\@
Name: \@CPACK_RPM_PACKAGE_NAME\@
Version: \@CPACK_RPM_PACKAGE_VERSION\@
@@ -555,10 +566,9 @@ mv $RPM_BUILD_ROOT \"\@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot\"
%install
if [ -e $RPM_BUILD_ROOT ];
then
- mv \"\@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot/*\" $RPM_BUILD_ROOT
-else
- mv \"\@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot\" $RPM_BUILD_ROOT
+ rm -rf $RPM_BUILD_ROOT
fi
+mv \"\@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot\" $RPM_BUILD_ROOT
%clean
@@ -608,15 +618,15 @@ IF(RPMBUILD_EXECUTABLE)
# Now call rpmbuild using the SPECFILE
EXECUTE_PROCESS(
COMMAND "${RPMBUILD_EXECUTABLE}" -bb
- --buildroot "${CPACK_RPM_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}"
+ --buildroot "${CPACK_RPM_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}"
"${CPACK_RPM_BINARY_SPECFILE}"
- WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}"
- ERROR_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild.err"
- OUTPUT_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild.out")
+ WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}"
+ ERROR_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err"
+ OUTPUT_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out")
IF(CPACK_RPM_PACKAGE_DEBUG)
MESSAGE("CPackRPM:Debug: You may consult rpmbuild logs in: ")
- MESSAGE("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild.err")
- MESSAGE("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild.out")
+ MESSAGE("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err")
+ MESSAGE("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out")
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
ELSE(RPMBUILD_EXECUTABLE)
IF(ALIEN_EXECUTABLE)
diff --git a/Modules/CheckCCompilerFlag.cmake b/Modules/CheckCCompilerFlag.cmake
index 0068617bbf..cf519b1c11 100644
--- a/Modules/CheckCCompilerFlag.cmake
+++ b/Modules/CheckCCompilerFlag.cmake
@@ -7,7 +7,7 @@
# that can modify the build.
#=============================================================================
-# Copyright 2006-2009 Kitware, Inc.
+# Copyright 2006-2010 Kitware, Inc.
# Copyright 2006 Alexander Neundorf <neundorf@kde.org>
#
# Distributed under the OSI-approved BSD License (the "License");
@@ -29,6 +29,7 @@ MACRO (CHECK_C_COMPILER_FLAG _FLAG _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
diff --git a/Modules/CheckCXXCompilerFlag.cmake b/Modules/CheckCXXCompilerFlag.cmake
index d8e4715485..788bf35b42 100644
--- a/Modules/CheckCXXCompilerFlag.cmake
+++ b/Modules/CheckCXXCompilerFlag.cmake
@@ -7,7 +7,7 @@
# modify the build.
#=============================================================================
-# Copyright 2006-2009 Kitware, Inc.
+# Copyright 2006-2010 Kitware, Inc.
# Copyright 2006 Alexander Neundorf <neundorf@kde.org>
#
# Distributed under the OSI-approved BSD License (the "License");
@@ -29,6 +29,7 @@ MACRO (CHECK_CXX_COMPILER_FLAG _FLAG _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
diff --git a/Modules/Compiler/Cray-C.cmake b/Modules/Compiler/Cray-C.cmake
new file mode 100644
index 0000000000..675560c2a4
--- /dev/null
+++ b/Modules/Compiler/Cray-C.cmake
@@ -0,0 +1 @@
+set(CMAKE_C_VERBOSE_FLAG "-v")
diff --git a/Modules/Compiler/Cray-CXX.cmake b/Modules/Compiler/Cray-CXX.cmake
new file mode 100644
index 0000000000..9fb191c754
--- /dev/null
+++ b/Modules/Compiler/Cray-CXX.cmake
@@ -0,0 +1 @@
+set(CMAKE_CXX_VERBOSE_FLAG "-v")
diff --git a/Modules/Compiler/Cray-Fortran.cmake b/Modules/Compiler/Cray-Fortran.cmake
new file mode 100644
index 0000000000..4f45176d22
--- /dev/null
+++ b/Modules/Compiler/Cray-Fortran.cmake
@@ -0,0 +1,4 @@
+set(CMAKE_Fortran_VERBOSE_FLAG "-v")
+set(CMAKE_Fortran_MODOUT_FLAG -em)
+set(CMAKE_Fortran_MODDIR_FLAG -J)
+set(CMAKE_Fortran_MODDIR_DEFAULT .)
diff --git a/Modules/Compiler/NAG-Fortran.cmake b/Modules/Compiler/NAG-Fortran.cmake
new file mode 100644
index 0000000000..b68c479941
--- /dev/null
+++ b/Modules/Compiler/NAG-Fortran.cmake
@@ -0,0 +1,32 @@
+# Help CMAKE_PARSE_IMPLICIT_LINK_INFO detect NAG Fortran object files.
+if(NOT CMAKE_Fortran_COMPILER_WORKS AND NOT CMAKE_Fortran_COMPILER_FORCED)
+ message(STATUS "Detecting NAG Fortran directory")
+ # Run with -dryrun to see sample "link" line.
+ execute_process(
+ COMMAND ${CMAKE_Fortran_COMPILER} dummy.o -dryrun
+ OUTPUT_VARIABLE _dryrun
+ ERROR_VARIABLE _dryrun
+ )
+ # Match an object file.
+ string(REGEX MATCH "/[^ ]*/[^ /][^ /]*\\.o" _nag_obj "${_dryrun}")
+ if(_nag_obj)
+ # Parse object directory and convert to a regex.
+ string(REGEX REPLACE "/[^/]*$" "" _nag_dir "${_nag_obj}")
+ string(REGEX REPLACE "([][+.*()^])" "\\\\\\1" _nag_regex "${_nag_dir}")
+ set(CMAKE_Fortran_IMPLICIT_OBJECT_REGEX "^${_nag_regex}/")
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Detecting NAG Fortran directory with -dryrun found\n"
+ " object: ${_nag_obj}\n"
+ " directory: ${_nag_dir}\n"
+ " regex: ${CMAKE_Fortran_IMPLICIT_OBJECT_REGEX}\n"
+ "from output:\n${_dryrun}\n\n")
+ message(STATUS "Detecting NAG Fortran directory - ${_nag_dir}")
+ else()
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Detecting NAG Fortran directory with -dryrun failed:\n${_dryrun}\n\n")
+ message(STATUS "Detecting NAG Fortran directory - failed")
+ endif()
+endif()
+
+set(CMAKE_Fortran_MODDIR_FLAG "-mdir ")
+set(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "-PIC")
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 997164a8e2..a3590cf8c6 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -32,6 +32,7 @@
# [CMAKE_COMMAND /.../cmake] # Specify alternative cmake executable
# [CMAKE_GENERATOR gen] # Specify generator for native build
# [CMAKE_ARGS args...] # Arguments to CMake command line
+# [CMAKE_CACHE_ARGS args...] # Initial cache arguments, of the form -Dvar:string=on
# #--Build step-----------------
# [BINARY_DIR dir] # Specify build dir location
# [BUILD_COMMAND cmd...] # Command to drive the native build
@@ -549,6 +550,47 @@ function(_ep_set_directories name)
endforeach()
endfunction(_ep_set_directories)
+function(_ep_write_initial_cache script_filename args)
+ # Write out values into an initial cache, that will be passed to CMake with -C
+ set(script_initial_cache "")
+ set(regex "^([^:]+):([^=]+)=(.*)$")
+ set(setArg "")
+ foreach(line ${args})
+ if("${line}" MATCHES "^-D")
+ if(setArg)
+ # This is required to build up lists in variables, or complete an entry
+ set(setArg "${setArg}${accumulator}\" CACHE ${type} \"Initial cache\" FORCE)")
+ set(script_initial_cache "${script_initial_cache}\n${setArg}")
+ set(accumulator "")
+ set(setArg "")
+ endif()
+ string(REGEX REPLACE "^-D" "" line ${line})
+ if("${line}" MATCHES "${regex}")
+ string(REGEX MATCH "${regex}" match "${line}")
+ set(name "${CMAKE_MATCH_1}")
+ set(type "${CMAKE_MATCH_2}")
+ set(value "${CMAKE_MATCH_3}")
+ set(setArg "set(${name} \"${value}")
+ else()
+ message(WARNING "Line '${line}' does not match regex. Ignoring.")
+ endif()
+ else()
+ # Assume this is a list to append to the last var
+ set(accumulator "${accumulator};${line}")
+ endif()
+ endforeach()
+ # Catch the final line of the args
+ if(setArg)
+ set(setArg "${setArg}${accumulator}\" CACHE ${type} \"Initial cache\" FORCE)")
+ set(script_initial_cache "${script_initial_cache}\n${setArg}")
+ endif()
+ # Write out the initial cache file to the location specified.
+ if(NOT EXISTS "${script_filename}.in")
+ file(WRITE "${script_filename}.in" "\@script_initial_cache\@\n")
+ endif()
+ configure_file("${script_filename}.in" "${script_filename}")
+endfunction(_ep_write_initial_cache)
+
function(ExternalProject_Get_Property name)
foreach(var ${ARGN})
@@ -1224,11 +1266,24 @@ function(_ep_add_configure_command name)
get_property(cmake_args TARGET ${name} PROPERTY _EP_CMAKE_ARGS)
list(APPEND cmd ${cmake_args})
+ # If there are any CMAKE_CACHE_ARGS, write an initial cache and use it
+ get_property(cmake_cache_args TARGET ${name} PROPERTY _EP_CMAKE_CACHE_ARGS)
+ if(cmake_cache_args)
+ set(_ep_cache_args_script "${tmp_dir}/${name}-cache.cmake")
+ _ep_write_initial_cache("${_ep_cache_args_script}" "${cmake_cache_args}")
+ list(APPEND cmd "-C${_ep_cache_args_script}")
+ endif()
+
get_target_property(cmake_generator ${name} _EP_CMAKE_GENERATOR)
if(cmake_generator)
list(APPEND cmd "-G${cmake_generator}" "${source_dir}")
else()
- list(APPEND cmd "-G${CMAKE_GENERATOR}" "${source_dir}")
+ if(CMAKE_EXTRA_GENERATOR)
+ list(APPEND cmd "-G${CMAKE_EXTRA_GENERATOR} - ${CMAKE_GENERATOR}"
+ "${source_dir}")
+ else()
+ list(APPEND cmd "-G${CMAKE_GENERATOR}" "${source_dir}")
+ endif()
endif()
endif()
@@ -1237,10 +1292,11 @@ function(_ep_add_configure_command name)
# Fixes issue http://public.kitware.com/Bug/view.php?id=10258
#
if(NOT EXISTS ${tmp_dir}/${name}-cfgcmd.txt.in)
- file(WRITE ${tmp_dir}/${name}-cfgcmd.txt.in "cmd='@cmd@'\n")
+ file(WRITE ${tmp_dir}/${name}-cfgcmd.txt.in "cmd='\@cmd\@'\n")
endif()
configure_file(${tmp_dir}/${name}-cfgcmd.txt.in ${tmp_dir}/${name}-cfgcmd.txt)
list(APPEND file_deps ${tmp_dir}/${name}-cfgcmd.txt)
+ list(APPEND file_deps ${_ep_cache_args_script})
get_property(log TARGET ${name} PROPERTY _EP_LOG_CONFIGURE)
if(log)
diff --git a/Modules/FindBISON.cmake b/Modules/FindBISON.cmake
index 1120fc1155..a3308dafce 100644
--- a/Modules/FindBISON.cmake
+++ b/Modules/FindBISON.cmake
@@ -51,12 +51,19 @@ FIND_PROGRAM(BISON_EXECUTABLE bison DOC "path to the bison executable")
MARK_AS_ADVANCED(BISON_EXECUTABLE)
IF(BISON_EXECUTABLE)
+ # the bison commands should be executed with the C locale, otherwise
+ # the message (which are parsed) may be translated
+ SET(_Bison_SAVED_LC_ALL "$ENV{LC_ALL}")
+ SET(ENV{LC_ALL} C)
EXECUTE_PROCESS(COMMAND ${BISON_EXECUTABLE} --version
OUTPUT_VARIABLE BISON_version_output
ERROR_VARIABLE BISON_version_error
RESULT_VARIABLE BISON_version_result
OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ SET(ENV{LC_ALL} ${_Bison_SAVED_LC_ALL})
+
IF(NOT ${BISON_version_result} EQUAL 0)
MESSAGE(SEND_ERROR "Command \"${BISON_EXECUTABLE} --version\" failed with output:\n${BISON_version_error}")
ELSE()
@@ -115,7 +122,7 @@ IF(BISON_EXECUTABLE)
IF("${ARGV5}" STREQUAL "VERBOSE")
BISON_TARGET_option_verbose(${Name} ${BisonOutput} "${ARGV6}")
ENDIF()
-
+
IF("${ARGV5}" STREQUAL "COMPILE_FLAGS")
BISON_TARGET_option_extraopts("${ARGV6}")
ENDIF()
@@ -125,10 +132,10 @@ IF(BISON_EXECUTABLE)
LIST(APPEND BISON_TARGET_cmdopt "-d")
STRING(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\2" _fileext "${ARGV2}")
STRING(REPLACE "c" "h" _fileext ${_fileext})
- STRING(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\1${_fileext}"
+ STRING(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\1${_fileext}"
BISON_${Name}_OUTPUT_HEADER "${ARGV2}")
LIST(APPEND BISON_TARGET_outputs "${BISON_${Name}_OUTPUT_HEADER}")
-
+
ADD_CUSTOM_COMMAND(OUTPUT ${BISON_TARGET_outputs}
${BISON_TARGET_extraoutputs}
COMMAND ${BISON_EXECUTABLE}
@@ -136,7 +143,7 @@ IF(BISON_EXECUTABLE)
DEPENDS ${ARGV1}
COMMENT "[BISON][${Name}] Building parser with bison ${BISON_VERSION}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-
+
# define target variables
SET(BISON_${Name}_DEFINED TRUE)
SET(BISON_${Name}_INPUT ${ARGV1})
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index 3ae4e1410b..8930405d1f 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -64,7 +64,8 @@
# Currently this module searches for the following version numbers:
# 1.33, 1.33.0, 1.33.1, 1.34, 1.34.0, 1.34.1, 1.35, 1.35.0, 1.35.1,
# 1.36, 1.36.0, 1.36.1, 1.37, 1.37.0, 1.38, 1.38.0, 1.39, 1.39.0,
-# 1.40, 1.40.0, 1.41, 1.41.0, 1.42, 1.42.0, 1.43, 1.43.0, 1.44, 1.44.0
+# 1.40, 1.40.0, 1.41, 1.41.0, 1.42, 1.42.0, 1.43, 1.43.0, 1.44, 1.44.0,
+# 1.45, 1.45.0, 1.46, 1.46.0
#
# NOTE: If you add a new major 1.x version in Boost_ADDITIONAL_VERSIONS you should
# add both 1.x and 1.x.0 as shown above. Official Boost include directories
@@ -377,7 +378,7 @@ else(Boost_FIND_VERSION_EXACT)
# The user has not requested an exact version. Among known
# versions, find those that are acceptable to the user request.
set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
- "1.44.0" "1.44" "1.43.0" "1.43" "1.42.0" "1.42"
+ "1.46.0" "1.46" "1.45.0" "1.45" "1.44.0" "1.44" "1.43.0" "1.43" "1.42.0" "1.42"
"1.41.0" "1.41" "1.40.0" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0" "1.37"
"1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0"
"1.34" "1.33.1" "1.33.0" "1.33")
@@ -412,9 +413,7 @@ IF(Boost_INCLUDE_DIR)
# On versions < 1.35, remove the System library from the considered list
# since it wasn't added until 1.35.
if(Boost_VERSION AND Boost_FIND_COMPONENTS)
- math(EXPR _boost_maj "${Boost_VERSION} / 100000")
- math(EXPR _boost_min "${Boost_VERSION} / 100 % 1000")
- if(${_boost_maj}.${_boost_min} VERSION_LESS 1.35)
+ if(Boost_VERSION LESS 103500)
list(REMOVE_ITEM Boost_FIND_COMPONENTS system)
endif()
endif()
@@ -477,16 +476,16 @@ ELSE (_boost_IN_CACHE)
# BOOST_WHATEVER_DYN_LINK to force Boost library "whatever" to be
# linked dynamically. Alternatively you can force all Boost
# libraries to dynamic link by defining BOOST_ALL_DYN_LINK.
-
+
# This feature can be disabled for Boost library "whatever" by
# defining BOOST_WHATEVER_NO_LIB, or for all of Boost by defining
# BOOST_ALL_NO_LIB.
-
+
# If you want to observe which libraries are being linked against
# then defining BOOST_LIB_DIAGNOSTIC will cause the auto-linking
# code to emit a #pragma message each time a library is selected
# for linking.
- SET(Boost_LIB_DIAGNOSTIC_DEFINITIONS
+ SET(Boost_LIB_DIAGNOSTIC_DEFINITIONS
"-DBOOST_LIB_DIAGNOSTIC" CACHE STRING "Boost diagnostic define")
ENDIF(WIN32)
@@ -519,12 +518,12 @@ ELSE (_boost_IN_CACHE)
IF( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" )
set(BOOST_INCLUDEDIR $ENV{BOOST_INCLUDEDIR})
ENDIF( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" )
-
+
# If BOOST_LIBRARYDIR was defined in the environment, use it.
IF( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" )
set(BOOST_LIBRARYDIR $ENV{BOOST_LIBRARYDIR})
ENDIF( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" )
-
+
IF( BOOST_ROOT )
file(TO_CMAKE_PATH ${BOOST_ROOT} BOOST_ROOT)
ENDIF( BOOST_ROOT )
@@ -563,7 +562,7 @@ ELSE (_boost_IN_CACHE)
endif( BOOST_INCLUDEDIR )
# ------------------------------------------------------------------------
- # Search for Boost include DIR
+ # Search for Boost include DIR
# ------------------------------------------------------------------------
# Try to find Boost by stepping backwards through the Boost versions
# we know about.
@@ -578,18 +577,18 @@ ELSE (_boost_IN_CACHE)
# Transform 1.35 => 1_35 and 1.36.0 => 1_36_0
IF(_boost_VER MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
- STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1_\\2_\\3"
+ STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1_\\2_\\3"
_boost_BOOSTIFIED_VERSION ${_boost_VER})
ELSEIF(_boost_VER MATCHES "[0-9]+\\.[0-9]+")
- STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)" "\\1_\\2"
+ STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)" "\\1_\\2"
_boost_BOOSTIFIED_VERSION ${_boost_VER})
ENDIF()
-
+
list(APPEND _boost_PATH_SUFFIXES "boost-${_boost_BOOSTIFIED_VERSION}")
list(APPEND _boost_PATH_SUFFIXES "boost_${_boost_BOOSTIFIED_VERSION}")
ENDFOREACH(_boost_VER)
-
+
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"Include debugging info:")
@@ -607,7 +606,7 @@ ELSE (_boost_IN_CACHE)
${_boost_FIND_OPTIONS}
)
ENDIF( NOT Boost_INCLUDE_DIR )
-
+
# ------------------------------------------------------------------------
# Extract version information from version.hpp
# ------------------------------------------------------------------------
@@ -623,13 +622,13 @@ ELSE (_boost_IN_CACHE)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"location of version.hpp: ${Boost_INCLUDE_DIR}/boost/version.hpp")
endif()
-
+
STRING(REGEX REPLACE ".*#define BOOST_VERSION ([0-9]+).*" "\\1" Boost_VERSION "${_boost_VERSION_HPP_CONTENTS}")
STRING(REGEX REPLACE ".*#define BOOST_LIB_VERSION \"([0-9_]+)\".*" "\\1" Boost_LIB_VERSION "${_boost_VERSION_HPP_CONTENTS}")
-
+
SET(Boost_LIB_VERSION ${Boost_LIB_VERSION} CACHE INTERNAL "The library version string for boost libraries")
SET(Boost_VERSION ${Boost_VERSION} CACHE INTERNAL "The version number for boost libraries")
-
+
IF(NOT "${Boost_VERSION}" STREQUAL "0")
MATH(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000")
MATH(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000")
@@ -647,7 +646,7 @@ ELSE (_boost_IN_CACHE)
set(Boost_ERROR_REASON
"${Boost_ERROR_REASON}Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers.")
ENDIF(Boost_INCLUDE_DIR)
-
+
# ------------------------------------------------------------------------
# Suffix initialization and compiler suffix detection.
# ------------------------------------------------------------------------
@@ -670,7 +669,7 @@ ELSE (_boost_IN_CACHE)
# please report them and use the Boost_COMPILER variable
# to work around the problems.
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel"
- OR "${CMAKE_CXX_COMPILER}" MATCHES "icl"
+ OR "${CMAKE_CXX_COMPILER}" MATCHES "icl"
OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc")
if(WIN32)
set (_boost_COMPILER "-iw")
@@ -916,6 +915,7 @@ ELSE (_boost_IN_CACHE)
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION}
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}
${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}
${Boost_LIB_PREFIX}boost_${COMPONENT} )
if(_boost_STATIC_RUNTIME_WORKAROUND)
@@ -998,7 +998,7 @@ ELSE (_boost_IN_CACHE)
if (NOT Boost_FIND_VERSION_PATCH)
set(Boost_FIND_VERSION_PATCH 0)
endif (NOT Boost_FIND_VERSION_PATCH)
-
+
# We'll set Boost_FOUND true again if we have an exact version match.
set(Boost_FOUND FALSE)
_Boost_MARK_COMPONENTS_FOUND(OFF)
@@ -1017,7 +1017,7 @@ ELSE (_boost_IN_CACHE)
set(Boost_ERROR_REASON
"${Boost_ERROR_REASON}\nDetected version of Boost is too ${_Boost_VERSION_AGE}. Requested version was ${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
if (Boost_FIND_VERSION_PATCH)
- set(Boost_ERROR_REASON
+ set(Boost_ERROR_REASON
"${Boost_ERROR_REASON}.${Boost_FIND_VERSION_PATCH}")
endif (Boost_FIND_VERSION_PATCH)
if (NOT Boost_FIND_VERSION_EXACT)
@@ -1072,16 +1072,16 @@ ELSE (_boost_IN_CACHE)
# Note that the user may not have installed any libraries
# so it is quite possible the Boost_LIBRARY_PATH may not exist.
SET(_boost_LIB_DIR ${Boost_INCLUDE_DIR})
-
+
IF("${_boost_LIB_DIR}" MATCHES "boost-[0-9]+")
GET_FILENAME_COMPONENT(_boost_LIB_DIR ${_boost_LIB_DIR} PATH)
ENDIF ("${_boost_LIB_DIR}" MATCHES "boost-[0-9]+")
-
+
IF("${_boost_LIB_DIR}" MATCHES "/include$")
# Strip off the trailing "/include" in the path.
GET_FILENAME_COMPONENT(_boost_LIB_DIR ${_boost_LIB_DIR} PATH)
ENDIF("${_boost_LIB_DIR}" MATCHES "/include$")
-
+
IF(EXISTS "${_boost_LIB_DIR}/lib")
SET (_boost_LIB_DIR ${_boost_LIB_DIR}/lib)
ELSE(EXISTS "${_boost_LIB_DIR}/lib")
@@ -1091,7 +1091,7 @@ ELSE (_boost_IN_CACHE)
SET(_boost_LIB_DIR "")
ENDIF(EXISTS "${_boost_LIB_DIR}/stage/lib")
ENDIF(EXISTS "${_boost_LIB_DIR}/lib")
-
+
IF(_boost_LIB_DIR AND EXISTS "${_boost_LIB_DIR}")
SET(Boost_LIBRARY_DIRS ${_boost_LIB_DIR} CACHE FILEPATH "Boost library directory")
ENDIF(_boost_LIB_DIR AND EXISTS "${_boost_LIB_DIR}")
@@ -1142,4 +1142,3 @@ ELSE (_boost_IN_CACHE)
Boost_LIBRARY_DIRS
)
ENDIF(_boost_IN_CACHE)
-
diff --git a/Modules/FindBullet.cmake b/Modules/FindBullet.cmake
index 50c8527495..ea0abb7aa2 100644
--- a/Modules/FindBullet.cmake
+++ b/Modules/FindBullet.cmake
@@ -31,7 +31,7 @@ macro(_FIND_BULLET_LIBRARY _var)
find_library(${_var}
NAMES
${ARGN}
- PATHS
+ HINTS
${BULLET_ROOT}
${BULLET_ROOT}/out/release8/libs
${BULLET_ROOT}/out/debug8/libs
@@ -50,9 +50,10 @@ macro(_BULLET_APPEND_LIBRARIES _list _release)
endmacro()
find_path(BULLET_INCLUDE_DIR NAMES btBulletCollisionCommon.h
- PATHS
+ HINTS
${BULLET_ROOT}/include
${BULLET_ROOT}/src
+ PATH_SUFFIXES bullet
)
# Find the libraries
diff --git a/Modules/FindCxxTest.cmake b/Modules/FindCxxTest.cmake
index 4ff6eba195..912a1578b2 100644
--- a/Modules/FindCxxTest.cmake
+++ b/Modules/FindCxxTest.cmake
@@ -97,6 +97,11 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
+# Version 1.4 (11/18/10) (CMake 2.8.4)
+# Issue 11384: Added support to the CXX_ADD_TEST macro so header
+# files (containing the tests themselves) show up in
+# Visual Studio and other IDEs.
+#
# Version 1.3 (8/19/10) (CMake 2.8.3)
# Included patch by Simone Rossetto to check if either Python or Perl
# are present in the system. Whichever intepreter that is detected
@@ -131,7 +136,7 @@ macro(CXXTEST_ADD_TEST _cxxtest_testname _cxxtest_outfname)
)
set_source_files_properties(${_cxxtest_real_outfname} PROPERTIES GENERATED true)
- add_executable(${_cxxtest_testname} ${_cxxtest_real_outfname})
+ add_executable(${_cxxtest_testname} ${_cxxtest_real_outfname} ${ARGN})
if(CMAKE_RUNTIME_OUTPUT_DIRECTORY)
add_test(${_cxxtest_testname} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_cxxtest_testname})
diff --git a/Modules/FindFLEX.cmake b/Modules/FindFLEX.cmake
index 272cdc7ab4..ff6b085a49 100644
--- a/Modules/FindFLEX.cmake
+++ b/Modules/FindFLEX.cmake
@@ -36,8 +36,8 @@
# find_package(BISON)
# find_package(FLEX)
#
-# BISON_TARGET(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp
-# FLEX_TARGET(MyScanner lexer.l ${CMAKE_CURRENT_BIANRY_DIR}/lexer.cpp)
+# BISON_TARGET(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp)
+# FLEX_TARGET(MyScanner lexer.l ${CMAKE_CURRENT_BINARY_DIR}/lexer.cpp)
# ADD_FLEX_BISON_DEPENDENCY(MyScanner MyParser)
#
# include_directories(${CMAKE_CURRENT_BINARY_DIR})
diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake
index d8b4f63138..1e59946190 100644
--- a/Modules/FindGTK2.cmake
+++ b/Modules/FindGTK2.cmake
@@ -66,6 +66,10 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
+# Version 1.3 (11/9/2010) (CMake 2.8.4)
+# * 11429: Add support for detecting GTK2 built with Visual Studio 10.
+# Thanks to Vincent Levesque for the patch.
+
# Version 1.2 (8/30/2010) (CMake 2.8.3)
# * Merge patch for detecting gdk-pixbuf library (split off
# from core GTK in 2.21). Thanks to Vincent Untz for the patch
@@ -237,15 +241,16 @@ function(_GTK2_FIND_LIBRARY _var _lib _expand_vc _append_version)
set(_library ${_lib})
- if(_expand_vc)
- # Add vc80/vc90 midfixes
+ if(_expand_vc AND MSVC)
+ # Add vc80/vc90/vc100 midfixes
if(MSVC80)
set(_library ${_library}-vc80)
- set(_library_d ${_library}-d)
elseif(MSVC90)
set(_library ${_library}-vc90)
- set(_library_d ${_library}-d)
+ elseif(MSVC10)
+ set(_library ${_library}-vc100)
endif()
+ set(_library_d ${_library}-d)
endif()
if(GTK2_DEBUG)
diff --git a/Modules/FindITK.cmake b/Modules/FindITK.cmake
index 244ce54867..5f43dd9519 100644
--- a/Modules/FindITK.cmake
+++ b/Modules/FindITK.cmake
@@ -21,7 +21,7 @@
# instead.
#=============================================================================
-# Copyright 2001-2009 Kitware, Inc.
+# Copyright 2001-2010 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -33,67 +33,23 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-SET(ITK_DIR_STRING "directory containing ITKConfig.cmake. This is either the root of the build tree, or PREFIX/lib/InsightToolkit for an installation.")
+# Use the Config mode of the find_package() command to find ITKConfig.
+# If this succeeds (possibly because ITK_DIR is already set), the
+# command will have already loaded ITKConfig.cmake and set ITK_FOUND.
+IF(NOT ITK_FOUND)
+ FIND_PACKAGE(ITK QUIET NO_MODULE
+ NAMES ITK InsightToolkit
+ CONFIGS ITKConfig.cmake
+ )
+ENDIF()
-# Search only if the location is not already known.
-IF(NOT ITK_DIR)
- # Get the system search path as a list.
- IF(UNIX)
- STRING(REGEX MATCHALL "[^:]+" ITK_DIR_SEARCH1 "$ENV{PATH}")
- ELSE(UNIX)
- STRING(REGEX REPLACE "\\\\" "/" ITK_DIR_SEARCH1 "$ENV{PATH}")
- ENDIF(UNIX)
- STRING(REGEX REPLACE "/;" ";" ITK_DIR_SEARCH2 ${ITK_DIR_SEARCH1})
-
- # Construct a set of paths relative to the system search path.
- SET(ITK_DIR_SEARCH "")
- FOREACH(dir ${ITK_DIR_SEARCH2})
- SET(ITK_DIR_SEARCH ${ITK_DIR_SEARCH} "${dir}/../lib/InsightToolkit")
- ENDFOREACH(dir)
-
- #
- # Look for an installation or build tree.
- #
- FIND_PATH(ITK_DIR ITKConfig.cmake
- # Look for an environment variable ITK_DIR.
- $ENV{ITK_DIR}
-
- # Look in places relative to the system executable search path.
- ${ITK_DIR_SEARCH}
-
- # Look in standard UNIX install locations.
- /usr/local/lib/InsightToolkit
- /usr/lib/InsightToolkit
-
- # Read from the CMakeSetup registry entries. It is likely that
- # ITK will have been recently built.
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild1]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild2]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild3]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild4]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild5]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild6]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild7]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild8]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild9]
- [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild10]
-
- # Help the user find it if we cannot.
- DOC "The ${ITK_DIR_STRING}"
- )
-ENDIF(NOT ITK_DIR)
-
-# If ITK was found, load the configuration file to get the rest of the
-# settings.
-IF(ITK_DIR)
- SET(ITK_FOUND 1)
- INCLUDE(${ITK_DIR}/ITKConfig.cmake)
+SET(ITK_DIR_MESSAGE "Please set ITK_DIR to the directory containing ITKConfig.cmake. This is either the root of the build tree, or PREFIX/lib/InsightToolkit for an installation.")
+IF(ITK_FOUND)
# Set USE_ITK_FILE for backward-compatability.
SET(USE_ITK_FILE ${ITK_USE_FILE})
-ELSE(ITK_DIR)
- SET(ITK_FOUND 0)
- IF(ITK_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "Please set ITK_DIR to the ${ITK_DIR_STRING}")
- ENDIF(ITK_FIND_REQUIRED)
-ENDIF(ITK_DIR)
+ELSEIF(ITK_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR ${ITK_DIR_MESSAGE})
+ELSEIF(NOT ITK_FIND_QUIETLY)
+ MESSAGE(STATUS ${ITK_DIR_MESSAGE})
+ENDIF()
diff --git a/Modules/FindPerlLibs.cmake b/Modules/FindPerlLibs.cmake
index 4cb026392a..0d620e3463 100644
--- a/Modules/FindPerlLibs.cmake
+++ b/Modules/FindPerlLibs.cmake
@@ -147,6 +147,32 @@ if (PERL_EXECUTABLE)
string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_VENDORLIB ${PERL_VENDORLIB_OUTPUT_VARIABLE})
endif (NOT PERL_VENDORLIB_RESULT_VARIABLE)
+ macro(perl_adjust_darwin_lib_variable varname)
+ string( TOUPPER PERL_${varname} FINDPERL_VARNAME )
+ string( TOLOWER install${varname} PERL_VARNAME )
+
+ if (NOT PERL_MINUSV_OUTPUT_VARIABLE)
+ execute_process(
+ COMMAND
+ ${PERL_EXECUTABLE} -V
+ OUTPUT_VARIABLE
+ PERL_MINUSV_OUTPUT_VARIABLE
+ RESULT_VARIABLE
+ PERL_MINUSV_RESULT_VARIABLE
+ )
+ endif()
+
+ if (NOT PERL_MINUSV_RESULT_VARIABLE)
+ string(REGEX MATCH "(${PERL_VARNAME}.*points? to the Updates directory)"
+ PERL_NEEDS_ADJUSTMENT ${PERL_MINUSV_OUTPUT_VARIABLE})
+
+ if (PERL_NEEDS_ADJUSTMENT)
+ string(REGEX REPLACE "(.*)/Updates/" "/System/\\1/" ${FINDPERL_VARNAME} ${${FINDPERL_VARNAME}})
+ endif (PERL_NEEDS_ADJUSTMENT)
+
+ endif (NOT PERL_MINUSV_RESULT_VARIABLE)
+ endmacro()
+
### PERL_ARCHLIB
execute_process(
COMMAND
@@ -158,6 +184,7 @@ if (PERL_EXECUTABLE)
)
if (NOT PERL_ARCHLIB_RESULT_VARIABLE)
string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_ARCHLIB ${PERL_ARCHLIB_OUTPUT_VARIABLE})
+ perl_adjust_darwin_lib_variable( ARCHLIB )
endif (NOT PERL_ARCHLIB_RESULT_VARIABLE)
### PERL_PRIVLIB
@@ -171,6 +198,7 @@ if (PERL_EXECUTABLE)
)
if (NOT PERL_PRIVLIB_RESULT_VARIABLE)
string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_PRIVLIB ${PERL_PRIVLIB_OUTPUT_VARIABLE})
+ perl_adjust_darwin_lib_variable( PRIVLIB )
endif (NOT PERL_PRIVLIB_RESULT_VARIABLE)
diff --git a/Modules/FindQt3.cmake b/Modules/FindQt3.cmake
index 3606a5f4f4..1319de27d9 100644
--- a/Modules/FindQt3.cmake
+++ b/Modules/FindQt3.cmake
@@ -242,9 +242,9 @@ IF (QT_MIN_VERSION)
ENDIF (QT_MIN_VERSION)
# if the include a library are found then we have it
-IF(QT_INCLUDE_DIR AND QT_QT_LIBRARY)
- SET( QT_FOUND "YES" )
-ENDIF(QT_INCLUDE_DIR AND QT_QT_LIBRARY)
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qt3 DEFAULT_MSG QT_QT_LIBRARY QT_INCLUDE_DIR QT_MOC_EXECUTABLE)
+SET(QT_FOUND ${QT3_FOUND} )
IF(QT_FOUND)
SET( QT_LIBRARIES ${QT_LIBRARIES} ${QT_QT_LIBRARY} )
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 45bbd2e583..6129329eea 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -482,7 +482,7 @@ IF (QT_QMAKE_EXECUTABLE)
_qt4_query_qmake(QT_VERSION QTVERSION)
# check for qt3 qmake and then try and find qmake4 or qmake-qt4 in the path
- IF("${QTVERSION}" MATCHES "Unknown")
+ IF(NOT QTVERSION)
SET(QT_QMAKE_EXECUTABLE NOTFOUND CACHE FILEPATH "" FORCE)
FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake4 qmake-qt4 PATHS
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin"
@@ -493,7 +493,7 @@ IF (QT_QMAKE_EXECUTABLE)
IF(QT_QMAKE_EXECUTABLE)
_qt4_query_qmake(QT_VERSION QTVERSION)
ENDIF(QT_QMAKE_EXECUTABLE)
- ENDIF("${QTVERSION}" MATCHES "Unknown")
+ ENDIF(NOT QTVERSION)
# check that we found the Qt4 qmake, Qt3 qmake output won't match here
STRING(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" qt_version_tmp "${QTVERSION}")
diff --git a/Modules/FindTCL.cmake b/Modules/FindTCL.cmake
index 8d780c14a6..8cfd9caeab 100644
--- a/Modules/FindTCL.cmake
+++ b/Modules/FindTCL.cmake
@@ -104,7 +104,7 @@ ENDIF(WIN32)
FIND_LIBRARY(TCL_LIBRARY
NAMES
tcl
- tcl${TK_LIBRARY_VERSION} tcl${TCL_TCLSH_VERSION} tcl${TK_WISH_VERSION}
+ tcl${TCL_LIBRARY_VERSION} tcl${TCL_TCLSH_VERSION} tcl${TK_WISH_VERSION}
tcl86 tcl8.6
tcl85 tcl8.5
tcl84 tcl8.4
@@ -117,7 +117,7 @@ FIND_LIBRARY(TCL_LIBRARY
FIND_LIBRARY(TK_LIBRARY
NAMES
tk
- tk${TCL_LIBRARY_VERSION} tk${TCL_TCLSH_VERSION} tk${TK_WISH_VERSION}
+ tk${TK_LIBRARY_VERSION} tk${TCL_TCLSH_VERSION} tk${TK_WISH_VERSION}
tk86 tk8.6
tk85 tk8.5
tk84 tk8.4
diff --git a/Modules/FortranCInterface/CMakeLists.txt b/Modules/FortranCInterface/CMakeLists.txt
index 18014af5a4..4bcaae916c 100644
--- a/Modules/FortranCInterface/CMakeLists.txt
+++ b/Modules/FortranCInterface/CMakeLists.txt
@@ -45,10 +45,12 @@ set(module_symbols
my_module_mp_my_sub_ # Intel
MY_MODULE_mp_MY_SUB # Intel on Windows
my_module_my_sub_ # PGI
+ my_module_MP_my_sub # NAG
mymodule$mysub # HP
mymodule_mp_mysub_ # Intel
MYMODULE_mp_MYSUB # Intel on Windows
mymodule_mysub_ # PGI
+ mymodule_MP_mysub # NAG
${FortranCInterface_MODULE_SYMBOLS}
)
list(REMOVE_DUPLICATES module_symbols)
diff --git a/Modules/Platform/CYGWIN.cmake b/Modules/Platform/CYGWIN.cmake
index b157f72154..1576982594 100644
--- a/Modules/Platform/CYGWIN.cmake
+++ b/Modules/Platform/CYGWIN.cmake
@@ -3,7 +3,7 @@ SET(CYGWIN 1)
SET(CMAKE_SHARED_LIBRARY_PREFIX "cyg")
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dll")
-SET(CMAKE_SHARED_MODULE_PREFIX "lib")
+SET(CMAKE_SHARED_MODULE_PREFIX "cyg")
SET(CMAKE_SHARED_MODULE_SUFFIX ".dll")
SET(CMAKE_IMPORT_LIBRARY_PREFIX "lib")
SET(CMAKE_IMPORT_LIBRARY_SUFFIX ".dll.a")
diff --git a/Modules/Platform/Darwin-NAG-Fortran.cmake b/Modules/Platform/Darwin-NAG-Fortran.cmake
new file mode 100644
index 0000000000..933f9e1a25
--- /dev/null
+++ b/Modules/Platform/Darwin-NAG-Fortran.cmake
@@ -0,0 +1,5 @@
+set(CMAKE_Fortran_VERBOSE_FLAG "-Wl,-v") # Runs gcc under the hood.
+
+# Need -fpp explicitly on case-insensitive filesystem.
+set(CMAKE_Fortran_COMPILE_OBJECT
+ "<CMAKE_Fortran_COMPILER> -fpp -o <OBJECT> <DEFINES> <FLAGS> -c <SOURCE>")
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index db0642e99a..a99ff4a1ce 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -33,8 +33,8 @@ SET(CMAKE_C_OSX_CURRENT_VERSION_FLAG "-current_version ")
SET(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}")
SET(CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}")
-SET(CMAKE_C_LINK_FLAGS "-headerpad_max_install_names")
-SET(CMAKE_CXX_LINK_FLAGS "-headerpad_max_install_names")
+SET(CMAKE_C_LINK_FLAGS "-Wl,-headerpad_max_install_names")
+SET(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names")
IF(HAVE_FLAG_SEARCH_PATHS_FIRST)
SET(CMAKE_C_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}")
@@ -42,8 +42,8 @@ IF(HAVE_FLAG_SEARCH_PATHS_FIRST)
ENDIF(HAVE_FLAG_SEARCH_PATHS_FIRST)
SET(CMAKE_PLATFORM_HAS_INSTALLNAME 1)
-SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -headerpad_max_install_names")
-SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -headerpad_max_install_names")
+SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names")
+SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "-bundle -Wl,-headerpad_max_install_names")
SET(CMAKE_SHARED_MODULE_LOADER_C_FLAG "-Wl,-bundle_loader,")
SET(CMAKE_SHARED_MODULE_LOADER_CXX_FLAG "-Wl,-bundle_loader,")
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dylib" ".so" ".a")
diff --git a/Modules/Platform/Linux-NAG-Fortran.cmake b/Modules/Platform/Linux-NAG-Fortran.cmake
new file mode 100644
index 0000000000..353bae6ddd
--- /dev/null
+++ b/Modules/Platform/Linux-NAG-Fortran.cmake
@@ -0,0 +1,10 @@
+set(CMAKE_Fortran_VERBOSE_FLAG "-Wl,-v") # Runs gcc under the hood.
+
+# Need one "-Wl," level to send flag through to gcc.
+# Use "-Xlinker" to get through gcc to real linker.
+set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-Wl,-shared")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG "-Wl,-Xlinker,-rpath,-Xlinker,")
+set(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP ":")
+set(CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG "-Wl,-Xlinker,-rpath-link,-Xlinker,")
+set(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG "-Wl,-Xlinker,-soname,-Xlinker,")
+set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-Wl,-rdynamic")
diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake
index 7463c62c5e..56582ff5dc 100644
--- a/Modules/Platform/Windows-cl.cmake
+++ b/Modules/Platform/Windows-cl.cmake
@@ -212,6 +212,8 @@ SET (CMAKE_EXE_LINKER_FLAGS_INIT
SET( MSVC_INCREMENTAL_YES_FLAG "")
IF(NOT MSVC_INCREMENTAL_DEFAULT)
SET( MSVC_INCREMENTAL_YES_FLAG "/INCREMENTAL:YES")
+ELSE()
+ SET( MSVC_INCREMENTAL_YES_FLAG "/INCREMENTAL" )
ENDIF()
IF (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
diff --git a/Modules/Qt4ConfigDependentSettings.cmake b/Modules/Qt4ConfigDependentSettings.cmake
index bfb50de0a9..10af3bc95f 100644
--- a/Modules/Qt4ConfigDependentSettings.cmake
+++ b/Modules/Qt4ConfigDependentSettings.cmake
@@ -35,10 +35,10 @@ SET(QT_QTHELP_LIB_DEPENDENCIES ${QT_QTCLUCENE_LIBRARY})
IF(Q_WS_WIN)
- # On Windows, qconfig.pri has "static" for static library builds
- IF(QT_CONFIG MATCHES "static")
+ # On Windows, qconfig.pri has "shared" for shared library builds
+ IF(NOT QT_CONFIG MATCHES "shared")
SET(QT_IS_STATIC 1)
- ENDIF(QT_CONFIG MATCHES "static")
+ ENDIF(NOT QT_CONFIG MATCHES "shared")
ELSE(Q_WS_WIN)
# On other platforms, check file extension to know if its static
IF(QT_QTCORE_LIBRARY_RELEASE)
@@ -75,6 +75,23 @@ IF(QT_QCONFIG MATCHES "system-png")
SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${PNG_LIBRARY})
ENDIF(QT_QCONFIG MATCHES "system-png")
+## system jpeg
+IF(QT_QCONFIG MATCHES "system-jpeg")
+ find_package(JPEG)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${JPEG_LIBRARIES})
+ENDIF(QT_QCONFIG MATCHES "system-jpeg")
+
+## system tiff
+IF(QT_QCONFIG MATCHES "system-tiff")
+ find_package(TIFF)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${TIFF_LIBRARIES})
+ENDIF(QT_QCONFIG MATCHES "system-tiff")
+
+## system mng
+IF(QT_QCONFIG MATCHES "system-mng")
+ find_library(MNG_LIBRARY NAMES mng)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${MNG_LIBRARY})
+ENDIF(QT_QCONFIG MATCHES "system-mng")
# for X11, get X11 library directory
IF(Q_WS_X11)
diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake
index 700d3a246b..6a609a0dd6 100644
--- a/Modules/Qt4Macros.cmake
+++ b/Modules/Qt4Macros.cmake
@@ -71,12 +71,12 @@ MACRO (QT4_GET_MOC_FLAGS _moc_flags)
GET_DIRECTORY_PROPERTY(_inc_DIRS INCLUDE_DIRECTORIES)
FOREACH(_current ${_inc_DIRS})
- IF("${_current}" MATCHES ".framework/?$")
- STRING(REGEX REPLACE "/[^/]+.framework" "" framework_path "${_current}")
+ IF("${_current}" MATCHES "\\.framework/?$")
+ STRING(REGEX REPLACE "/[^/]+\\.framework" "" framework_path "${_current}")
SET(${_moc_flags} ${${_moc_flags}} "-F${framework_path}")
- ELSE("${_current}" MATCHES ".framework/?$")
+ ELSE("${_current}" MATCHES "\\.framework/?$")
SET(${_moc_flags} ${${_moc_flags}} "-I${_current}")
- ENDIF("${_current}" MATCHES ".framework/?$")
+ ENDIF("${_current}" MATCHES "\\.framework/?$")
ENDFOREACH(_current ${_inc_DIRS})
GET_DIRECTORY_PROPERTY(_defines COMPILE_DEFINITIONS)
@@ -196,11 +196,16 @@ MACRO (QT4_ADD_RESOURCES outfiles )
ENDIF(NOT IS_ABSOLUTE "${_RC_FILE}")
SET(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}")
ENDFOREACH(_RC_FILE)
+ # Since this cmake macro is doing the dependency scanning for these files,
+ # let's make a configured file and add it as a dependency so cmake is run
+ # again when dependencies need to be recomputed.
+ QT4_MAKE_OUTPUT_FILE("${infile}" "" "qrc.depends" out_depends)
+ CONFIGURE_FILE("${infile}" "${out_depends}" COPY_ONLY)
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
COMMAND ${QT_RCC_EXECUTABLE}
ARGS ${rcc_options} -name ${outfilename} -o ${outfile} ${infile}
MAIN_DEPENDENCY ${infile}
- DEPENDS ${_RC_DEPENDS})
+ DEPENDS ${_RC_DEPENDS} "${out_depends}")
SET(${outfiles} ${${outfiles}} ${outfile})
ENDFOREACH (it)