diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 5 | ||||
-rw-r--r-- | Modules/Compiler/AppleClang-C-FeatureTests.cmake | 2 | ||||
-rw-r--r-- | Modules/Compiler/AppleClang-C.cmake | 4 | ||||
-rw-r--r-- | Modules/Compiler/AppleClang-CXX-FeatureTests.cmake | 43 | ||||
-rw-r--r-- | Modules/Compiler/AppleClang-CXX.cmake | 12 | ||||
-rw-r--r-- | Modules/Compiler/GNU-C.cmake | 2 | ||||
-rw-r--r-- | Modules/Compiler/GNU-CXX-FeatureTests.cmake | 7 | ||||
-rw-r--r-- | Modules/Compiler/GNU-CXX.cmake | 4 | ||||
-rw-r--r-- | Modules/CompilerId/Xcode-3.pbxproj.in | 2 | ||||
-rw-r--r-- | Modules/FindBoost.cmake | 2 | ||||
-rw-r--r-- | Modules/FindCUDA.cmake | 14 | ||||
-rw-r--r-- | Modules/FindIce.cmake | 10 | ||||
-rw-r--r-- | Modules/FindLATEX.cmake | 167 | ||||
-rw-r--r-- | Modules/FindMPI.cmake | 14 | ||||
-rw-r--r-- | Modules/FindOpenSSL.cmake | 4 | ||||
-rw-r--r-- | Modules/FindRuby.cmake | 4 | ||||
-rw-r--r-- | Modules/FindSDL.cmake | 2 | ||||
-rw-r--r-- | Modules/Platform/Linux-XL-C.cmake | 1 | ||||
-rw-r--r-- | Modules/Platform/Linux-XL-CXX.cmake | 1 | ||||
-rw-r--r-- | Modules/Platform/Linux-XL-Fortran.cmake | 1 | ||||
-rw-r--r-- | Modules/WriteCompilerDetectionHeader.cmake | 15 |
21 files changed, 264 insertions, 52 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 0ea9ce1..8edace1 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -270,11 +270,6 @@ Id flags: ${testflags} else() set(id_sdkroot "") endif() - if(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY) - set(id_code_sign_identity "CODE_SIGN_IDENTITY = \"${CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY}\";") - else() - set(id_code_sign_identity "") - endif() if(NOT ${XCODE_VERSION} VERSION_LESS 3) set(v 3) set(ext xcodeproj) diff --git a/Modules/Compiler/AppleClang-C-FeatureTests.cmake b/Modules/Compiler/AppleClang-C-FeatureTests.cmake index ec1d43f..6f3d6a7 100644 --- a/Modules/Compiler/AppleClang-C-FeatureTests.cmake +++ b/Modules/Compiler/AppleClang-C-FeatureTests.cmake @@ -1,5 +1,5 @@ -set(_cmake_oldestSupported "((__clang_major__ * 100) + __clang_minor__) >= 501") +set(_cmake_oldestSupported "((__clang_major__ * 100) + __clang_minor__) >= 400") set(AppleClang_C11 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L") set(_cmake_feature_test_c_static_assert "${AppleClang_C11}") diff --git a/Modules/Compiler/AppleClang-C.cmake b/Modules/Compiler/AppleClang-C.cmake index 10edc74..0665745 100644 --- a/Modules/Compiler/AppleClang-C.cmake +++ b/Modules/Compiler/AppleClang-C.cmake @@ -1,7 +1,7 @@ include(Compiler/Clang) __compiler_clang(C) -if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.1) +if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0) set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90") set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90") @@ -19,7 +19,7 @@ macro(cmake_record_c_compile_features) record_compiler_features(C "${std_version}" ${list}) endmacro() - if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.1) + if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0) _get_appleclang_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES) if (_result EQUAL 0) _get_appleclang_features(${CMAKE_C99_STANDARD_COMPILE_OPTION} CMAKE_C99_COMPILE_FEATURES) diff --git a/Modules/Compiler/AppleClang-CXX-FeatureTests.cmake b/Modules/Compiler/AppleClang-CXX-FeatureTests.cmake index 78bdb72..f67082c 100644 --- a/Modules/Compiler/AppleClang-CXX-FeatureTests.cmake +++ b/Modules/Compiler/AppleClang-CXX-FeatureTests.cmake @@ -3,7 +3,28 @@ # Generic reference: http://clang.llvm.org/cxx_status.html # http://clang.llvm.org/docs/LanguageExtensions.html -set(_cmake_oldestSupported "((__clang_major__ * 100) + __clang_minor__) >= 501") +# Note: CXX compiler in Xcode 4.3 does not set __apple_build_version__ and so is +# not recognized as AppleClang. +# Xcode_43 - Apple clang version 3.1 (tags/Apple/clang-318.0.61) (based on LLVM 3.1svn) +# Xcode_44 - Apple clang version 4.0 (tags/Apple/clang-421.0.60) (based on LLVM 3.1svn) +# Xcode_45 - Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn) +# Xcode_46 - Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) +# Xcode_50 - Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) +# Xcode_51 - Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn) +# Xcode_60 - Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn) +# Xcode_61 - Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn) + +# There is some non-correspondance. __has_feature(cxx_user_literals) is +# false for AppleClang 4.0 and 4.1, although it is reported as +# supported in the reference link for Clang 3.1. The compiler does not pass +# the CompileFeatures/cxx_user_literals.cpp test. +# cxx_attributes is listed as not supported until Clang 3.3. It works without +# warning with AppleClang 5.0, but issues a gcc-compat warning for +# AppleClang 4.0-4.2. +# cxx_alignof and cxx_alignas tests work for early AppleClang versions, though +# they are listed as supported for Clang 3.3 and later. + +set(_cmake_oldestSupported "((__clang_major__ * 100) + __clang_minor__) >= 400") include("${CMAKE_CURRENT_LIST_DIR}/Clang-CXX-TestableFeatures.cmake") @@ -16,16 +37,16 @@ set(_cmake_feature_test_cxx_digit_separators "${AppleClang51_CXX14}") # http://llvm.org/bugs/show_bug.cgi?id=19674 set(_cmake_feature_test_cxx_generic_lambdas "${AppleClang51_CXX14}") -set(AppleClang51_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L") -set(_cmake_feature_test_cxx_enum_forward_declarations "${AppleClang51_CXX11}") -set(_cmake_feature_test_cxx_sizeof_member "${AppleClang51_CXX11}") -set(_cmake_feature_test_cxx_extended_friend_declarations "${AppleClang51_CXX11}") -set(_cmake_feature_test_cxx_extern_templates "${AppleClang51_CXX11}") -set(_cmake_feature_test_cxx_func_identifier "${AppleClang51_CXX11}") -set(_cmake_feature_test_cxx_inline_namespaces "${AppleClang51_CXX11}") -set(_cmake_feature_test_cxx_long_long_type "${AppleClang51_CXX11}") -set(_cmake_feature_test_cxx_right_angle_brackets "${AppleClang51_CXX11}") -set(_cmake_feature_test_cxx_variadic_macros "${AppleClang51_CXX11}") +set(AppleClang40_CXX11 "${_cmake_oldestSupported} && __cplusplus >= 201103L") +set(_cmake_feature_test_cxx_enum_forward_declarations "${AppleClang40_CXX11}") +set(_cmake_feature_test_cxx_sizeof_member "${AppleClang40_CXX11}") +set(_cmake_feature_test_cxx_extended_friend_declarations "${AppleClang40_CXX11}") +set(_cmake_feature_test_cxx_extern_templates "${AppleClang40_CXX11}") +set(_cmake_feature_test_cxx_func_identifier "${AppleClang40_CXX11}") +set(_cmake_feature_test_cxx_inline_namespaces "${AppleClang40_CXX11}") +set(_cmake_feature_test_cxx_long_long_type "${AppleClang40_CXX11}") +set(_cmake_feature_test_cxx_right_angle_brackets "${AppleClang40_CXX11}") +set(_cmake_feature_test_cxx_variadic_macros "${AppleClang40_CXX11}") set(AppleClang_CXX98 "${_cmake_oldestSupported} && __cplusplus >= 199711L") set(_cmake_feature_test_cxx_template_template_parameters "${AppleClang_CXX98}") diff --git a/Modules/Compiler/AppleClang-CXX.cmake b/Modules/Compiler/AppleClang-CXX.cmake index eb97f88..a508623 100644 --- a/Modules/Compiler/AppleClang-CXX.cmake +++ b/Modules/Compiler/AppleClang-CXX.cmake @@ -5,13 +5,16 @@ if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden") endif() -if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1) +if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0) set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98") set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98") set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11") set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11") +endif() +if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1) + # AppleClang 5.0 knows this flag, but does not set a __cplusplus macro greater than 201103L set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "-std=c++1y") set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "-std=gnu++1y") endif() @@ -23,8 +26,11 @@ macro(cmake_record_cxx_compile_features) record_compiler_features(CXX "${std_version}" ${list}) endmacro() - if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1) - _get_appleclang_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES) + if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0) + set(_result 0) + if(CMAKE_CXX14_STANDARD_COMPILE_OPTION) + _get_appleclang_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES) + endif() if (_result EQUAL 0) _get_appleclang_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES) endif() diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake index 9018450..db9089d 100644 --- a/Modules/Compiler/GNU-C.cmake +++ b/Modules/Compiler/GNU-C.cmake @@ -23,7 +23,7 @@ macro(cmake_record_c_compile_features) record_compiler_features(C "${std_version}" ${list}) endmacro() - if (UNIX AND NOT APPLE AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) + if (UNIX AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7) _get_gcc_features(${CMAKE_C11_STANDARD_COMPILE_OPTION} CMAKE_C11_COMPILE_FEATURES) if (_result EQUAL 0) _get_gcc_features(${CMAKE_C99_STANDARD_COMPILE_OPTION} CMAKE_C99_COMPILE_FEATURES) diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake index 9c98e44..6de06dd 100644 --- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake +++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake @@ -1,8 +1,15 @@ # Reference: http://gcc.gnu.org/projects/cxx0x.html +# http://gcc.gnu.org/projects/cxx1y.html set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 407") +set(GNU50_CXX14 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 500 && __cplusplus >= 201402L") +set(_cmake_feature_test_cxx_variable_templates "${GNU50_CXX14}") + +# GNU 4.9 in c++14 mode sets __cplusplus to 201300L, so don't test for the +# correct value of it below. +# https://patchwork.ozlabs.org/patch/382470/ set(GNU49_CXX14 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 409 && __cplusplus > 201103L") set(_cmake_feature_test_cxx_contextual_conversions "${GNU49_CXX14}") set(_cmake_feature_test_cxx_attribute_deprecated "${GNU49_CXX14}") diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index a91c901..4a26963 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -39,10 +39,10 @@ macro(cmake_record_cxx_compile_features) endmacro() set(_result 0) - if (UNIX AND NOT APPLE AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) + if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) _get_gcc_features(${CMAKE_CXX14_STANDARD_COMPILE_OPTION} CMAKE_CXX14_COMPILE_FEATURES) endif() - if (UNIX AND NOT APPLE AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) + if (UNIX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) if (_result EQUAL 0) _get_gcc_features(${CMAKE_CXX11_STANDARD_COMPILE_OPTION} CMAKE_CXX11_COMPILE_FEATURES) endif() diff --git a/Modules/CompilerId/Xcode-3.pbxproj.in b/Modules/CompilerId/Xcode-3.pbxproj.in index aebae27..7f686a2 100644 --- a/Modules/CompilerId/Xcode-3.pbxproj.in +++ b/Modules/CompilerId/Xcode-3.pbxproj.in @@ -81,7 +81,7 @@ buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_BIT)"; ONLY_ACTIVE_ARCH = YES; - @id_code_sign_identity@ + CODE_SIGNING_REQUIRED = NO; CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)"; SYMROOT = .; @id_toolset@ diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index aad6575..99293c1 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -478,7 +478,7 @@ else() # 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.56.0" "1.56" "1.55.0" "1.55" "1.54.0" "1.54" + "1.58.0" "1.58" "1.57.0" "1.57" "1.56.0" "1.56" "1.55.0" "1.55" "1.54.0" "1.54" "1.53.0" "1.53" "1.52.0" "1.52" "1.51.0" "1.51" "1.50.0" "1.50" "1.49.0" "1.49" "1.48.0" "1.48" "1.47.0" "1.47" "1.46.1" "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" diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 29bb875..4f1f09a 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -613,7 +613,7 @@ endif() set(CUDA_VERSION_STRING "${CUDA_VERSION}") # Support for arm cross compilation with CUDA 5.5 -if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm" AND EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf") +if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_PROCESSOR MATCHES "arm" AND EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf") set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT_DIR}/targets/armv7-linux-gnueabihf" CACHE PATH "Toolkit target location.") else() set(CUDA_TOOLKIT_TARGET_DIR "${CUDA_TOOLKIT_ROOT_DIR}" CACHE PATH "Toolkit target location.") @@ -621,7 +621,7 @@ endif() mark_as_advanced(CUDA_TOOLKIT_TARGET_DIR) # Target CPU architecture -if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm") +if(CUDA_VERSION VERSION_GREATER "5.0" AND CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_PROCESSOR MATCHES "arm") set(_cuda_target_cpu_arch_initial "ARM") else() set(_cuda_target_cpu_arch_initial "") @@ -1423,7 +1423,8 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options if( ccbin_found0 LESS 0 AND ccbin_found1 LESS 0 AND CUDA_HOST_COMPILER ) list(APPEND nvcc_flags -ccbin "\"${CUDA_HOST_COMPILER}\"") endif() - # Create a list of flags specified by CUDA_NVCC_FLAGS_${CONFIG} + + # Create a list of flags specified by CUDA_NVCC_FLAGS_${CONFIG} and CMAKE_${CUDA_C_OR_CXX}_FLAGS* set(config_specific_flags) set(flags) foreach(config ${CUDA_configuration_types}) @@ -1438,6 +1439,13 @@ function(CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS output_file cuda_target options list(APPEND flags $<$<CONFIG:${config}>:-Xcompiler> $<$<CONFIG:${config}>:${f}>) endforeach() endforeach() + # Add CMAKE_${CUDA_C_OR_CXX}_FLAGS + set(important_host_flags) + _cuda_get_important_host_flags(important_host_flags ${CMAKE_${CUDA_C_OR_CXX}_FLAGS}) + foreach(f ${important_host_flags}) + list(APPEND flags -Xcompiler ${f}) + endforeach() + # Add our general CUDA_NVCC_FLAGS with the configuration specifig flags set(nvcc_flags ${CUDA_NVCC_FLAGS} ${config_specific_flags} ${nvcc_flags}) diff --git a/Modules/FindIce.cmake b/Modules/FindIce.cmake index 76cecc1..8493d80 100644 --- a/Modules/FindIce.cmake +++ b/Modules/FindIce.cmake @@ -282,21 +282,21 @@ function(_Ice_FIND) PATH_SUFFIXES ${ice_library_suffixes} DOC "Ice ${component} library") mark_as_advanced("${component_cache}") - if("${component_cache}") + if(${component_cache}) set("${component_found}" ON) list(APPEND Ice_LIBRARY "${${component_cache}}") endif() mark_as_advanced("${component_found}") set("${component_cache}" "${${component_cache}}" PARENT_SCOPE) set("${component_found}" "${${component_found}}" PARENT_SCOPE) - if("${component_found}") - if ("Ice_FIND_REQUIRED_${component}") + if(${component_found}) + if (Ice_FIND_REQUIRED_${component}) list(APPEND Ice_LIBS_FOUND "${component} (required)") else() list(APPEND Ice_LIBS_FOUND "${component} (optional)") endif() else() - if ("Ice_FIND_REQUIRED_${component}") + if (Ice_FIND_REQUIRED_${component}) set(Ice_REQUIRED_LIBS_FOUND OFF) list(APPEND Ice_LIBS_NOTFOUND "${component} (required)") else() @@ -356,7 +356,7 @@ if(Ice_FOUND) set(_Ice_component_cache "Ice_${_Ice_component_upcase}_LIBRARY") set(_Ice_component_lib "Ice_${_Ice_component_upcase}_LIBRARIES") set(_Ice_component_found "${_Ice_component_upcase}_FOUND") - if("${_Ice_component_found}") + if(${_Ice_component_found}) set("${_Ice_component_lib}" "${${_Ice_component_cache}}") endif() unset(_Ice_component_upcase) diff --git a/Modules/FindLATEX.cmake b/Modules/FindLATEX.cmake index a935f00..ae83733 100644 --- a/Modules/FindLATEX.cmake +++ b/Modules/FindLATEX.cmake @@ -6,20 +6,52 @@ # # This module finds an installed Latex and determines the location # of the compiler. Additionally the module looks for Latex-related -# software like BibTeX. This code sets the following variables: +# software like BibTeX. # -# :: +# This module sets the following result variables:: # +# LATEX_FOUND: whether found Latex and requested components +# LATEX_<component>_FOUND: whether found <component> # LATEX_COMPILER: path to the LaTeX compiler # PDFLATEX_COMPILER: path to the PdfLaTeX compiler +# XELATEX_COMPILER: path to the XeLaTeX compiler +# LUALATEX_COMPILER: path to the LuaLaTeX compiler # BIBTEX_COMPILER: path to the BibTeX compiler +# BIBER_COMPILER: path to the Biber compiler # MAKEINDEX_COMPILER: path to the MakeIndex compiler +# XINDY_COMPILER: path to the xindy compiler # DVIPS_CONVERTER: path to the DVIPS converter +# DVIPDF_CONVERTER: path to the DVIPDF converter # PS2PDF_CONVERTER: path to the PS2PDF converter +# PDFTOPS_CONVERTER: path to the pdftops converter # LATEX2HTML_CONVERTER: path to the LaTeX2Html converter +# HTLATEX_COMPILER: path to the htlatex compiler +# +# Possible components are:: +# +# PDFLATEX +# XELATEX +# LUALATEX +# BIBTEX +# BIBER +# MAKEINDEX +# XINDY +# DVIPS +# DVIPDF +# PS2PDF +# PDFTOPS +# LATEX2HTML +# HTLATEX +# +# Example Usages:: +# +# find_package(LATEX) +# find_package(LATEX COMPONENTS PDFLATEX) +# find_package(LATEX COMPONENTS BIBTEX PS2PDF) #============================================================================= -# Copyright 2002-2014 Kitware, Inc. +# Copyright 2002-2015 Kitware, Inc. +# Copyright 2014-2015 Christoph GrĂ¼ninger <foss@grueninger.de> # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -32,9 +64,7 @@ # License text for the above reference.) if (WIN32) - # Try to find the MikTex binary path (look for its package manager). - find_path(MIKTEX_BINARY_PATH mpm.exe "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MiK\\MiKTeX\\CurrentVersion\\MiKTeX;Install Root]/miktex/bin" DOC @@ -43,7 +73,6 @@ if (WIN32) mark_as_advanced(MIKTEX_BINARY_PATH) # Try to find the GhostScript binary path (look for gswin32). - get_filename_component(GHOSTSCRIPT_BINARY_PATH_FROM_REGISTERY_8_00 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\AFPL Ghostscript\\8.00;GS_DLL]" PATH ) @@ -64,45 +93,124 @@ if (WIN32) DOC "Path to the GhostScript library directory." ) mark_as_advanced(GHOSTSCRIPT_LIBRARY_PATH) - endif () +# try to find Latex and the related programs find_program(LATEX_COMPILER NAMES latex PATHS ${MIKTEX_BINARY_PATH} /usr/bin ) +# find pdflatex find_program(PDFLATEX_COMPILER NAMES pdflatex PATHS ${MIKTEX_BINARY_PATH} /usr/bin ) +if (PDFLATEX_COMPILER) + set(LATEX_PDFLATEX_FOUND TRUE) +else() + set(LATEX_PDFLATEX_FOUND FALSE) +endif() + +# find xelatex +find_program(XELATEX_COMPILER + NAMES xelatex + PATHS ${MIKTEX_BINARY_PATH} + /usr/bin +) +if (XELATEX_COMPILER) + set(LATEX_XELATEX_FOUND TRUE) +else() + set(LATEX_XELATEX_FOUND FALSE) +endif() + +# find lualatex +find_program(LUALATEX_COMPILER + NAMES lualatex + PATHS ${MIKTEX_BINARY_PATH} + /usr/bin +) +if (LUALATEX_COMPILER) + set(LATEX_LUALATEX_FOUND TRUE) +else() + set(LATEX_LUALATEX_FOUND FALSE) +endif() +# find bibtex find_program(BIBTEX_COMPILER NAMES bibtex PATHS ${MIKTEX_BINARY_PATH} /usr/bin ) +if (BIBTEX_COMPILER) + set(LATEX_BIBTEX_FOUND TRUE) +else() + set(LATEX_BIBTEX_FOUND FALSE) +endif() +# find biber +find_program(BIBER_COMPILER + NAMES biber + PATHS ${MIKTEX_BINARY_PATH} + /usr/bin +) +if (BIBER_COMPILER) + set(LATEX_BIBER_FOUND TRUE) +else() + set(LATEX_BIBER_FOUND FALSE) +endif() + +# find makeindex find_program(MAKEINDEX_COMPILER NAMES makeindex PATHS ${MIKTEX_BINARY_PATH} /usr/bin ) +if (MAKEINDEX_COMPILER) + set(LATEX_MAKEINDEX_FOUND TRUE) +else() + set(LATEX_MAKEINDEX_FOUND FALSE) +endif() + +# find xindy +find_program(XINDY_COMPILER + NAMES xindy + PATHS ${MIKTEX_BINARY_PATH} + /usr/bin +) +if (XINDY_COMPILER) + set(LATEX_XINDY_FOUND TRUE) +else() + set(LATEX_XINDY_FOUND FALSE) +endif() +# find dvips find_program(DVIPS_CONVERTER NAMES dvips PATHS ${MIKTEX_BINARY_PATH} /usr/bin ) +if (DVIPS_CONVERTER) + set(LATEX_DVIPS_FOUND TRUE) +else() + set(LATEX_DVIPS_FOUND FALSE) +endif() +# find dvipdf find_program(DVIPDF_CONVERTER NAMES dvipdfm dvipdft dvipdf PATHS ${MIKTEX_BINARY_PATH} /usr/bin ) +if (DVIPDF_CONVERTER) + set(LATEX_DVIPDF_FOUND TRUE) +else() + set(LATEX_DVIPDF_FOUND FALSE) +endif() +# find ps2pdf if (WIN32) find_program(PS2PDF_CONVERTER NAMES ps2pdf14.bat ps2pdf14 ps2pdf @@ -114,26 +222,69 @@ else () NAMES ps2pdf14 ps2pdf ) endif () +if (PS2PDF_CONVERTER) + set(LATEX_PS2PDF_FOUND TRUE) +else() + set(LATEX_PS2PDF_FOUND FALSE) +endif() +# find pdftops +find_program(PDFTOPS_CONVERTER + NAMES pdftops + PATHS ${MIKTEX_BINARY_PATH} + /usr/bin +) +if (PDFTOPS_CONVERTER) + set(LATEX_PDFTOPS_FOUND TRUE) +else() + set(LATEX_PDFTOPS_FOUND FALSE) +endif() + +# find latex2html find_program(LATEX2HTML_CONVERTER NAMES latex2html PATHS ${MIKTEX_BINARY_PATH} /usr/bin ) +if (LATEX2HTML_CONVERTER) + set(LATEX_LATEX2HTML_FOUND TRUE) +else() + set(LATEX_LATEX2HTML_FOUND FALSE) +endif() + +# find htlatex +find_program(HTLATEX_COMPILER + NAMES htlatex + PATHS ${MIKTEX_BINARY_PATH} + /usr/bin +) +if (HTLATEX_COMPILER) + set(LATEX_HTLATEX_FOUND TRUE) +else() + set(LATEX_HTLATEX_FOUND FALSE) +endif() mark_as_advanced( LATEX_COMPILER PDFLATEX_COMPILER + XELATEX_COMPILER + LUALATEX_COMPILER BIBTEX_COMPILER + BIBER_COMPILER MAKEINDEX_COMPILER + XINDY_COMPILER DVIPS_CONVERTER DVIPDF_CONVERTER PS2PDF_CONVERTER + PDFTOPS_CONVERTER LATEX2HTML_CONVERTER + HTLATEX_COMPILER ) +# handle variables for found Latex and its components include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -find_package_handle_standard_args(Latex +find_package_handle_standard_args(LATEX REQUIRED_VARS LATEX_COMPILER + HANDLE_COMPONENTS ) diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index 8e39a7f..545b077 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -174,7 +174,13 @@ set(_MPI_EXEC_NAMES mpiexec mpirun lamexec srun) # Grab the path to MPI from the registry if we're on windows. set(_MPI_PREFIX_PATH) if(WIN32) + # MSMPI + file(TO_CMAKE_PATH "$ENV{MSMPI_BIN}" msmpi_bin_path) # The default path ends with a '\' and doesn't mix with ';' when appending. + list(APPEND _MPI_PREFIX_PATH "${msmpi_bin_path}") + unset(msmpi_bin_path) list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MPI;InstallRoot]/Bin") + list(APPEND _MPI_PREFIX_PATH "$ENV{MSMPI_INC}/..") # The SDK is installed separately from the runtime + # MPICH list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH\\SMPD;binary]/..") list(APPEND _MPI_PREFIX_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MPICH2;Path]") list(APPEND _MPI_PREFIX_PATH "$ENV{ProgramW6432}/MPICH2/") @@ -422,16 +428,18 @@ function (interrogate_mpi_compiler lang try_libs) # Decide between 32-bit and 64-bit libraries for Microsoft's MPI if("${CMAKE_SIZEOF_VOID_P}" EQUAL 8) - set(MS_MPI_ARCH_DIR amd64) + set(MS_MPI_ARCH_DIR x64) + set(MS_MPI_ARCH_DIR2 amd64) else() - set(MS_MPI_ARCH_DIR i386) + set(MS_MPI_ARCH_DIR x86) + set(MS_MPI_ARCH_DIR2 i386) endif() set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) find_library(MPI_LIB NAMES mpi mpich mpich2 msmpi HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH} - PATH_SUFFIXES lib lib/${MS_MPI_ARCH_DIR} Lib Lib/${MS_MPI_ARCH_DIR}) + PATH_SUFFIXES lib lib/${MS_MPI_ARCH_DIR} Lib Lib/${MS_MPI_ARCH_DIR} Lib/${MS_MPI_ARCH_DIR2}) set(MPI_LIBRARIES_WORK ${MPI_LIB}) # Right now, we only know about the extra libs for C++. diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index b2722a6..bfbe01f 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -283,9 +283,7 @@ function(from_hex HEX DEC) endfunction() if (OPENSSL_INCLUDE_DIR) - if (_OPENSSL_VERSION) - set(OPENSSL_VERSION "${_OPENSSL_VERSION}") - elseif(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h") + if(OPENSSL_INCLUDE_DIR AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h") file(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" openssl_version_str REGEX "^#define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*") diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake index b5ac703..4be16c9 100644 --- a/Modules/FindRuby.cmake +++ b/Modules/FindRuby.cmake @@ -58,7 +58,7 @@ set(_RUBY_POSSIBLE_EXECUTABLE_NAMES ruby) # if 1.9 is required, don't look for ruby18 and ruby1.8, default to version 1.8 -if(Ruby_FIND_VERSION_MAJOR AND Ruby_FIND_VERSION_MINOR) +if(DEFINED Ruby_FIND_VERSION_MAJOR AND DEFINED Ruby_FIND_VERSION_MINOR) set(Ruby_FIND_VERSION_SHORT_NODOT "${Ruby_FIND_VERSION_MAJOR}${RUBY_FIND_VERSION_MINOR}") # we can't construct that if only major version is given set(_RUBY_POSSIBLE_EXECUTABLE_NAMES @@ -90,7 +90,7 @@ if(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR) RESULT_VARIABLE _RUBY_SUCCESS OUTPUT_VARIABLE _RUBY_OUTPUT ERROR_QUIET) - if(_RUBY_SUCCESS OR NOT _RUBY_OUTPUT) + if(_RUBY_SUCCESS OR _RUBY_OUTPUT STREQUAL "") execute_process(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['${RBVAR}']" RESULT_VARIABLE _RUBY_SUCCESS OUTPUT_VARIABLE _RUBY_OUTPUT diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake index 3905e54..45ca1d4 100644 --- a/Modules/FindSDL.cmake +++ b/Modules/FindSDL.cmake @@ -106,7 +106,7 @@ find_library(SDL_LIBRARY_TEMP ) if(NOT SDL_BUILDING_LIBRARY) - if(NOT ${SDL_INCLUDE_DIR} MATCHES ".framework") + if(NOT SDL_INCLUDE_DIR MATCHES ".framework") # Non-OS X framework versions expect you to also dynamically link to # SDLmain. This is mainly for Windows and OS X. Other (Unix) platforms # seem to provide SDLmain for compatibility even though they don't diff --git a/Modules/Platform/Linux-XL-C.cmake b/Modules/Platform/Linux-XL-C.cmake index f1c584c..d595e44 100644 --- a/Modules/Platform/Linux-XL-C.cmake +++ b/Modules/Platform/Linux-XL-C.cmake @@ -1 +1,2 @@ set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-qmkshrobj") +set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-export-dynamic") diff --git a/Modules/Platform/Linux-XL-CXX.cmake b/Modules/Platform/Linux-XL-CXX.cmake index abd3fa4..5ceb255 100644 --- a/Modules/Platform/Linux-XL-CXX.cmake +++ b/Modules/Platform/Linux-XL-CXX.cmake @@ -1 +1,2 @@ set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-qmkshrobj") +set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-Wl,-export-dynamic") diff --git a/Modules/Platform/Linux-XL-Fortran.cmake b/Modules/Platform/Linux-XL-Fortran.cmake index cdd1f70..a878991 100644 --- a/Modules/Platform/Linux-XL-Fortran.cmake +++ b/Modules/Platform/Linux-XL-Fortran.cmake @@ -1 +1,2 @@ set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-qmkshrobj") +set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-Wl,-export-dynamic") diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake index 36b9706..d61358f 100644 --- a/Modules/WriteCompilerDetectionHeader.cmake +++ b/Modules/WriteCompilerDetectionHeader.cmake @@ -194,6 +194,7 @@ # ``cxx_static_assert`` ``<PREFIX>_STATIC_ASSERT_MSG`` ``static_assert`` # ``cxx_attribute_deprecated`` ``<PREFIX>_DEPRECATED`` ``[[deprecated]]`` # ``cxx_attribute_deprecated`` ``<PREFIX>_DEPRECATED_MSG`` ``[[deprecated]]`` +# ``cxx_thread_local`` ``<PREFIX>_THREAD_LOCAL`` ``thread_local`` # ============================= ================================ ===================== # # A use-case which arises with such deprecation macros is the deprecation @@ -573,6 +574,20 @@ function(write_compiler_detection_header # endif \n") endif() + if (feature STREQUAL cxx_thread_local) + set(def_value "${prefix_arg}_THREAD_LOCAL") + set(file_content "${file_content} +# if ${def_name} +# define ${def_value} thread_local +# elif ${prefix_arg}_COMPILER_IS_GNU || ${prefix_arg}_COMPILER_IS_Clang || ${prefix_arg}_COMPILER_IS_AppleClang +# define ${def_value} __thread +# elif ${prefix_arg}_COMPILER_IS_MSVC +# define ${def_value} __declspec(thread) +# else +// ${def_value} not defined for this configuration. +# endif +\n") + endif() if (feature STREQUAL cxx_attribute_deprecated) set(def_name ${prefix_arg}_${feature_PP}) set(def_value "${prefix_arg}_DEPRECATED") |