diff options
Diffstat (limited to 'Modules')
60 files changed, 1037 insertions, 651 deletions
diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake index c7ead5b..44f2c20 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 0000000..9da7d30 --- /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 2b80c88..c7778fb 100644 --- a/Modules/CMakeCCompilerId.c.in +++ b/Modules/CMakeCCompilerId.c.in @@ -45,6 +45,9 @@ #elif defined(_CRAYC) # define COMPILER_ID "Cray" +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI_DSP" + #elif defined(__GNUC__) # define COMPILER_ID "GNU" @@ -88,7 +91,7 @@ getting matched. Store it in a pointer rather than an array because some compilers will just produce instructions to fill the array rather than assigning a pointer to a static array. */ -char* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; @CMAKE_C_COMPILER_ID_PLATFORM_CONTENT@ diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in index 91f116a..2ff227a 100644 --- a/Modules/CMakeCXXCompilerId.cpp.in +++ b/Modules/CMakeCXXCompilerId.cpp.in @@ -47,6 +47,9 @@ #elif defined(_CRAYC) # define COMPILER_ID "Cray" +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI_DSP" + #elif defined(__GNUC__) # define COMPILER_ID "GNU" @@ -79,7 +82,7 @@ getting matched. Store it in a pointer rather than an array because some compilers will just produce instructions to fill the array rather than assigning a pointer to a static array. */ -char* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; @CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT@ diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake index 06dd6b8..7a443e0 100644 --- a/Modules/CMakeDetermineASMCompiler.cmake +++ b/Modules/CMakeDetermineASMCompiler.cmake @@ -64,7 +64,11 @@ IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS GNU ) SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_GNU "--version") SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_GNU "GNU assembler") + LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS TI_DSP ) + SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_TI_DSP "-h") + SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_TI_DSP "Texas Instruments") + 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 0000000..d184c0a --- /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 d6df305..ed0b6fb 100644 --- a/Modules/CMakeDetermineCompilerABI.cmake +++ b/Modules/CMakeDetermineCompilerABI.cmake @@ -64,7 +64,8 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ABI lang src) AND NOT "${CMAKE_OSX_ARCHITECTURES}" MATCHES ";" # 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 03ddd78..5355886 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) @@ -215,6 +218,10 @@ ENDIF(NOT CMAKE_Fortran_COMPILER_ID_RUN) INCLUDE(CMakeFindBinUtils) +IF(MSVC_Fortran_ARCHITECTURE_ID) + SET(SET_MSVC_Fortran_ARCHITECTURE_ID + "SET(MSVC_Fortran_ARCHITECTURE_ID ${MSVC_Fortran_ARCHITECTURE_ID})") +ENDIF() # configure variables set in this file for fast reload later on CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake diff --git a/Modules/CMakeDetermineRCCompiler.cmake b/Modules/CMakeDetermineRCCompiler.cmake index 094b893..8e085af 100644 --- a/Modules/CMakeDetermineRCCompiler.cmake +++ b/Modules/CMakeDetermineRCCompiler.cmake @@ -54,6 +54,12 @@ ENDIF(NOT CMAKE_RC_COMPILER) MARK_AS_ADVANCED(CMAKE_RC_COMPILER) +GET_FILENAME_COMPONENT(_CMAKE_RC_COMPILER_NAME_WE ${CMAKE_RC_COMPILER} NAME_WE) +IF(_CMAKE_RC_COMPILER_NAME_WE STREQUAL "windres") + SET(CMAKE_RC_OUTPUT_EXTENSION .obj) +ELSE() + SET(CMAKE_RC_OUTPUT_EXTENSION .res) +ENDIF() # configure variables set in this file for fast reload later on CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeRCCompiler.cmake.in diff --git a/Modules/CMakeFindEclipseCDT4.cmake b/Modules/CMakeFindEclipseCDT4.cmake index 836e4c9..fbcdc98 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/CMakeFortranCompiler.cmake.in b/Modules/CMakeFortranCompiler.cmake.in index 5558651..146a6f2 100644 --- a/Modules/CMakeFortranCompiler.cmake.in +++ b/Modules/CMakeFortranCompiler.cmake.in @@ -2,6 +2,7 @@ SET(CMAKE_Fortran_COMPILER "@CMAKE_Fortran_COMPILER@") SET(CMAKE_Fortran_COMPILER_ARG1 "@CMAKE_Fortran_COMPILER_ARG1@") SET(CMAKE_Fortran_COMPILER_ID "@CMAKE_Fortran_COMPILER_ID@") SET(CMAKE_Fortran_PLATFORM_ID "@CMAKE_Fortran_PLATFORM_ID@") +@SET_MSVC_Fortran_ARCHITECTURE_ID@ SET(CMAKE_AR "@CMAKE_AR@") SET(CMAKE_RANLIB "@CMAKE_RANLIB@") SET(CMAKE_COMPILER_IS_GNUG77 @CMAKE_COMPILER_IS_GNUG77@) diff --git a/Modules/CMakeFortranCompilerId.F.in b/Modules/CMakeFortranCompilerId.F.in index 4080cc1..8584731 100644 --- a/Modules/CMakeFortranCompilerId.F.in +++ b/Modules/CMakeFortranCompilerId.F.in @@ -109,4 +109,13 @@ # endif PRINT *, 'INFO:platform[]' #endif +#if defined(_WIN32) && (defined(__INTEL_COMPILER) || defined(__ICC)) +# if defined(_M_IA64) + PRINT *, 'INFO:arch[IA64]' +# elif defined(_M_X64) || defined(_M_AMD64) + PRINT *, 'INFO:arch[x64]' +# elif defined(_M_IX86) + PRINT *, 'INFO:arch[X86]' +# endif +#endif END diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake index f6a52c6..1e9b4e0 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 defdb47..5405bda 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 e20348a..cb3f40a 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 */ @@ -109,6 +109,6 @@ getting matched. Store it in a pointer rather than an array because some compilers will just produce instructions to fill the array rather than assigning a pointer to a static array. */ -char* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; -char* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; diff --git a/Modules/CMakeRCCompiler.cmake.in b/Modules/CMakeRCCompiler.cmake.in index 93bc850..83428e2 100644 --- a/Modules/CMakeRCCompiler.cmake.in +++ b/Modules/CMakeRCCompiler.cmake.in @@ -2,5 +2,5 @@ SET(CMAKE_RC_COMPILER "@CMAKE_RC_COMPILER@") SET(CMAKE_RC_COMPILER_ARG1 "@CMAKE_RC_COMPILER_ARG1@") SET(CMAKE_RC_COMPILER_LOADED 1) SET(CMAKE_RC_SOURCE_FILE_EXTENSIONS rc) -SET(CMAKE_RC_OUTPUT_EXTENSION .res) +SET(CMAKE_RC_OUTPUT_EXTENSION @CMAKE_RC_OUTPUT_EXTENSION@) SET(CMAKE_RC_COMPILER_ENV_VAR "RC") diff --git a/Modules/CMakeTestASM-ATTCompiler.cmake b/Modules/CMakeTestASM-ATTCompiler.cmake index 3b7a74f..581ad0c 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 54def81..56cf332 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 84ca98f..8369b94 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 0000000..a5e2bea --- /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 3b50e74..dee576f 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/CPack.cmake b/Modules/CPack.cmake index 7033e31..797ee57 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -210,6 +210,11 @@ # CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Registry key used when # installing this project. # +# CPACK_NSIS_INSTALL_ROOT - The default installation directory presented +# to the end user by the NSIS installer is under this root dir. The full +# directory presented to the end user is: +# ${CPACK_NSIS_INSTALL_ROOT}/${CPACK_PACKAGE_INSTALL_DIRECTORY} +# # CPACK_NSIS_MUI_ICON - The icon file (.ico) for the generated # install program. # @@ -257,6 +262,14 @@ # CPACK_NSIS_DELETE_ICONS_EXTRA -Additional NSIS commands to # uninstall start menu shortcuts. # +# CPACK_NSIS_EXECUTABLES_DIRECTORY - Creating NSIS start menu links +# assumes that they are in 'bin' unless this variable is set. +# For example, you would set this to 'exec' if your executables are +# in an exec directory. +# +# CPACK_NSIS_MUI_FINISHPAGE_RUN - Specify an executable to add an option +# to run on the finish page of the NSIS installer. +# # The following variable is specific to installers build on Mac OS X # using PackageMaker: # @@ -777,6 +790,11 @@ IF(${__cpack_system_name} MATCHES Windows) ENDIF(${__cpack_system_name} MATCHES Windows) cpack_set_if_not_set(CPACK_SYSTEM_NAME "${__cpack_system_name}") +# Root dir: default value should be the string literal "$PROGRAMFILES" +# for backwards compatibility. Projects may set this value to anything. +set(__cpack_root_default "$PROGRAMFILES") +cpack_set_if_not_set(CPACK_NSIS_INSTALL_ROOT "${__cpack_root_default}") + # <project>-<major>.<minor>.<patch>-<release>-<platform>.<pkgtype> cpack_set_if_not_set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}") diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index e2d78802..026c45a 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 cf519b1..a03b64d 100644 --- a/Modules/CheckCCompilerFlag.cmake +++ b/Modules/CheckCCompilerFlag.cmake @@ -25,7 +25,7 @@ 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} + CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" ${_RESULT} # Some compilers do not fail with a bad flag FAIL_REGEX "unrecognized .*option" # GNU FAIL_REGEX "ignoring unknown option" # MSVC diff --git a/Modules/Compiler/NAG-Fortran.cmake b/Modules/Compiler/NAG-Fortran.cmake new file mode 100644 index 0000000..b68c479 --- /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 1be6cfd..a3590cf 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,6 +1266,14 @@ 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}") @@ -1242,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/FindBLAS.cmake b/Modules/FindBLAS.cmake index 94bbed5..d57513c 100644 --- a/Modules/FindBLAS.cmake +++ b/Modules/FindBLAS.cmake @@ -40,16 +40,11 @@ # License text for the above reference.) get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES) -if(NOT _LANGUAGES_ MATCHES Fortran) - if(BLAS_FIND_REQUIRED) - message(FATAL_ERROR "FindBLAS is Fortran-only so Fortran must be enabled.") - else(BLAS_FIND_REQUIRED) - message(STATUS "Looking for BLAS... - NOT found (Fortran not enabled)") # - return() - endif(BLAS_FIND_REQUIRED) -endif(NOT _LANGUAGES_ MATCHES Fortran) - +if (NOT _LANGUAGES_ MATCHES Fortran) +include(CheckFunctionExists) +else () include(CheckFortranFunctionExists) +endif() macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _threads) # This macro checks for the existence of the combination of fortran libraries @@ -107,7 +102,11 @@ if(_libraries_work) # Test this combination of libraries. set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_threads}) # message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}") - check_fortran_function_exists(${_name} ${_prefix}${_combined_name}_WORKS) + if (_LANGUAGES_ MATCHES Fortran) + check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS) + else() + check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS) + endif() set(CMAKE_REQUIRED_LIBRARIES) mark_as_advanced(${_prefix}${_combined_name}_WORKS) set(_libraries_work ${${_prefix}${_combined_name}_WORKS}) @@ -246,13 +245,24 @@ endif (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All") #BLAS in acml library? if (BLA_VENDOR STREQUAL "ACML" OR BLA_VENDOR STREQUAL "All") + # Either acml or acml_mp should be in LD_LIBRARY_PATH but not both if(NOT BLAS_LIBRARIES) check_fortran_libraries( BLAS_LIBRARIES BLAS sgemm "" - "acml" + "acml;acml_mv" + "" + ) + endif(NOT BLAS_LIBRARIES) + if(NOT BLAS_LIBRARIES) + check_fortran_libraries( + BLAS_LIBRARIES + BLAS + sgemm + "" + "acml_mp;acml_mv" "" ) endif(NOT BLAS_LIBRARIES) @@ -300,6 +310,9 @@ endif (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All") #BLAS in intel mkl 10 library? (em64t 64bit) if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") + if (NOT WIN32) + set(LM "-lm") + endif () if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX) if(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED) find_package(Threads) @@ -340,7 +353,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") sgemm "" "mkl_blas95;mkl_intel;mkl_intel_thread;mkl_core;guide" - "${CMAKE_THREAD_LIBS_INIT}" + "${CMAKE_THREAD_LIBS_INIT};${LM}" ) endif(NOT BLAS95_LIBRARIES) else(BLA_F95) @@ -352,6 +365,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") "" "mkl_intel;mkl_intel_thread;mkl_core;guide" "${CMAKE_THREAD_LIBS_INIT}" + "${LM}" ) endif(NOT BLAS_LIBRARIES) endif(BLA_F95) @@ -365,7 +379,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") sgemm "" "mkl_blas95;mkl_intel_lp64;mkl_intel_thread;mkl_core;guide" - "${CMAKE_THREAD_LIBS_INIT}" + "${CMAKE_THREAD_LIBS_INIT};${LM}" ) endif(NOT BLAS95_LIBRARIES) else(BLA_F95) @@ -376,7 +390,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") sgemm "" "mkl_intel_lp64;mkl_intel_thread;mkl_core;guide" - "${CMAKE_THREAD_LIBS_INIT}" + "${CMAKE_THREAD_LIBS_INIT};${LM}" ) endif(NOT BLAS_LIBRARIES) endif(BLA_F95) @@ -391,7 +405,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") sgemm "" "mkl;guide" - "${CMAKE_THREAD_LIBS_INIT}" + "${CMAKE_THREAD_LIBS_INIT};${LM}" ) endif(NOT BLAS_LIBRARIES) #BLAS in intel mkl library? (static, 32bit) @@ -402,7 +416,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") sgemm "" "mkl_ia32;guide" - "${CMAKE_THREAD_LIBS_INIT}" + "${CMAKE_THREAD_LIBS_INIT};${LM}" ) endif(NOT BLAS_LIBRARIES) #BLAS in intel mkl library? (static, em64t 64bit) @@ -413,7 +427,7 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") sgemm "" "mkl_em64t;guide" - "${CMAKE_THREAD_LIBS_INIT}" + "${CMAKE_THREAD_LIBS_INIT};${LM}" ) endif(NOT BLAS_LIBRARIES) endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX) diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 28296f1..f17e599 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -64,14 +64,15 @@ # 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 # omit the 3rd version number from include paths if it is 0 although not all # binary Boost releases do so. # -# SET(Boost_ADDITIONAL_VERSIONS "1.78" "1.78.0" "1.79" "1.79.0") +# set(Boost_ADDITIONAL_VERSIONS "1.78" "1.78.0" "1.79" "1.79.0") # # ===================================== ============= ======================== # @@ -163,6 +164,7 @@ # # These last three variables are available also as environment variables: +# Also, note they are completely UPPERCASE. # # BOOST_ROOT or BOOSTROOT The preferred installation prefix for searching for # Boost. Set this if the module has problems finding @@ -250,59 +252,59 @@ # And ELSE/ENDIF pairs were removed for readability. ######################################################################### -MACRO (_Boost_ADJUST_LIB_VARS basename) - IF (Boost_INCLUDE_DIR ) - IF (Boost_${basename}_LIBRARY_DEBUG AND Boost_${basename}_LIBRARY_RELEASE) +macro(_Boost_ADJUST_LIB_VARS basename) + if(Boost_INCLUDE_DIR ) + if(Boost_${basename}_LIBRARY_DEBUG AND Boost_${basename}_LIBRARY_RELEASE) # if the generator supports configuration types then set # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value - IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - SET(Boost_${basename}_LIBRARY optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG}) - ELSE() + if(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + set(Boost_${basename}_LIBRARY optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG}) + else() # if there are no configuration types and CMAKE_BUILD_TYPE has no value # then just use the release libraries - SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE} ) - ENDIF() + set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE} ) + endif() # FIXME: This probably should be set for both cases - SET(Boost_${basename}_LIBRARIES optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG}) - ENDIF() + set(Boost_${basename}_LIBRARIES optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG}) + endif() # if only the release version was found, set the debug variable also to the release version - IF (Boost_${basename}_LIBRARY_RELEASE AND NOT Boost_${basename}_LIBRARY_DEBUG) - SET(Boost_${basename}_LIBRARY_DEBUG ${Boost_${basename}_LIBRARY_RELEASE}) - SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE}) - SET(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_RELEASE}) - ENDIF() + if(Boost_${basename}_LIBRARY_RELEASE AND NOT Boost_${basename}_LIBRARY_DEBUG) + set(Boost_${basename}_LIBRARY_DEBUG ${Boost_${basename}_LIBRARY_RELEASE}) + set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE}) + set(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_RELEASE}) + endif() # if only the debug version was found, set the release variable also to the debug version - IF (Boost_${basename}_LIBRARY_DEBUG AND NOT Boost_${basename}_LIBRARY_RELEASE) - SET(Boost_${basename}_LIBRARY_RELEASE ${Boost_${basename}_LIBRARY_DEBUG}) - SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_DEBUG}) - SET(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_DEBUG}) - ENDIF() + if(Boost_${basename}_LIBRARY_DEBUG AND NOT Boost_${basename}_LIBRARY_RELEASE) + set(Boost_${basename}_LIBRARY_RELEASE ${Boost_${basename}_LIBRARY_DEBUG}) + set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_DEBUG}) + set(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_DEBUG}) + endif() - IF (Boost_${basename}_LIBRARY) + if(Boost_${basename}_LIBRARY) set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY} CACHE FILEPATH "The Boost ${basename} library") # Remove superfluous "debug" / "optimized" keywords from # Boost_LIBRARY_DIRS - FOREACH(_boost_my_lib ${Boost_${basename}_LIBRARY}) - GET_FILENAME_COMPONENT(_boost_my_lib_path "${_boost_my_lib}" PATH) - LIST(APPEND Boost_LIBRARY_DIRS ${_boost_my_lib_path}) - ENDFOREACH() - LIST(REMOVE_DUPLICATES Boost_LIBRARY_DIRS) + foreach(_boost_my_lib ${Boost_${basename}_LIBRARY}) + get_filename_component(_boost_my_lib_path "${_boost_my_lib}" PATH) + list(APPEND Boost_LIBRARY_DIRS ${_boost_my_lib_path}) + endforeach() + list(REMOVE_DUPLICATES Boost_LIBRARY_DIRS) set(Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIRS} CACHE FILEPATH "Boost library directory") - SET(Boost_${basename}_FOUND ON CACHE INTERNAL "Whether the Boost ${basename} library found") - ENDIF(Boost_${basename}_LIBRARY) + set(Boost_${basename}_FOUND ON CACHE INTERNAL "Whether the Boost ${basename} library found") + endif(Boost_${basename}_LIBRARY) - ENDIF (Boost_INCLUDE_DIR ) + endif(Boost_INCLUDE_DIR ) # Make variables changeble to the advanced user - MARK_AS_ADVANCED( + mark_as_advanced( Boost_${basename}_LIBRARY Boost_${basename}_LIBRARY_RELEASE Boost_${basename}_LIBRARY_DEBUG ) -ENDMACRO (_Boost_ADJUST_LIB_VARS) +endmacro(_Boost_ADJUST_LIB_VARS) #------------------------------------------------------------------------------- @@ -310,17 +312,17 @@ ENDMACRO (_Boost_ADJUST_LIB_VARS) # Runs compiler with "-dumpversion" and parses major/minor # version with a regex. # -FUNCTION(_Boost_COMPILER_DUMPVERSION _OUTPUT_VERSION) +function(_Boost_COMPILER_DUMPVERSION _OUTPUT_VERSION) - EXEC_PROGRAM(${CMAKE_CXX_COMPILER} + exec_program(${CMAKE_CXX_COMPILER} ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion OUTPUT_VARIABLE _boost_COMPILER_VERSION ) - STRING(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2" + string(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2" _boost_COMPILER_VERSION ${_boost_COMPILER_VERSION}) - SET(${_OUTPUT_VERSION} ${_boost_COMPILER_VERSION} PARENT_SCOPE) -ENDFUNCTION() + set(${_OUTPUT_VERSION} ${_boost_COMPILER_VERSION} PARENT_SCOPE) +endfunction() # # A convenience function for marking desired components @@ -355,6 +357,13 @@ function(_Boost_SWAP_WITH_REALPATH _library _docstring) endif() endfunction() +function(_Boost_CHECK_SPELLING _var) + if(${_var}) + string(TOUPPER ${_var} _var_UC) + message(FATAL_ERROR "ERROR: ${_var} is not the correct spelling. The proper spelling is ${_var_UC}.") + endif() +endfunction() + # # End functions/macros # @@ -363,9 +372,9 @@ endfunction() -IF(NOT DEFINED Boost_USE_MULTITHREADED) - SET(Boost_USE_MULTITHREADED TRUE) -ENDIF() +if(NOT DEFINED Boost_USE_MULTITHREADED) + set(Boost_USE_MULTITHREADED TRUE) +endif() if(Boost_FIND_VERSION_EXACT) # The version may appear in a directory with or without the patch @@ -377,7 +386,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") @@ -406,49 +415,47 @@ endif(Boost_FIND_VERSION_EXACT) # Boost. set(Boost_ERROR_REASON) -SET( _boost_IN_CACHE TRUE) -IF(Boost_INCLUDE_DIR) +set( _boost_IN_CACHE TRUE) +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() - FOREACH(COMPONENT ${Boost_FIND_COMPONENTS}) - STRING(TOUPPER ${COMPONENT} COMPONENT) - IF(NOT Boost_${COMPONENT}_FOUND) - SET( _boost_IN_CACHE FALSE) - ENDIF(NOT Boost_${COMPONENT}_FOUND) - ENDFOREACH(COMPONENT) -ELSE(Boost_INCLUDE_DIR) - SET( _boost_IN_CACHE FALSE) -ENDIF(Boost_INCLUDE_DIR) - -IF (_boost_IN_CACHE) + foreach(COMPONENT ${Boost_FIND_COMPONENTS}) + string(TOUPPER ${COMPONENT} COMPONENT) + if(NOT Boost_${COMPONENT}_FOUND) + set( _boost_IN_CACHE FALSE) + endif(NOT Boost_${COMPONENT}_FOUND) + endforeach(COMPONENT) +else(Boost_INCLUDE_DIR) + set( _boost_IN_CACHE FALSE) +endif(Boost_INCLUDE_DIR) + +if(_boost_IN_CACHE) # in cache already - SET(Boost_FOUND TRUE) - FOREACH(COMPONENT ${Boost_FIND_COMPONENTS}) - STRING(TOUPPER ${COMPONENT} COMPONENT) + set(Boost_FOUND TRUE) + foreach(COMPONENT ${Boost_FIND_COMPONENTS}) + string(TOUPPER ${COMPONENT} COMPONENT) _Boost_ADJUST_LIB_VARS( ${COMPONENT} ) - SET(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${COMPONENT}_LIBRARY}) - ENDFOREACH(COMPONENT) - SET(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIR}) - IF(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0") - MATH(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000") - MATH(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000") - MATH(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100") - ENDIF(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0") + set(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${COMPONENT}_LIBRARY}) + endforeach(COMPONENT) + set(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIR}) + if(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0") + math(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000") + math(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000") + math(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100") + endif(Boost_VERSION AND NOT "${Boost_VERSION}" STREQUAL "0") if(Boost_DEBUG) message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " "boost ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION} " "is already in the cache. To view debugging messages, please clear the cache.") endif() -ELSE (_boost_IN_CACHE) +else(_boost_IN_CACHE) # Need to search for boost if(Boost_DEBUG) message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " @@ -468,7 +475,7 @@ ELSE (_boost_IN_CACHE) "Boost_NO_SYSTEM_PATHS = ${Boost_NO_SYSTEM_PATHS}") endif() - IF(WIN32) + if(WIN32) # In windows, automatic linking is performed, so you do not have # to specify the libraries. If you are linking to a dynamic # runtime, then you can choose to link to either a static or a @@ -477,18 +484,18 @@ 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) + endif(WIN32) set(_boost_INCLUDE_SEARCH_DIRS_SYSTEM C:/boost/include @@ -498,36 +505,33 @@ ELSE (_boost_IN_CACHE) /sw/local/include ) - # If Boost_ROOT was defined, gently correct the user - if(Boost_ROOT) - message("WARNING: Boost_ROOT was set which is incorrect and is being ignored. " - "You need to use BOOST_ROOT instead. " - "Also, we suggest setting Boost_NO_SYSTEM_PATHS.") - endif() + _Boost_CHECK_SPELLING(Boost_ROOT) + _Boost_CHECK_SPELLING(Boost_LIBRARYDIR) + _Boost_CHECK_SPELLING(Boost_INCLUDEDIR) # If BOOST_ROOT was defined in the environment, use it. if (NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "") set(BOOST_ROOT $ENV{BOOST_ROOT}) - endif(NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "") + endif() # If BOOSTROOT was defined in the environment, use it. if (NOT BOOST_ROOT AND NOT $ENV{BOOSTROOT} STREQUAL "") set(BOOST_ROOT $ENV{BOOSTROOT}) - endif(NOT BOOST_ROOT AND NOT $ENV{BOOSTROOT} STREQUAL "") + endif() # If BOOST_INCLUDEDIR was defined in the environment, use it. - IF( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" ) + if( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" ) set(BOOST_INCLUDEDIR $ENV{BOOST_INCLUDEDIR}) - ENDIF( NOT $ENV{BOOST_INCLUDEDIR} STREQUAL "" ) - + endif() + # If BOOST_LIBRARYDIR was defined in the environment, use it. - IF( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" ) + if( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" ) set(BOOST_LIBRARYDIR $ENV{BOOST_LIBRARYDIR}) - ENDIF( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" ) - - IF( BOOST_ROOT ) + endif() + + if( BOOST_ROOT ) file(TO_CMAKE_PATH ${BOOST_ROOT} BOOST_ROOT) - ENDIF( BOOST_ROOT ) + endif() if(Boost_DEBUG) message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " @@ -563,33 +567,33 @@ 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. - IF( NOT Boost_INCLUDE_DIR ) + if( NOT Boost_INCLUDE_DIR ) # Build a list of path suffixes for each version. - SET(_boost_PATH_SUFFIXES) - FOREACH(_boost_VER ${_boost_TEST_VERSIONS}) + set(_boost_PATH_SUFFIXES) + foreach(_boost_VER ${_boost_TEST_VERSIONS}) # Add in a path suffix, based on the required version, ideally # we could read this from version.hpp, but for that to work we'd # need to know the include dir already set(_boost_BOOSTIFIED_VERSION) # 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" + if(_boost_VER MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+") + 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" + elseif(_boost_VER MATCHES "[0-9]+\\.[0-9]+") + string(REGEX REPLACE "([0-9]+)\\.([0-9]+)" "\\1_\\2" _boost_BOOSTIFIED_VERSION ${_boost_VER}) - ENDIF() - + endif() + list(APPEND _boost_PATH_SUFFIXES "boost-${_boost_BOOSTIFIED_VERSION}") list(APPEND _boost_PATH_SUFFIXES "boost_${_boost_BOOSTIFIED_VERSION}") - ENDFOREACH(_boost_VER) - + endforeach(_boost_VER) + if(Boost_DEBUG) message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " "Include debugging info:") @@ -600,62 +604,62 @@ ELSE (_boost_IN_CACHE) endif() # Look for a standard boost header file. - FIND_PATH(Boost_INCLUDE_DIR + find_path(Boost_INCLUDE_DIR NAMES boost/config.hpp HINTS ${_boost_INCLUDE_SEARCH_DIRS} PATH_SUFFIXES ${_boost_PATH_SUFFIXES} ${_boost_FIND_OPTIONS} ) - ENDIF( NOT Boost_INCLUDE_DIR ) - + endif( NOT Boost_INCLUDE_DIR ) + # ------------------------------------------------------------------------ # Extract version information from version.hpp # ------------------------------------------------------------------------ - IF(Boost_INCLUDE_DIR) + if(Boost_INCLUDE_DIR) # Extract Boost_VERSION and Boost_LIB_VERSION from version.hpp # Read the whole file: # - SET(BOOST_VERSION 0) - SET(BOOST_LIB_VERSION "") - FILE(READ "${Boost_INCLUDE_DIR}/boost/version.hpp" _boost_VERSION_HPP_CONTENTS) + set(BOOST_VERSION 0) + set(BOOST_LIB_VERSION "") + file(READ "${Boost_INCLUDE_DIR}/boost/version.hpp" _boost_VERSION_HPP_CONTENTS) if(Boost_DEBUG) 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") - MATH(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100") + + 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") + math(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100") set(Boost_ERROR_REASON "${Boost_ERROR_REASON}Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}") - ENDIF(NOT "${Boost_VERSION}" STREQUAL "0") + endif(NOT "${Boost_VERSION}" STREQUAL "0") if(Boost_DEBUG) message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " "version.hpp reveals boost " "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") endif() - ELSE(Boost_INCLUDE_DIR) + else(Boost_INCLUDE_DIR) 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) - + endif(Boost_INCLUDE_DIR) + # ------------------------------------------------------------------------ # Suffix initialization and compiler suffix detection. # ------------------------------------------------------------------------ # Setting some more suffixes for the library - SET (Boost_LIB_PREFIX "") + set(Boost_LIB_PREFIX "") if ( WIN32 AND Boost_USE_STATIC_LIBS AND NOT CYGWIN) - SET (Boost_LIB_PREFIX "lib") + set(Boost_LIB_PREFIX "lib") endif() if (Boost_COMPILER) @@ -670,7 +674,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") @@ -678,54 +682,54 @@ ELSE (_boost_IN_CACHE) set (_boost_COMPILER "-il") endif() elseif (MSVC90) - SET (_boost_COMPILER "-vc90") + set(_boost_COMPILER "-vc90") elseif (MSVC10) - SET (_boost_COMPILER "-vc100") + set(_boost_COMPILER "-vc100") elseif (MSVC80) - SET (_boost_COMPILER "-vc80") + set(_boost_COMPILER "-vc80") elseif (MSVC71) - SET (_boost_COMPILER "-vc71") + set(_boost_COMPILER "-vc71") elseif (MSVC70) # Good luck! - SET (_boost_COMPILER "-vc7") # yes, this is correct + set(_boost_COMPILER "-vc7") # yes, this is correct elseif (MSVC60) # Good luck! - SET (_boost_COMPILER "-vc6") # yes, this is correct + set(_boost_COMPILER "-vc6") # yes, this is correct elseif (BORLAND) - SET (_boost_COMPILER "-bcb") + set(_boost_COMPILER "-bcb") elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "SunPro") set(_boost_COMPILER "-sw") elseif (MINGW) if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34) - SET(_boost_COMPILER "-mgw") # no GCC version encoding prior to 1.34 + set(_boost_COMPILER "-mgw") # no GCC version encoding prior to 1.34 else() _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION) - SET (_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}") + set(_boost_COMPILER "-mgw${_boost_COMPILER_VERSION}") endif() elseif (UNIX) if (CMAKE_COMPILER_IS_GNUCXX) if(${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.34) - SET(_boost_COMPILER "-gcc") # no GCC version encoding prior to 1.34 + set(_boost_COMPILER "-gcc") # no GCC version encoding prior to 1.34 else() _Boost_COMPILER_DUMPVERSION(_boost_COMPILER_VERSION) # Determine which version of GCC we have. - IF(APPLE) - IF(Boost_MINOR_VERSION) - IF(${Boost_MINOR_VERSION} GREATER 35) + if(APPLE) + if(Boost_MINOR_VERSION) + if(${Boost_MINOR_VERSION} GREATER 35) # In Boost 1.36.0 and newer, the mangled compiler name used # on Mac OS X/Darwin is "xgcc". - SET(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}") - ELSE(${Boost_MINOR_VERSION} GREATER 35) + set(_boost_COMPILER "-xgcc${_boost_COMPILER_VERSION}") + else(${Boost_MINOR_VERSION} GREATER 35) # In Boost <= 1.35.0, there is no mangled compiler name for # the Mac OS X/Darwin version of GCC. - SET(_boost_COMPILER "") - ENDIF(${Boost_MINOR_VERSION} GREATER 35) - ELSE(Boost_MINOR_VERSION) + set(_boost_COMPILER "") + endif(${Boost_MINOR_VERSION} GREATER 35) + else(Boost_MINOR_VERSION) # We don't know the Boost version, so assume it's # pre-1.36.0. - SET(_boost_COMPILER "") - ENDIF(Boost_MINOR_VERSION) - ELSE() - SET (_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}") - ENDIF() + set(_boost_COMPILER "") + endif(Boost_MINOR_VERSION) + else() + set(_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}") + endif() endif() endif (CMAKE_COMPILER_IS_GNUCXX) endif() @@ -958,13 +962,13 @@ ELSE (_boost_IN_CACHE) # End finding boost libraries # ------------------------------------------------------------------------ - SET(Boost_INCLUDE_DIRS + set(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIR} ) - SET(Boost_FOUND FALSE) - IF(Boost_INCLUDE_DIR) - SET( Boost_FOUND TRUE ) + set(Boost_FOUND FALSE) + if(Boost_INCLUDE_DIR) + set( Boost_FOUND TRUE ) # Check the version of Boost against the requested version. if (Boost_FIND_VERSION AND NOT Boost_FIND_VERSION_MINOR) @@ -999,7 +1003,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) @@ -1018,7 +1022,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) @@ -1037,7 +1041,7 @@ ELSE (_boost_IN_CACHE) string(TOLOWER ${COMPONENT} COMPONENT) list(APPEND _Boost_MISSING_COMPONENTS ${COMPONENT}) set( Boost_FOUND FALSE) - endif(NOT Boost_${COMPONENT}_FOUND) + endif() endforeach(COMPONENT) if(Boost_DEBUG) @@ -1058,67 +1062,67 @@ ELSE (_boost_IN_CACHE) list(LENGTH _Boost_MISSING_COMPONENTS Boost_NUM_MISSING_COMPONENTS) if (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS}) set(Boost_ERROR_REASON - "${Boost_ERROR_REASON}No Boost libraries were found. You may need to set Boost_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.") + "${Boost_ERROR_REASON}No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.") else (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS}) set(Boost_ERROR_REASON - "${Boost_ERROR_REASON}Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set Boost_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.") + "${Boost_ERROR_REASON}Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.") endif (${Boost_NUM_COMPONENTS_WANTED} EQUAL ${Boost_NUM_MISSING_COMPONENTS}) endif (_Boost_MISSING_COMPONENTS) - IF( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT ) + if( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT ) # Compatibility Code for backwards compatibility with CMake # 2.4's FindBoost module. # Look for the boost library path. # 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$") + 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() + + 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") - IF(EXISTS "${_boost_LIB_DIR}/stage/lib") - SET(_boost_LIB_DIR ${_boost_LIB_DIR}/stage/lib) - ELSE(EXISTS "${_boost_LIB_DIR}/stage/lib") - 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}") + get_filename_component(_boost_LIB_DIR ${_boost_LIB_DIR} PATH) + endif() + + if(EXISTS "${_boost_LIB_DIR}/lib") + set(_boost_LIB_DIR ${_boost_LIB_DIR}/lib) + else() + if(EXISTS "${_boost_LIB_DIR}/stage/lib") + set(_boost_LIB_DIR ${_boost_LIB_DIR}/stage/lib) + else() + set(_boost_LIB_DIR "") + endif() + endif() + + if(_boost_LIB_DIR AND EXISTS "${_boost_LIB_DIR}") + set(Boost_LIBRARY_DIRS ${_boost_LIB_DIR} CACHE FILEPATH "Boost library directory") + endif() - ENDIF( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT ) + endif( NOT Boost_LIBRARY_DIRS AND NOT _boost_CHECKED_COMPONENT ) - ELSE(Boost_INCLUDE_DIR) - SET( Boost_FOUND FALSE) - ENDIF(Boost_INCLUDE_DIR) + else(Boost_INCLUDE_DIR) + set( Boost_FOUND FALSE) + endif(Boost_INCLUDE_DIR) - IF (Boost_FOUND) - IF (NOT Boost_FIND_QUIETLY) - MESSAGE(STATUS "Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") + if(Boost_FOUND) + if(NOT Boost_FIND_QUIETLY) + message(STATUS "Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") if(Boost_FIND_COMPONENTS) message(STATUS "Found the following Boost libraries:") endif() - ENDIF(NOT Boost_FIND_QUIETLY) - FOREACH ( COMPONENT ${Boost_FIND_COMPONENTS} ) - STRING( TOUPPER ${COMPONENT} UPPERCOMPONENT ) - IF ( Boost_${UPPERCOMPONENT}_FOUND ) - IF (NOT Boost_FIND_QUIETLY) - MESSAGE (STATUS " ${COMPONENT}") - ENDIF(NOT Boost_FIND_QUIETLY) - SET(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${UPPERCOMPONENT}_LIBRARY}) - ENDIF ( Boost_${UPPERCOMPONENT}_FOUND ) - ENDFOREACH(COMPONENT) + endif(NOT Boost_FIND_QUIETLY) + foreach( COMPONENT ${Boost_FIND_COMPONENTS} ) + string( TOUPPER ${COMPONENT} UPPERCOMPONENT ) + if( Boost_${UPPERCOMPONENT}_FOUND ) + if(NOT Boost_FIND_QUIETLY) + message (STATUS " ${COMPONENT}") + endif(NOT Boost_FIND_QUIETLY) + set(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${UPPERCOMPONENT}_LIBRARY}) + endif( Boost_${UPPERCOMPONENT}_FOUND ) + endforeach(COMPONENT) else() if(Boost_FIND_REQUIRED) message(SEND_ERROR "Unable to find the requested Boost libraries.\n${Boost_ERROR_REASON}") @@ -1138,9 +1142,8 @@ ELSE (_boost_IN_CACHE) endif() # show the Boost_INCLUDE_DIRS AND Boost_LIBRARIES variables only in the advanced view - MARK_AS_ADVANCED(Boost_INCLUDE_DIR + mark_as_advanced(Boost_INCLUDE_DIR Boost_INCLUDE_DIRS Boost_LIBRARY_DIRS ) -ENDIF(_boost_IN_CACHE) - +endif(_boost_IN_CACHE) diff --git a/Modules/FindBullet.cmake b/Modules/FindBullet.cmake index d10a388..a7c6de2 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 6a66d21..69104c5 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 d42e514..481e1e2 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/FindITK.cmake b/Modules/FindITK.cmake index 244ce54..5f43dd9 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/FindLAPACK.cmake b/Modules/FindLAPACK.cmake index 40effb0..bf45406 100644 --- a/Modules/FindLAPACK.cmake +++ b/Modules/FindLAPACK.cmake @@ -37,17 +37,12 @@ # License text for the above reference.) get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES) -if(NOT _LANGUAGES_ MATCHES Fortran) - if(LAPACK_FIND_REQUIRED) - message(FATAL_ERROR - "FindLAPACK is Fortran-only so Fortran must be enabled.") - else(LAPACK_FIND_REQUIRED) - message(STATUS "Looking for LAPACK... - NOT found (Fortran not enabled)") - return() - endif(LAPACK_FIND_REQUIRED) -endif(NOT _LANGUAGES_ MATCHES Fortran) - +if (NOT _LANGUAGES_ MATCHES Fortran) +include(CheckFunctionExists) +else (NOT _LANGUAGES_ MATCHES Fortran) include(CheckFortranFunctionExists) +endif (NOT _LANGUAGES_ MATCHES Fortran) + set(LAPACK_FOUND FALSE) set(LAPACK95_FOUND FALSE) @@ -112,7 +107,11 @@ if(_libraries_work) set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_blas} ${_threads}) endif(UNIX AND BLA_STATIC) # message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}") - check_fortran_function_exists(${_name} ${_prefix}${_combined_name}_WORKS) + if (NOT _LANGUAGES_ MATCHES Fortran) + check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS) + else (NOT _LANGUAGES_ MATCHES Fortran) + check_fortran_function_exists(${_name} ${_prefix}${_combined_name}_WORKS) + endif (NOT _LANGUAGES_ MATCHES Fortran) set(CMAKE_REQUIRED_LIBRARIES) mark_as_advanced(${_prefix}${_combined_name}_WORKS) set(_libraries_work ${${_prefix}${_combined_name}_WORKS}) @@ -157,7 +156,18 @@ if(BLAS_FOUND) LAPACK cheev "" - "acml" + "acml;acml_mv" + "" + "" + ) + endif(NOT LAPACK_LIBRARIES) + if(NOT LAPACK_LIBRARIES) + check_lapack_libraries( + LAPACK_LIBRARIES + LAPACK + cheev + "" + "acml_mp;acml_mv" "" "" ) diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake index 21aafa9..3618963 100644 --- a/Modules/FindOpenGL.cmake +++ b/Modules/FindOpenGL.cmake @@ -123,7 +123,6 @@ ELSE (WIN32) ENDIF(APPLE) ENDIF (WIN32) -SET( OPENGL_FOUND "NO" ) IF(OPENGL_gl_LIBRARY) IF(OPENGL_xmesa_INCLUDE_DIR) @@ -140,10 +139,7 @@ IF(OPENGL_gl_LIBRARY) SET( OPENGL_GLU_FOUND "NO" ) ENDIF(OPENGL_glu_LIBRARY) - SET( OPENGL_FOUND "YES" ) - # This deprecated setting is for backward compatibility with CMake1.4 - SET (OPENGL_LIBRARY ${OPENGL_LIBRARIES}) ENDIF(OPENGL_gl_LIBRARY) @@ -151,6 +147,11 @@ ENDIF(OPENGL_gl_LIBRARY) # This deprecated setting is for backward compatibility with CMake1.4 SET(OPENGL_INCLUDE_PATH ${OPENGL_INCLUDE_DIR}) +# handle the QUIETLY and REQUIRED arguments and set OPENGL_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenGL DEFAULT_MSG OPENGL_gl_LIBRARY) + MARK_AS_ADVANCED( OPENGL_INCLUDE_DIR OPENGL_xmesa_INCLUDE_DIR diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 6129329..d9d6ea7 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -1074,15 +1074,6 @@ IF (QT4_QMAKE_FOUND) ###################################### # - # Macros for building Qt files - # - ###################################### - - INCLUDE("${_qt4_current_dir}/Qt4Macros.cmake") - - - ###################################### - # # decide if Qt got found # ###################################### @@ -1118,6 +1109,89 @@ IF (QT4_QMAKE_FOUND) ####################################### # + # Check the plugins of Qt + # + ####################################### + + SET( QT_PLUGIN_TYPES accessible bearer codecs decorations designer gfxdrivers graphicssystems iconengines imageformats inputmethods mousedrivers phonon_backend script sqldrivers ) + + SET( QT_ACCESSIBLE_PLUGINS qtaccessiblecompatwidgets qtaccessiblewidgets ) + SET( QT_BEARER_PLUGINS qcorewlanbearer qgenericbearer ) + SET( QT_CODECS_PLUGINS qcncodecs qjpcodecs qkrcodecs qtwcodecs ) + SET( QT_DECORATIONS_PLUGINS qdecorationdefault qdecorationwindows ) + SET( QT_DESIGNER_PLUGINS arthurplugin containerextension customwidgetplugin phononwidgets qdeclarativeview qt3supportwidgets qwebview taskmenuextension worldtimeclockplugin ) + SET( QT_GRAPHICSDRIVERS_PLUGINS qgfxtransformed qgfxvnc qscreenvfb ) + SET( QT_GRAPHICSSYSTEMS_PLUGINS qglgraphicssystem qtracegraphicssystem ) + SET( QT_ICONENGINES_PLUGINS qsvgicon ) + SET( QT_IMAGEFORMATS_PLUGINS qgif qjpeg qmng qico qsvg qtiff ) + SET( QT_INPUTMETHODS_PLUGINS qimsw_multi ) + SET( QT_MOUSEDRIVERS_PLUGINS qwstslibmousehandler ) + SET( QT_PHONON_BACKEND_PLUGINS phonon_qt7 ) + SET( QT_SCRIPT_PLUGINS qtscriptdbus ) + SET( QT_SQLDRIVERS_PLUGINS qsqldb2 qsqlibase qsqlite qsqlite2 qsqlmysql qsqloci qsqlodbc qsqlpsql qsqltds ) + + IF(QT_QMAKE_CHANGED) + FOREACH(QT_PLUGIN_TYPE ${QT_PLUGIN_TYPES}) + STRING(TOUPPER ${QT_PLUGIN_TYPE} _upper_qt_plugin_type) + SET(QT_${_upper_qt_plugin_type}_PLUGINS_DIR ${QT_PLUGINS_DIR}/${QT_PLUGIN_TYPE}) + FOREACH(QT_PLUGIN ${QT_${_upper_qt_plugin_type}_PLUGINS}) + STRING(TOUPPER ${QT_PLUGIN} _upper_qt_plugin) + UNSET(QT_${_upper_qt_plugin}_LIBRARY_RELEASE CACHE) + UNSET(QT_${_upper_qt_plugin}_LIBRARY_DEBUG CACHE) + UNSET(QT_${_upper_qt_plugin}_LIBRARY CACHE) + UNSET(QT_${_upper_qt_plugin}_PLUGIN_RELEASE CACHE) + UNSET(QT_${_upper_qt_plugin}_PLUGIN_DEBUG CACHE) + UNSET(QT_${_upper_qt_plugin}_PLUGIN CACHE) + ENDFOREACH(QT_PLUGIN) + ENDFOREACH(QT_PLUGIN_TYPE) + ENDIF(QT_QMAKE_CHANGED) + + # find_library works better than find_file but we need to set prefixes to only match plugins + FOREACH(QT_PLUGIN_TYPE ${QT_PLUGIN_TYPES}) + STRING(TOUPPER ${QT_PLUGIN_TYPE} _upper_qt_plugin_type) + SET(QT_${_upper_qt_plugin_type}_PLUGINS_DIR ${QT_PLUGINS_DIR}/${QT_PLUGIN_TYPE}) + FOREACH(QT_PLUGIN ${QT_${_upper_qt_plugin_type}_PLUGINS}) + STRING(TOUPPER ${QT_PLUGIN} _upper_qt_plugin) + IF(QT_IS_STATIC) + FIND_LIBRARY(QT_${_upper_qt_plugin}_LIBRARY_RELEASE + NAMES ${QT_PLUGIN}${QT_LIBINFIX} ${QT_PLUGIN}${QT_LIBINFIX}4 + PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH + ) + FIND_LIBRARY(QT_${_upper_qt_plugin}_LIBRARY_DEBUG + NAMES ${QT_PLUGIN}${QT_LIBINFIX}_debug ${QT_PLUGIN}${QT_LIBINFIX}d ${QT_PLUGIN}${QT_LIBINFIX}d4 + PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH + ) + _QT4_ADJUST_LIB_VARS(${QT_PLUGIN}) + ELSE(QT_IS_STATIC) + # find_library works easier/better than find_file but we need to set suffixes to only match plugins + SET(CMAKE_FIND_LIBRARY_SUFFIXES_DEFAULT ${CMAKE_FIND_LIBRARY_SUFFIXES}) + SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_MODULE_SUFFIX} ${CMAKE_SHARED_LIBRARY_SUFFIX}) + FIND_LIBRARY(QT_${_upper_qt_plugin}_PLUGIN_RELEASE + NAMES ${QT_PLUGIN}${QT_LIBINFIX} ${QT_PLUGIN}${QT_LIBINFIX}4 + PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH + ) + FIND_LIBRARY(QT_${_upper_qt_plugin}_PLUGIN_DEBUG + NAMES ${QT_PLUGIN}${QT_LIBINFIX}_debug ${QT_PLUGIN}${QT_LIBINFIX}d ${QT_PLUGIN}${QT_LIBINFIX}d4 + PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH + ) + MARK_AS_ADVANCED(QT_${_upper_qt_plugin}_PLUGIN_RELEASE QT_${_upper_qt_plugin}_PLUGIN_DEBUG) + SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_DEFAULT}) + ENDIF(QT_IS_STATIC) + ENDFOREACH(QT_PLUGIN) + ENDFOREACH(QT_PLUGIN_TYPE) + + + ###################################### + # + # Macros for building Qt files + # + ###################################### + + INCLUDE("${_qt4_current_dir}/Qt4Macros.cmake") + + + ####################################### + # # compatibility settings # ####################################### diff --git a/Modules/FindTCL.cmake b/Modules/FindTCL.cmake index 314d706..b206c9a 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 18014af..4bcaae9 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/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake index b60fed8..4564e74 100644 --- a/Modules/InstallRequiredSystemLibraries.cmake +++ b/Modules/InstallRequiredSystemLibraries.cmake @@ -1,16 +1,21 @@ -# By including this file, all files in the CMAKE_INSTALL_DEBUG_LIBRARIES, -# will be installed with INSTALL_PROGRAMS into /bin for WIN32 and /lib -# for non-win32. If CMAKE_SKIP_INSTALL_RULES is set to TRUE before including -# this file, then the INSTALL command is not called. The user can use -# the variable CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS to use a custom install -# command and install them into any directory they want. +# By including this file, all library files listed in the variable +# CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS will be installed with +# INSTALL(PROGRAMS ...) into bin for WIN32 and lib +# for non-WIN32. If CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP is set to TRUE +# before including this file, then the INSTALL command is not called. +# The user can use the variable CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS to use a +# custom install command and install them however they want. # If it is the MSVC compiler, then the microsoft run # time libraries will be found and automatically added to the -# CMAKE_INSTALL_DEBUG_LIBRARIES, and installed. +# CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS, and installed. # If CMAKE_INSTALL_DEBUG_LIBRARIES is set and it is the MSVC # compiler, then the debug libraries are installed when available. +# If CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY is set then only the debug +# libraries are installed when both debug and release are available. # If CMAKE_INSTALL_MFC_LIBRARIES is set then the MFC run time # libraries are installed as well as the CRT run time libraries. +# If CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION is set then the libraries are +# installed to that directory rather than the default. #============================================================================= # Copyright 2006-2009 Kitware, Inc. @@ -63,12 +68,14 @@ IF(MSVC) # Install the manifest that allows DLLs to be loaded from the # directory containing the executable. - SET(__install__libs - "${MSVC80_CRT_DIR}/Microsoft.VC80.CRT.manifest" - "${MSVC80_CRT_DIR}/msvcm80.dll" - "${MSVC80_CRT_DIR}/msvcp80.dll" - "${MSVC80_CRT_DIR}/msvcr80.dll" - ) + IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) + SET(__install__libs + "${MSVC80_CRT_DIR}/Microsoft.VC80.CRT.manifest" + "${MSVC80_CRT_DIR}/msvcm80.dll" + "${MSVC80_CRT_DIR}/msvcp80.dll" + "${MSVC80_CRT_DIR}/msvcr80.dll" + ) + ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) IF(CMAKE_INSTALL_DEBUG_LIBRARIES) SET(MSVC80_CRT_DIR @@ -96,12 +103,15 @@ IF(MSVC) # Install the manifest that allows DLLs to be loaded from the # directory containing the executable. - SET(__install__libs - "${MSVC90_CRT_DIR}/Microsoft.VC90.CRT.manifest" - "${MSVC90_CRT_DIR}/msvcm90.dll" - "${MSVC90_CRT_DIR}/msvcp90.dll" - "${MSVC90_CRT_DIR}/msvcr90.dll" - ) + IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) + SET(__install__libs + "${MSVC90_CRT_DIR}/Microsoft.VC90.CRT.manifest" + "${MSVC90_CRT_DIR}/msvcm90.dll" + "${MSVC90_CRT_DIR}/msvcp90.dll" + "${MSVC90_CRT_DIR}/msvcr90.dll" + ) + ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) + IF(CMAKE_INSTALL_DEBUG_LIBRARIES) SET(MSVC90_CRT_DIR "${MSVC90_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugCRT") @@ -111,8 +121,8 @@ IF(MSVC) "${MSVC90_CRT_DIR}/msvcp90d.dll" "${MSVC90_CRT_DIR}/msvcr90d.dll" ) - ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES) - ENDIF(MSVC90) + ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES) + ENDIF(MSVC90) IF(MSVC10) # Find the runtime library redistribution directory. @@ -126,11 +136,14 @@ IF(MSVC) # Install the manifest that allows DLLs to be loaded from the # directory containing the executable. - SET(__install__libs - "${MSVC10_CRT_DIR}/Microsoft.VC100.CRT.manifest" - "${MSVC10_CRT_DIR}/msvcp100.dll" - "${MSVC10_CRT_DIR}/msvcr100.dll" - ) + IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) + SET(__install__libs + "${MSVC10_CRT_DIR}/Microsoft.VC100.CRT.manifest" + "${MSVC10_CRT_DIR}/msvcp100.dll" + "${MSVC10_CRT_DIR}/msvcr100.dll" + ) + ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) + IF(CMAKE_INSTALL_DEBUG_LIBRARIES) SET(MSVC10_CRT_DIR "${MSVC10_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugCRT") @@ -139,7 +152,7 @@ IF(MSVC) "${MSVC10_CRT_DIR}/msvcp100d.dll" "${MSVC10_CRT_DIR}/msvcr100d.dll" ) - ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES) + ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES) ENDIF(MSVC10) IF(CMAKE_INSTALL_MFC_LIBRARIES) @@ -165,17 +178,20 @@ IF(MSVC) "${MSVC80_MFC_DIR}/mfcm80ud.dll" ) ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES) - + SET(MSVC80_MFC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFC") # Install the manifest that allows DLLs to be loaded from the # directory containing the executable. - SET(__install__libs ${__install__libs} - "${MSVC80_MFC_DIR}/Microsoft.VC80.MFC.manifest" - "${MSVC80_MFC_DIR}/mfc80.dll" - "${MSVC80_MFC_DIR}/mfc80u.dll" - "${MSVC80_MFC_DIR}/mfcm80.dll" - "${MSVC80_MFC_DIR}/mfcm80u.dll" - ) + IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) + SET(__install__libs ${__install__libs} + "${MSVC80_MFC_DIR}/Microsoft.VC80.MFC.manifest" + "${MSVC80_MFC_DIR}/mfc80.dll" + "${MSVC80_MFC_DIR}/mfc80u.dll" + "${MSVC80_MFC_DIR}/mfcm80.dll" + "${MSVC80_MFC_DIR}/mfcm80u.dll" + ) + ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) + # include the language dll's for vs8 as well as the actuall dll's SET(MSVC80_MFCLOC_DIR "${MSVC80_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFCLOC") # Install the manifest that allows DLLs to be loaded from the @@ -206,17 +222,20 @@ IF(MSVC) "${MSVC90_MFC_DIR}/mfcm90ud.dll" ) ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES) - + SET(MSVC90_MFC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFC") # Install the manifest that allows DLLs to be loaded from the # directory containing the executable. - SET(__install__libs ${__install__libs} - "${MSVC90_MFC_DIR}/Microsoft.VC90.MFC.manifest" - "${MSVC90_MFC_DIR}/mfc90.dll" - "${MSVC90_MFC_DIR}/mfc90u.dll" - "${MSVC90_MFC_DIR}/mfcm90.dll" - "${MSVC90_MFC_DIR}/mfcm90u.dll" - ) + IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) + SET(__install__libs ${__install__libs} + "${MSVC90_MFC_DIR}/Microsoft.VC90.MFC.manifest" + "${MSVC90_MFC_DIR}/mfc90.dll" + "${MSVC90_MFC_DIR}/mfc90u.dll" + "${MSVC90_MFC_DIR}/mfcm90.dll" + "${MSVC90_MFC_DIR}/mfcm90u.dll" + ) + ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) + # include the language dll's for vs9 as well as the actuall dll's SET(MSVC90_MFCLOC_DIR "${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFCLOC") # Install the manifest that allows DLLs to be loaded from the @@ -247,17 +266,20 @@ IF(MSVC) "${MSVC10_MFC_DIR}/mfcm100ud.dll" ) ENDIF(CMAKE_INSTALL_DEBUG_LIBRARIES) - + SET(MSVC10_MFC_DIR "${MSVC10_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC100.MFC") # Install the manifest that allows DLLs to be loaded from the # directory containing the executable. - SET(__install__libs ${__install__libs} - "${MSVC10_MFC_DIR}/Microsoft.VC100.MFC.manifest" - "${MSVC10_MFC_DIR}/mfc100.dll" - "${MSVC10_MFC_DIR}/mfc100u.dll" - "${MSVC10_MFC_DIR}/mfcm100.dll" - "${MSVC10_MFC_DIR}/mfcm100u.dll" - ) + IF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) + SET(__install__libs ${__install__libs} + "${MSVC10_MFC_DIR}/Microsoft.VC100.MFC.manifest" + "${MSVC10_MFC_DIR}/mfc100.dll" + "${MSVC10_MFC_DIR}/mfc100u.dll" + "${MSVC10_MFC_DIR}/mfcm100.dll" + "${MSVC10_MFC_DIR}/mfcm100u.dll" + ) + ENDIF(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY) + # include the language dll's for vs10 as well as the actuall dll's SET(MSVC10_MFCLOC_DIR "${MSVC10_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC100.MFCLOC") # Install the manifest that allows DLLs to be loaded from the @@ -292,10 +314,14 @@ ENDIF(MSVC) # specified by CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS. IF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS) IF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP) - IF(WIN32) - INSTALL_PROGRAMS(/bin ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}) - ELSE(WIN32) - INSTALL_PROGRAMS(/lib ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}) - ENDIF(WIN32) + IF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION) + IF(WIN32) + SET(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION bin) + ELSE(WIN32) + SET(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION lib) + ENDIF(WIN32) + ENDIF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION) + INSTALL(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} + DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION}) ENDIF(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP) ENDIF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS) diff --git a/Modules/NSIS.template.in b/Modules/NSIS.template.in index 776bc07..df9d2d3 100644 --- a/Modules/NSIS.template.in +++ b/Modules/NSIS.template.in @@ -25,7 +25,7 @@ !include "MUI.nsh" ;Default installation folder - InstallDir "$PROGRAMFILES\@CPACK_PACKAGE_INSTALL_DIRECTORY@" + InstallDir "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_INSTALL_DIRECTORY@" ;-------------------------------- ;General @@ -540,6 +540,7 @@ FunctionEnd @CPACK_NSIS_INSTALLER_MUI_ICON_CODE@ @CPACK_NSIS_INSTALLER_ICON_CODE@ @CPACK_NSIS_INSTALLER_MUI_COMPONENTS_DESC@ +@CPACK_NSIS_INSTALLER_MUI_FINISHPAGE_RUN_CODE@ ;-------------------------------- ;Pages @@ -906,7 +907,7 @@ Function .onInit ; install directory that is expected to be the ; default StrCpy $IS_DEFAULT_INSTALLDIR 0 - StrCmp "$INSTDIR" "$PROGRAMFILES\@CPACK_PACKAGE_INSTALL_DIRECTORY@" 0 +2 + StrCmp "$INSTDIR" "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_INSTALL_DIRECTORY@" 0 +2 StrCpy $IS_DEFAULT_INSTALLDIR 1 StrCpy $SV_ALLUSERS "JustMe" @@ -939,7 +940,7 @@ Function .onInit done: StrCmp $SV_ALLUSERS "AllUsers" 0 +3 StrCmp "$IS_DEFAULT_INSTALLDIR" "1" 0 +2 - StrCpy $INSTDIR "$PROGRAMFILES\@CPACK_PACKAGE_INSTALL_DIRECTORY@" + StrCpy $INSTDIR "@CPACK_NSIS_INSTALL_ROOT@\@CPACK_PACKAGE_INSTALL_DIRECTORY@" StrCmp "@CPACK_NSIS_MODIFY_PATH@" "ON" 0 noOptionsPage !insertmacro MUI_INSTALLOPTIONS_EXTRACT "NSIS.InstallOptions.ini" diff --git a/Modules/Platform/CYGWIN-GNU.cmake b/Modules/Platform/CYGWIN-GNU.cmake index 6f72a75..5aad45b 100644 --- a/Modules/Platform/CYGWIN-GNU.cmake +++ b/Modules/Platform/CYGWIN-GNU.cmake @@ -24,7 +24,8 @@ set(CMAKE_CREATE_WIN32_EXE "-mwindows") set(CMAKE_GNULD_IMAGE_VERSION "-Wl,--major-image-version,<TARGET_VERSION_MAJOR>,--minor-image-version,<TARGET_VERSION_MINOR>") - +set(CMAKE_GENERATOR_RC windres) +enable_language(RC) macro(__cygwin_compiler_gnu lang) # Binary link rules. set(CMAKE_${lang}_CREATE_SHARED_MODULE diff --git a/Modules/Platform/CYGWIN-windres.cmake b/Modules/Platform/CYGWIN-windres.cmake new file mode 100644 index 0000000..8bc1b15 --- /dev/null +++ b/Modules/Platform/CYGWIN-windres.cmake @@ -0,0 +1 @@ +SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <FLAGS> <DEFINES> <SOURCE> <OBJECT>") diff --git a/Modules/Platform/CYGWIN.cmake b/Modules/Platform/CYGWIN.cmake index b157f72..b7ad2ce 100644 --- a/Modules/Platform/CYGWIN.cmake +++ b/Modules/Platform/CYGWIN.cmake @@ -1,9 +1,53 @@ -SET(WIN32 1) +if("${CMAKE_MINIMUM_REQUIRED_VERSION}" VERSION_LESS "2.8.3.20101214") + set(__USE_CMAKE_LEGACY_CYGWIN_WIN32 1) +endif() +if(NOT DEFINED WIN32) + set(WIN32 0) + if(DEFINED __USE_CMAKE_LEGACY_CYGWIN_WIN32) + if(NOT DEFINED CMAKE_LEGACY_CYGWIN_WIN32 + AND DEFINED ENV{CMAKE_LEGACY_CYGWIN_WIN32}) + set(CMAKE_LEGACY_CYGWIN_WIN32 $ENV{CMAKE_LEGACY_CYGWIN_WIN32}) + endif() + if(CMAKE_LEGACY_CYGWIN_WIN32) + message(STATUS "Defining WIN32 under Cygwin due to CMAKE_LEGACY_CYGWIN_WIN32") + set(WIN32 1) + elseif("x${CMAKE_LEGACY_CYGWIN_WIN32}" STREQUAL "x") + message(WARNING "CMake no longer defines WIN32 on Cygwin!" + "\n" + "(1) If you are just trying to build this project, ignore this warning " + "or quiet it by setting CMAKE_LEGACY_CYGWIN_WIN32=0 in your environment or " + "in the CMake cache. " + "If later configuration or build errors occur then this project may " + "have been written under the assumption that Cygwin is WIN32. " + "In that case, set CMAKE_LEGACY_CYGWIN_WIN32=1 instead." + "\n" + "(2) If you are developing this project, add the line\n" + " set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required\n" + "at the top of your top-level CMakeLists.txt file or set the minimum " + "required version of CMake to 2.8.4 or higher. " + "Then teach your project to build on Cygwin without WIN32.") + endif() + elseif(DEFINED CMAKE_LEGACY_CYGWIN_WIN32) + message(AUTHOR_WARNING "CMAKE_LEGACY_CYGWIN_WIN32 ignored because\n" + " cmake_minimum_required(VERSION ${CMAKE_MINIMUM_REQUIRED_VERSION})\n" + "is at least 2.8.4.") + endif() +endif() +if(DEFINED __USE_CMAKE_LEGACY_CYGWIN_WIN32) + # Pass WIN32 legacy setting to scripts. + if(WIN32) + set(ENV{CMAKE_LEGACY_CYGWIN_WIN32} 1) + else() + set(ENV{CMAKE_LEGACY_CYGWIN_WIN32} 0) + endif() + unset(__USE_CMAKE_LEGACY_CYGWIN_WIN32) +endif() + 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-GNU.cmake b/Modules/Platform/Darwin-GNU.cmake index f425eb9..8a50a6a 100644 --- a/Modules/Platform/Darwin-GNU.cmake +++ b/Modules/Platform/Darwin-GNU.cmake @@ -20,8 +20,8 @@ set(__DARWIN_COMPILER_GNU 1) macro(__darwin_compiler_gnu lang) # GNU does not have -shared on OS X - set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-dynamiclib -headerpad_max_install_names") - set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS "-bundle -headerpad_max_install_names") + set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names") + set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS "-bundle -Wl,-headerpad_max_install_names") endmacro() macro(cmake_gnu_has_isysroot lang) diff --git a/Modules/Platform/Darwin-NAG-Fortran.cmake b/Modules/Platform/Darwin-NAG-Fortran.cmake new file mode 100644 index 0000000..933f9e1 --- /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-icc.cmake b/Modules/Platform/Darwin-icc.cmake index 49aa843..b62036c 100644 --- a/Modules/Platform/Darwin-icc.cmake +++ b/Modules/Platform/Darwin-icc.cmake @@ -33,11 +33,11 @@ SET(CMAKE_SHARED_MODULE_PREFIX "lib") SET(CMAKE_SHARED_MODULE_SUFFIX ".so") SET(CMAKE_MODULE_EXISTS 1) SET(CMAKE_DL_LIBS "") -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") 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_FIND_LIBRARY_SUFFIXES ".dylib" ".so" ".a") diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index db0642e..a99ff4a 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 0000000..353bae6 --- /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-GNU.cmake b/Modules/Platform/Windows-GNU.cmake index ac635a5..7084b83 100644 --- a/Modules/Platform/Windows-GNU.cmake +++ b/Modules/Platform/Windows-GNU.cmake @@ -56,6 +56,8 @@ if("${_help}" MATCHES "GNU ld .* 2\\.1[1-6]") set(__WINDOWS_GNU_LD_RESPONSE 0) endif() +enable_language(RC) + macro(__windows_compiler_gnu lang) if(MSYS OR MINGW) diff --git a/Modules/Platform/Windows-Intel-C.cmake b/Modules/Platform/Windows-Intel-C.cmake new file mode 100644 index 0000000..767fec5 --- /dev/null +++ b/Modules/Platform/Windows-Intel-C.cmake @@ -0,0 +1,2 @@ +include(Platform/Windows-Intel) +__windows_compiler_intel(C) diff --git a/Modules/Platform/Windows-Intel-CXX.cmake b/Modules/Platform/Windows-Intel-CXX.cmake new file mode 100644 index 0000000..2845b0f --- /dev/null +++ b/Modules/Platform/Windows-Intel-CXX.cmake @@ -0,0 +1,4 @@ +include(Platform/Windows-Intel) +set(_COMPILE_CXX " /TP") +set(_FLAGS_CXX " /GX /GR") +__windows_compiler_intel(CXX) diff --git a/Modules/Platform/Windows-Intel-Fortran.cmake b/Modules/Platform/Windows-Intel-Fortran.cmake new file mode 100644 index 0000000..c959287 --- /dev/null +++ b/Modules/Platform/Windows-Intel-Fortran.cmake @@ -0,0 +1,11 @@ +include(Platform/Windows-Intel) +set(CMAKE_BUILD_TYPE_INIT Debug) +set(_COMPILE_Fortran " /fpp") +set(CMAKE_Fortran_MODDIR_FLAG "-module:") +set(CMAKE_Fortran_STANDARD_LIBRARIES_INIT "user32.lib") +__windows_compiler_intel(Fortran) +SET (CMAKE_Fortran_FLAGS_INIT "/W1 /nologo /fpp /libs:dll /threads") +SET (CMAKE_Fortran_FLAGS_DEBUG_INIT "/debug:full /dbglibs") +SET (CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "/O2 /D NDEBUG") +SET (CMAKE_Fortran_FLAGS_RELEASE_INIT "/O1 /D NDEBUG") +SET (CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "/O1 /debug:full /D NDEBUG") diff --git a/Modules/Platform/Windows-Intel.cmake b/Modules/Platform/Windows-Intel.cmake index e893925..e7462ba 100644 --- a/Modules/Platform/Windows-Intel.cmake +++ b/Modules/Platform/Windows-Intel.cmake @@ -1,3 +1,66 @@ + +#============================================================================= +# Copyright 2002-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 module is shared by multiple languages; use include blocker. +if(__WINDOWS_INTEL) + return() +endif() +set(__WINDOWS_INTEL 1) + +# make sure to enable languages after setting configuration types +ENABLE_LANGUAGE(RC) +SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>") + +SET(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:") +SET(CMAKE_LINK_LIBRARY_FLAG "") +SET(WIN32 1) +IF(CMAKE_VERBOSE_MAKEFILE) + SET(CMAKE_CL_NOLOGO) +ELSE(CMAKE_VERBOSE_MAKEFILE) + SET(CMAKE_CL_NOLOGO "/nologo") +ENDIF(CMAKE_VERBOSE_MAKEFILE) +SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>") +SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows) +SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console) + +# default to Debug builds +#SET(CMAKE_BUILD_TYPE_INIT Debug) +SET(CMAKE_BUILD_TYPE_INIT Release) + +SET(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib") +SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}") + +# executable linker flags +SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:") +IF(MSVC_C_ARCHITECTURE_ID) + SET(_MACHINE_ARCH_FLAG "/machine:${MSVC_C_ARCHITECTURE_ID}") +ELSEIF(MSVC_CXX_ARCHITECTURE_ID) + SET(_MACHINE_ARCH_FLAG "/machine:${MSVC_CXX_ARCHITECTURE_ID}") +ELSEIF(MSVC_Fortran_ARCHITECTURE_ID) + SET(_MACHINE_ARCH_FLAG "/machine:${MSVC_Fortran_ARCHITECTURE_ID}") +ENDIF() +SET (CMAKE_EXE_LINKER_FLAGS_INIT "/STACK:10000000 /INCREMENTAL:YES ${_MACHINE_ARCH_FLAG}") +SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug") +SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug") + +SET (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT}) +SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT}) +SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT}) +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_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT}) + INCLUDE("${CMAKE_PLATFORM_ROOT_BIN}/CMakeIntelInformation.cmake" OPTIONAL) IF(NOT _INTEL_XILINK_TEST_RUN) @@ -15,3 +78,31 @@ SET(_INTEL_COMPILER_SUPPORTS_MANIFEST ${_INTEL_COMPILER_SUPPORTS_MANIFEST}) ") ENDIF(NOT EXISTS "${CMAKE_PLATFORM_ROOT_BIN}/CMakeIntelInformation.cmake") ENDIF(NOT _INTEL_XILINK_TEST_RUN) + +macro(__windows_compiler_intel lang) + set(CMAKE_${lang}_COMPILE_OBJECT + "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} /Fo<OBJECT> <DEFINES> <FLAGS> -c <SOURCE>${CMAKE_END_TEMP_FILE}") + set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE + "<CMAKE_${lang}_COMPILER> > <PREPROCESSED_SOURCE> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <DEFINES> <FLAGS> -E <SOURCE>${CMAKE_END_TEMP_FILE}") + set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1) + set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ") + set(CMAKE_${lang}_CREATE_SHARED_LIBRARY + "xilink ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}") + set(CMAKE_${lang}_CREATE_SHARED_MODULE "${CMAKE_${lang}_CREATE_SHARED_LIBRARY}") + set(CMAKE_${lang}_LINK_EXECUTABLE + "<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /Fe<TARGET> -link /implib:<TARGET_IMPLIB> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}") + set(CMAKE_${lang}_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000${_FLAGS_${lang}}") + set(CMAKE_${lang}_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Od /GZ") + set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "/DNDEBUG /MD /O1") + set(CMAKE_${lang}_FLAGS_RELEASE_INIT "/DNDEBUG /MD /O2") + set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "/DNDEBUG /MD /Zi /O2") + + if(_INTEL_COMPILER_SUPPORTS_MANIFEST) + SET(CMAKE_${lang}_LINK_EXECUTABLE + "<CMAKE_COMMAND> -E vs_link_exe ${CMAKE_${lang}_LINK_EXECUTABLE}") + SET(CMAKE_${lang}_CREATE_SHARED_LIBRARY + "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_${lang}_CREATE_SHARED_LIBRARY}") + SET(CMAKE_${lang}_CREATE_SHARED_MODULE + "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_${lang}_CREATE_SHARED_MODULE}") + endif() +endmacro() diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake index 7463c62..56582ff 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/Platform/Windows-g++.cmake b/Modules/Platform/Windows-g++.cmake deleted file mode 100644 index 3aa393c..0000000 --- a/Modules/Platform/Windows-g++.cmake +++ /dev/null @@ -1 +0,0 @@ -INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-gcc.cmake) diff --git a/Modules/Platform/Windows-icl.cmake b/Modules/Platform/Windows-icl.cmake deleted file mode 100644 index 9088cc7..0000000 --- a/Modules/Platform/Windows-icl.cmake +++ /dev/null @@ -1,109 +0,0 @@ -SET(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:") -SET(CMAKE_LINK_LIBRARY_FLAG "") -SET(WIN32 1) -IF(CMAKE_VERBOSE_MAKEFILE) - SET(CMAKE_CL_NOLOGO) -ELSE(CMAKE_VERBOSE_MAKEFILE) - SET(CMAKE_CL_NOLOGO "/nologo") -ENDIF(CMAKE_VERBOSE_MAKEFILE) - -SET(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1) -SET(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1) - -# create a shared C++ library -SET(CMAKE_CXX_CREATE_SHARED_LIBRARY - "xilink ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}") - -SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY}) - -# create a C shared library -SET(CMAKE_C_CREATE_SHARED_LIBRARY ${CMAKE_CXX_CREATE_SHARED_LIBRARY}) - -# create a C shared module just copy the shared library rule -SET(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY}) - - -# create a C++ static library -SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ") - -# create a C static library -SET(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY}) - -# compile a C++ file into an object file -SET(CMAKE_CXX_COMPILE_OBJECT - "<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} /TP -DWIN32 /Fo<OBJECT> <DEFINES> <FLAGS> -c <SOURCE>${CMAKE_END_TEMP_FILE}") - -# compile a C file into an object file -SET(CMAKE_C_COMPILE_OBJECT - "<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} -DWIN32 /Fo<OBJECT> <DEFINES> <FLAGS> -c <SOURCE>${CMAKE_END_TEMP_FILE}") - - -SET(CMAKE_C_LINK_EXECUTABLE - "<CMAKE_C_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /Fe<TARGET> -link /implib:<TARGET_IMPLIB> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}") - -SET(CMAKE_C_CREATE_PREPROCESSED_SOURCE - "<CMAKE_C_COMPILER> > <PREPROCESSED_SOURCE> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> <DEFINES> -E <SOURCE>${CMAKE_END_TEMP_FILE}") - -SET(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE - "<CMAKE_CXX_COMPILER> > <PREPROCESSED_SOURCE> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> <DEFINES> /TP -E <SOURCE>${CMAKE_END_TEMP_FILE}") - -SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>") - -SET(CMAKE_CXX_LINK_EXECUTABLE - "<CMAKE_CXX_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /Fe<TARGET> -link /implib:<TARGET_IMPLIB> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}") - -SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows) -SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console) - -# default to Debug builds -#SET(CMAKE_BUILD_TYPE_INIT Debug) -SET(CMAKE_BUILD_TYPE_INIT Release) -SET (CMAKE_CXX_FLAGS_INIT "/W3 /Zm1000 /GX /GR") -SET (CMAKE_CXX_FLAGS_DEBUG_INIT "/MDd /Zi /Od /GZ") -SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "/MD /O1") -SET (CMAKE_CXX_FLAGS_RELEASE_INIT "/MD /O2") -SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2") -SET (CMAKE_C_FLAGS_INIT "/W3 /Zm1000") -SET (CMAKE_C_FLAGS_DEBUG_INIT "/MDd /Zi /Od /GZ") -SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MD /O1") -SET (CMAKE_C_FLAGS_RELEASE_INIT "/MD /O2") -SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2") - - -SET(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib") -SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}") - -# executable linker flags -SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:") -SET(_MACHINE_ARCH_FLAG ${MSVC_C_ARCHITECTURE_ID}) -IF(NOT _MACHINE_ARCH_FLAG) - SET(_MACHINE_ARCH_FLAG ${MSVC_CXX_ARCHITECTURE_ID}) -ENDIF(NOT _MACHINE_ARCH_FLAG) -SET (CMAKE_EXE_LINKER_FLAGS_INIT "/STACK:10000000 /INCREMENTAL:YES /machine:${_MACHINE_ARCH_FLAG}") -SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug") -SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug") - -SET (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT}) -SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT}) -SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT}) -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_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT}) - - -INCLUDE(Platform/Windows-Intel) - -IF(_INTEL_COMPILER_SUPPORTS_MANIFEST) - SET(CMAKE_C_LINK_EXECUTABLE - "<CMAKE_COMMAND> -E vs_link_exe ${CMAKE_C_LINK_EXECUTABLE}") - SET(CMAKE_C_CREATE_SHARED_LIBRARY - "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_C_CREATE_SHARED_LIBRARY}") - SET(CMAKE_C_CREATE_SHARED_MODULE - "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_C_CREATE_SHARED_MODULE}") - SET(CMAKE_CXX_LINK_EXECUTABLE - "<CMAKE_COMMAND> -E vs_link_exe ${CMAKE_CXX_LINK_EXECUTABLE}") - SET(CMAKE_CXX_CREATE_SHARED_LIBRARY - "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_CXX_CREATE_SHARED_LIBRARY}") - SET(CMAKE_CXX_CREATE_SHARED_MODULE - "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_CXX_CREATE_SHARED_MODULE}") -ENDIF(_INTEL_COMPILER_SUPPORTS_MANIFEST) diff --git a/Modules/Platform/Windows-ifort.cmake b/Modules/Platform/Windows-ifort.cmake deleted file mode 100644 index 6cffed9..0000000 --- a/Modules/Platform/Windows-ifort.cmake +++ /dev/null @@ -1,80 +0,0 @@ -SET(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:") -SET(CMAKE_LINK_LIBRARY_FLAG "") -SET(WIN32 1) -IF(CMAKE_VERBOSE_MAKEFILE) - SET(CMAKE_CL_NOLOGO) -ELSE(CMAKE_VERBOSE_MAKEFILE) - SET(CMAKE_CL_NOLOGO "/nologo") -ENDIF(CMAKE_VERBOSE_MAKEFILE) - -SET(CMAKE_Fortran_MODDIR_FLAG "-module:") - -SET(CMAKE_Fortran_USE_RESPONSE_FILE_FOR_OBJECTS 1) - -SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY - "link ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /dll <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}") - -SET(CMAKE_Fortran_CREATE_SHARED_MODULE ${CMAKE_Fortran_CREATE_SHARED_LIBRARY}) - -# create a C++ static library -SET(CMAKE_Fortran_CREATE_STATIC_LIBRARY "lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ") - -# compile a C++ file into an object file -SET(CMAKE_Fortran_COMPILE_OBJECT - "<CMAKE_Fortran_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} /fpp /Fo<OBJECT> <DEFINES> <FLAGS> -c <SOURCE>${CMAKE_END_TEMP_FILE}") - -SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>") - -SET(CMAKE_Fortran_LINK_EXECUTABLE - "<CMAKE_Fortran_COMPILER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> -link /implib:<TARGET_IMPLIB> <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}") - -INCLUDE(Platform/Windows-Intel) - -IF(_INTEL_COMPILER_SUPPORTS_MANIFEST) - SET(CMAKE_Fortran_LINK_EXECUTABLE - "<CMAKE_COMMAND> -E vs_link_exe ${CMAKE_Fortran_LINK_EXECUTABLE}") - SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY - "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_Fortran_CREATE_SHARED_LIBRARY}") - SET(CMAKE_Fortran_CREATE_SHARED_MODULE - "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_Fortran_CREATE_SHARED_MODULE}") -ENDIF(_INTEL_COMPILER_SUPPORTS_MANIFEST) - -SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows) -SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console) - -IF(CMAKE_GENERATOR MATCHES "Visual Studio 6") - SET (CMAKE_NO_BUILD_TYPE 1) -ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 6") -IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8") - SET (CMAKE_NO_BUILD_TYPE 1) - SET (CMAKE_CONFIGURATION_TYPES "Debug;Release;MinSizeRel;RelWithDebInfo" CACHE STRING - "Semicolon separated list of supported configuration types, only supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything else will be ignored.") -ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8") -# does the compiler support pdbtype and is it the newer compiler - -SET(CMAKE_BUILD_TYPE_INIT Debug) -SET (CMAKE_Fortran_FLAGS_INIT "/W1 /nologo /fpp /libs:dll /threads") -SET (CMAKE_Fortran_FLAGS_DEBUG_INIT "/debug:full /dbglibs") -SET (CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "/O2 /D NDEBUG") -SET (CMAKE_Fortran_FLAGS_RELEASE_INIT "/O1 /D NDEBUG") -SET (CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "/O1 /debug:full /D NDEBUG") - -SET (CMAKE_Fortran_STANDARD_LIBRARIES_INIT "user32.lib") - -# executable linker flags -SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:") -SET (CMAKE_EXE_LINKER_FLAGS_INIT " /INCREMENTAL:YES") -IF (CMAKE_COMPILER_SUPPORTS_PDBTYPE) - SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /pdbtype:sept") - SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /pdbtype:sept") -ELSE (CMAKE_COMPILER_SUPPORTS_PDBTYPE) - SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug") - SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug") -ENDIF (CMAKE_COMPILER_SUPPORTS_PDBTYPE) - -SET (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT}) -SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT}) -SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT}) -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_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT}) diff --git a/Modules/Platform/Windows-windres.cmake b/Modules/Platform/Windows-windres.cmake new file mode 100644 index 0000000..8bc1b15 --- /dev/null +++ b/Modules/Platform/Windows-windres.cmake @@ -0,0 +1 @@ +SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff <FLAGS> <DEFINES> <SOURCE> <OBJECT>") diff --git a/Modules/Qt4ConfigDependentSettings.cmake b/Modules/Qt4ConfigDependentSettings.cmake index bfb50de..10af3bc 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 df07d25..86a7404 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) @@ -254,7 +254,15 @@ MACRO(QT4_GENERATE_DBUS_INTERFACE _header) # _customName OPTIONS -some -options GET_FILENAME_COMPONENT(_basename ${_header} NAME_WE) IF (_customName) - SET(_target ${CMAKE_CURRENT_BINARY_DIR}/${_customName}) + if (IS_ABSOLUTE ${_customName}) + get_filename_component(_containingDir ${_customName} PATH) + if (NOT EXISTS ${_containingDir}) + file(MAKE_DIRECTORY "${_containingDir}") + endif() + SET(_target ${_customName}) + else() + SET(_target ${CMAKE_CURRENT_BINARY_DIR}/${_customName}) + endif() ELSE (_customName) SET(_target ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.xml) ENDIF (_customName) diff --git a/Modules/SystemInformation.cmake b/Modules/SystemInformation.cmake index d973e90f..d4f2233 100644 --- a/Modules/SystemInformation.cmake +++ b/Modules/SystemInformation.cmake @@ -1,6 +1,6 @@ #============================================================================= -# Copyright 2007-2009 Kitware, Inc. +# Copyright 2007-2010 Kitware, Inc. # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -12,6 +12,7 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) +CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION}) PROJECT(DumpInformation) # first get the standard information for th platform |