diff options
44 files changed, 737 insertions, 169 deletions
diff --git a/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in b/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in new file mode 100644 index 0000000..cf53db8 --- /dev/null +++ b/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in @@ -0,0 +1,26 @@ +# This is a basic version file for the Config-mode of find_package(). +# It is used by WriteBasicConfigVersionFile.cmake as input file for configure_file() +# to create a version-file which can be installed along a config.cmake file. +# +# The created file sets PACKAGE_VERSION_EXACT if the current version string and +# the requested version string are exactly the same and it sets +# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version. +# The variable CVF_VERSION must be set before calling configure_file(). + +set(PACKAGE_VERSION "@CVF_VERSION@") + +if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}") + set(PACKAGE_VERSION_EXACT TRUE) + endif() +endif() + +# check that the installed version has the same 32/64bit-ness as the one which is currently searching: +if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "@CMAKE_SIZEOF_VOID_P@") + math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8") + set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") + set(PACKAGE_VERSION_UNSUITABLE TRUE) +endif() diff --git a/Modules/BasicConfigVersion-SameMajorVersion.cmake.in b/Modules/BasicConfigVersion-SameMajorVersion.cmake.in new file mode 100644 index 0000000..2317fdb --- /dev/null +++ b/Modules/BasicConfigVersion-SameMajorVersion.cmake.in @@ -0,0 +1,41 @@ +# This is a basic version file for the Config-mode of find_package(). +# It is used by WriteBasicConfigVersionFile.cmake as input file for configure_file() +# to create a version-file which can be installed along a config.cmake file. +# +# The created file sets PACKAGE_VERSION_EXACT if the current version string and +# the requested version string are exactly the same and it sets +# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version, +# but only if the requested major version is the same as the current one. +# The variable CVF_VERSION must be set before calling configure_file(). + + +set(PACKAGE_VERSION "@CVF_VERSION@") + +if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + + if("@CVF_VERSION@" MATCHES "^([0-9]+)\\.") + set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") + else() + set(CVF_VERSION_MAJOR "@CVF_VERSION@") + endif() + + if("${PACKAGE_FIND_VERSION_MAJOR}" STREQUAL "${CVF_VERSION_MAJOR}") + set(PACKAGE_VERSION_COMPATIBLE TRUE) + else() + set(PACKAGE_VERSION_COMPATIBLE FALSE) + endif() + + if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}") + set(PACKAGE_VERSION_EXACT TRUE) + endif() +endif() + + +# check that the installed version has the same 32/64bit-ness as the one which is currently searching: +if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "@CMAKE_SIZEOF_VOID_P@") + math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8") + set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") + set(PACKAGE_VERSION_UNSUITABLE TRUE) +endif() diff --git a/Modules/CMakeASMInformation.cmake b/Modules/CMakeASMInformation.cmake index d50f351..b5f2420 100644 --- a/Modules/CMakeASMInformation.cmake +++ b/Modules/CMakeASMInformation.cmake @@ -33,7 +33,7 @@ IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) IF(NOT _INCLUDED_FILE) IF("ASM${ASM_DIALECT}" STREQUAL "ASM") - MESSAGE(FATAL_ERROR "Did not find file Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}") + MESSAGE(STATUS "Warning: Did not find file Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}") ENDIF("ASM${ASM_DIALECT}" STREQUAL "ASM") INCLUDE(Platform/${CMAKE_BASE_NAME} OPTIONAL) ENDIF(NOT _INCLUDED_FILE) diff --git a/Modules/CMakeTestASMCompiler.cmake b/Modules/CMakeTestASMCompiler.cmake index 56cf332..294511d 100644 --- a/Modules/CMakeTestASMCompiler.cmake +++ b/Modules/CMakeTestASMCompiler.cmake @@ -18,8 +18,18 @@ # because otherwise there would have to be a separate assembler source file # for each assembler on every architecture. + +SET(_ASM_COMPILER_WORKS 0) + IF(CMAKE_ASM${ASM_DIALECT}_COMPILER) - SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_WORKS 1 CACHE INTERNAL "") -ELSE(CMAKE_ASM${ASM_DIALECT}_COMPILER) - SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_WORKS 0 CACHE INTERNAL "") -ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER) + SET(_ASM_COMPILER_WORKS 1) +ENDIF() + +# when using generic "ASM" support, we must have detected the compiler ID, fail otherwise: +IF("ASM${ASM_DIALECT}" STREQUAL "ASM") + IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) + SET(_ASM_COMPILER_WORKS 0) + ENDIF() +ENDIF() + +SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_WORKS ${_ASM_COMPILER_WORKS} CACHE INTERNAL "") diff --git a/Modules/CMakeVS10FindMake.cmake b/Modules/CMakeVS10FindMake.cmake index 388203c..695e92f 100644 --- a/Modules/CMakeVS10FindMake.cmake +++ b/Modules/CMakeVS10FindMake.cmake @@ -12,14 +12,11 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -# VCExpress does not support cross compiling, which is necessary for Win CE -SET( _CMAKE_MAKE_PROGRAM_NAMES devenv) -IF(NOT CMAKE_CROSSCOMPILING) - SET( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress) -ENDIF(NOT CMAKE_CROSSCOMPILING) - +# Look for devenv as a build program. We need to use this to support +# Intel Fortran integration into VS. MSBuild can not be used for that case +# since Intel Fortran uses the older devenv file format. FIND_PROGRAM(CMAKE_MAKE_PROGRAM - NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} + NAMES devenv HINTS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;EnvironmentDirectory] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup;Dbghelp_path] @@ -34,6 +31,24 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM "/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/" "/Program Files/Microsoft Visual Studio 10/Common7/IDE/" ) + +# if devenv is not found, then use MSBuild. +# it is expected that if devenv is not found, then we are +# dealing with Visual Studio Express. VCExpress has random +# failures when being run as a command line build tool which +# causes the compiler checks and try-compile stuff to fail. MSbuild +# is a better choice for this. However, VCExpress does not support +# cross compiling needed for Win CE. +IF(NOT CMAKE_CROSSCOMPILING) + FIND_PROGRAM(CMAKE_MAKE_PROGRAM + NAMES MSBuild + HINTS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;ProductDir] + "$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/" + "c:/WINDOWS/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/" + "$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\10.0;CLR Version]/") +ENDIF() + MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) SET(MSVC10 1) SET(MSVC_VERSION 1600) diff --git a/Modules/CheckCCompilerFlag.cmake b/Modules/CheckCCompilerFlag.cmake index a390b38..ec0a773 100644 --- a/Modules/CheckCCompilerFlag.cmake +++ b/Modules/CheckCCompilerFlag.cmake @@ -30,6 +30,7 @@ MACRO (CHECK_C_COMPILER_FLAG _FLAG _RESULT) FAIL_REGEX "warning: command line option .* is valid for .* but not for C" # Apple gcc FAIL_REGEX "unrecognized .*option" # GNU + FAIL_REGEX "unknown .*option" # Clang FAIL_REGEX "ignoring unknown option" # MSVC FAIL_REGEX "warning D9002" # MSVC, any lang FAIL_REGEX "[Uu]nknown option" # HP diff --git a/Modules/CheckCXXCompilerFlag.cmake b/Modules/CheckCXXCompilerFlag.cmake index 788bf35..f646e78 100644 --- a/Modules/CheckCXXCompilerFlag.cmake +++ b/Modules/CheckCXXCompilerFlag.cmake @@ -28,6 +28,7 @@ MACRO (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT) CHECK_CXX_SOURCE_COMPILES("int main() { return 0;}" ${_RESULT} # Some compilers do not fail with a bad flag FAIL_REGEX "unrecognized .*option" # GNU + FAIL_REGEX "unknown .*option" # Clang FAIL_REGEX "ignoring unknown option" # MSVC FAIL_REGEX "warning D9002" # MSVC, any lang FAIL_REGEX "[Uu]nknown option" # HP diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake index ae4a13f..dc9ab37 100644 --- a/Modules/FindBLAS.cmake +++ b/Modules/FindBLAS.cmake @@ -22,8 +22,8 @@ # BLA_F95 if set on tries to find the f95 interfaces for BLAS/LAPACK ########## ### List of vendors (BLA_VENDOR) valid in this module -## ATLAS, PhiPACK,CXML,DXML,SunPerf,SCSL,SGIMATH,IBMESSL,Intel10_32 (intel mkl v10 32 bit),Intel10_64lp (intel mkl v10 64 bit,lp thread model, lp64 model), -## Intel( older versions of mkl 32 and 64 bit), ACML,ACML_MP,Apple, NAS, Generic +## Goto,ATLAS PhiPACK,CXML,DXML,SunPerf,SCSL,SGIMATH,IBMESSL,Intel10_32 (intel mkl v10 32 bit),Intel10_64lp (intel mkl v10 64 bit,lp thread model, lp64 model), +## Intel( older versions of mkl 32 and 64 bit), ACML,ACML_MP,ACML_GPU,Apple, NAS, Generic # C/CXX should be enabled to use Intel mkl #============================================================================= @@ -57,7 +57,7 @@ else() endif(BLAS_FIND_REQUIRED) endif( ) -macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _threads) +macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread) # This macro checks for the existence of the combination of fortran libraries # given by _list. If the combination is found, this macro checks (using the # Check_Fortran_Function_Exists macro) whether can link against that library @@ -69,41 +69,38 @@ macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _threads) # N.B. _prefix is the prefix applied to the names of all cached variables that # are generated internally and marked advanced by this macro. +set(_libdir ${ARGN}) + set(_libraries_work TRUE) set(${LIBRARIES}) set(_combined_name) +if (NOT _libdir) + if (WIN32) + set(_libdir ENV LIB) + elseif (APPLE) + set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV DYLD_LIBRARY_PATH) + else () + set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH) + endif () +endif () foreach(_library ${_list}) set(_combined_name ${_combined_name}_${_library}) if(_libraries_work) - if ( WIN32 ) - if(BLA_STATIC) - set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib;.dll") - endif(BLA_STATIC) - find_library(${_prefix}_${_library}_LIBRARY - NAMES ${_library} - PATHS ENV LIB - ) - endif ( WIN32 ) - - if ( APPLE ) - if(BLA_STATIC) - set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib;.dll") - endif(BLA_STATIC) + if (BLA_STATIC) + if (WIN32) + set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib;.dll") + endif ( WIN32 ) + if (APPLE) + set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib;.dll") + else (APPLE) + set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so") + endif (APPLE) + endif (BLA_STATIC) find_library(${_prefix}_${_library}_LIBRARY - NAMES ${_library} - PATHS /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV DYLD_LIBRARY_PATH - ) - - else ( APPLE ) - if(BLA_STATIC) - set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.so") - endif(BLA_STATIC) - find_library(${_prefix}_${_library}_LIBRARY - NAMES ${_library} - PATHS /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH - ) - endif( APPLE ) + NAMES ${_library} + PATHS ${_libdir} + ) mark_as_advanced(${_prefix}_${_library}_LIBRARY) set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY}) set(_libraries_work ${${_prefix}_${_library}_LIBRARY}) @@ -139,15 +136,29 @@ else ($ENV{BLA_VENDOR} MATCHES ".+") endif(NOT BLA_VENDOR) endif ($ENV{BLA_VENDOR} MATCHES ".+") +if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") + if(NOT BLAS_LIBRARIES) + # gotoblas (http://www.tacc.utexas.edu/tacc-projects/gotoblas2) + check_fortran_libraries( + BLAS_LIBRARIES + BLAS + sgemm + "" + "goto2" + "" + ) + endif(NOT BLAS_LIBRARIES) +endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") + if (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All") if(NOT BLAS_LIBRARIES) # BLAS in ATLAS library? (http://math-atlas.sourceforge.net/) check_fortran_libraries( BLAS_LIBRARIES BLAS - cblas_dgemm + dgemm "" - "cblas;f77blas;atlas" + "f77blas;atlas" "" ) endif(NOT BLAS_LIBRARIES) @@ -255,15 +266,24 @@ if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All") endif (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All") #BLAS in acml library? -if (BLA_VENDOR STREQUAL "ACML" OR BLA_VENDOR STREQUAL "ACML_MP" OR BLA_VENDOR STREQUAL "All") -# the patch from Chuck Atkins: - if( ((_BLAS_VENDOR STREQUAL "ACML") AND (NOT BLAS_ACML_LIB_DIRS)) OR - ((_BLAS_VENDOR STREQUAL "ACML_MP") AND (NOT BLAS_ACML_MP_LIB_DIRS)) ) +if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All") + if( ((BLA_VENDOR STREQUAL "ACML") AND (NOT BLAS_ACML_LIB_DIRS)) OR + ((BLA_VENDOR STREQUAL "ACML_MP") AND (NOT BLAS_ACML_MP_LIB_DIRS)) OR + ((BLA_VENDOR STREQUAL "ACML_GPU") AND (NOT BLAS_ACML_GPU_LIB_DIRS)) + ) + # try to find acml in "standard" paths if( WIN32 ) file( GLOB _ACML_ROOT "C:/AMD/acml*/ACML-EULA.txt" ) else() file( GLOB _ACML_ROOT "/opt/acml*/ACML-EULA.txt" ) endif() + if( WIN32 ) + file( GLOB _ACML_GPU_ROOT "C:/AMD/acml*/GPGPUexamples" ) + else() + file( GLOB _ACML_GPU_ROOT "/opt/acml*/GPGPUexamples" ) + endif() + list(GET _ACML_ROOT 0 _ACML_ROOT) + list(GET _ACML_GPU_ROOT 0 _ACML_GPU_ROOT) if( _ACML_ROOT ) get_filename_component( _ACML_ROOT ${_ACML_ROOT} PATH ) if( SIZEOF_INTEGER EQUAL 8 ) @@ -297,7 +317,7 @@ if (BLA_VENDOR STREQUAL "ACML" OR BLA_VENDOR STREQUAL "ACML_MP" OR BLA_VENDOR ST set( _ACML_COMPILER64 "gfortran64" ) endif() - if( _BLAS_VENDOR STREQUAL "ACML_MP" ) + if( BLA_VENDOR STREQUAL "ACML_MP" ) set(_ACML_MP_LIB_DIRS "${_ACML_ROOT}/${_ACML_COMPILER32}_mp${_ACML_PATH_SUFFIX}/lib" "${_ACML_ROOT}/${_ACML_COMPILER64}_mp${_ACML_PATH_SUFFIX}/lib" ) @@ -307,19 +327,43 @@ if (BLA_VENDOR STREQUAL "ACML" OR BLA_VENDOR STREQUAL "ACML_MP" OR BLA_VENDOR ST "${_ACML_ROOT}/${_ACML_COMPILER64}${_ACML_PATH_SUFFIX}/lib" ) endif() endif() + elseif(BLAS_${BLA_VENDOR}_LIB_DIRS) + set(_${BLA_VENDOR}_LIB_DIRS ${BLAS_${BLA_VENDOR}_LIB_DIRS}) endif() - if( _BLAS_VENDOR STREQUAL "ACML_MP" ) - foreach( BLAS_ACML_MP_LIB_DIRS ${_ACML_MP_LIB_DIRS} ) - _BLAS_LOCATE_AND_TEST( ${_BLAS_VENDOR} "acml_mp;acml_mv" "" ) - if( BLAS_${_BLAS_VENDOR}_FOUND ) + if( BLA_VENDOR STREQUAL "ACML_MP" ) + foreach( BLAS_ACML_MP_LIB_DIRS ${_ACML_MP_LIB_DIRS}) + check_fortran_libraries ( + BLAS_LIBRARIES + BLAS + sgemm + "" "acml_mp;acml_mv" "" ${BLAS_ACML_MP_LIB_DIRS} + ) + if( BLAS_LIBRARIES ) + break() + endif() + endforeach() + elseif( BLA_VENDOR STREQUAL "ACML_GPU" ) + foreach( BLAS_ACML_GPU_LIB_DIRS ${_ACML_GPU_LIB_DIRS}) + check_fortran_libraries ( + BLAS_LIBRARIES + BLAS + sgemm + "" "acml_mp;acml_mv;CALBLAS" "" ${BLAS_ACML_GPU_LIB_DIRS} + ) + if( BLAS_LIBRARIES ) break() endif() endforeach() else() #if( _BLAS_VENDOR STREQUAL "ACML" ) foreach( BLAS_ACML_LIB_DIRS ${_ACML_LIB_DIRS} ) - _BLAS_LOCATE_AND_TEST( ${_BLAS_VENDOR} "acml;acml_mv" "" ) - if( BLAS_${_BLAS_VENDOR}_FOUND ) + check_fortran_libraries ( + BLAS_LIBRARIES + BLAS + sgemm + "" "acml_mp;acml_mv" "" ${BLAS_ACML_LIB_DIRS} + ) + if( BLAS_LIBRARIES ) break() endif() endforeach() @@ -346,6 +390,16 @@ if (BLA_VENDOR STREQUAL "ACML" OR BLA_VENDOR STREQUAL "ACML_MP" OR BLA_VENDOR ST "" ) endif(NOT BLAS_LIBRARIES) + if(NOT BLAS_LIBRARIES) + check_fortran_libraries( + BLAS_LIBRARIES + BLAS + sgemm + "" + "acml;acml_mv;CALBLAS" + "" + ) + endif(NOT BLAS_LIBRARIES) endif () # ACML # Apple BLAS library? diff --git a/Modules/FindDCMTK.cmake b/Modules/FindDCMTK.cmake index 0ac22f8..361d09e 100644 --- a/Modules/FindDCMTK.cmake +++ b/Modules/FindDCMTK.cmake @@ -108,8 +108,10 @@ foreach(dir PATHS ${DCMTK_DIR}/${dir}/include ${DCMTK_DIR}/${dir} - ${DCMTK_DIR}/include/${dir}) - + ${DCMTK_DIR}/include/${dir} + ${DCMTK_DIR}/include/dcmtk/${dir} + ${DCMTK_DIR}/${dir}/include/dcmtk/${dir} + ) mark_as_advanced(DCMTK_${dir}_INCLUDE_DIR) if(DCMTK_${dir}_INCLUDE_DIR) diff --git a/Modules/FindGettext.cmake b/Modules/FindGettext.cmake index 9398b54..0f11234 100644 --- a/Modules/FindGettext.cmake +++ b/Modules/FindGettext.cmake @@ -11,9 +11,22 @@ # given input po files into the binary output mo file. If the # ALL option is used, the translations will also be created when # building the default target. +# GETTEXT_PROCESS_POT( <potfile> [ALL] [INSTALL_DESTINATION <destdir>] LANGUAGES <lang1> <lang2> ... ) +# Process the given pot file to mo files. +# If INSTALL_DESTINATION is given then automatically install rules will be created, +# the language subdirectory will be taken into account (by default use share/locale/). +# If ALL is specified, the pot file is processed when building the all traget. +# It creates a custom target "potfile". +# GETTEXT_PROCESS_PO_FILES( <lang> [ALL] [INSTALL_DESTINATION <dir>] PO_FILES <po1> <po2> ... ) +# Process the given po files to mo files for the given language. +# If INSTALL_DESTINATION is given then automatically install rules will be created, +# the language subdirectory will be taken into account (by default use share/locale/). +# If ALL is specified, the po files are processed when building the all traget. +# It creates a custom target "pofiles". #============================================================================= # Copyright 2007-2009 Kitware, Inc. +# Copyright 2007 Alexander Neundorf <neundorf@kde.org> # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -29,6 +42,11 @@ FIND_PROGRAM(GETTEXT_MSGMERGE_EXECUTABLE msgmerge) FIND_PROGRAM(GETTEXT_MSGFMT_EXECUTABLE msgfmt) +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Gettext REQUIRED_VARS GETTEXT_MSGMERGE_EXECUTABLE GETTEXT_MSGFMT_EXECUTABLE) + +INCLUDE(CMakeParseArguments) + MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg) # make it a real variable, so we can modify it here SET(_firstPoFile "${_firstPoFileArg}") @@ -49,14 +67,14 @@ MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg) GET_FILENAME_COMPONENT(_lang ${_absFile} NAME_WE) SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo) - ADD_CUSTOM_COMMAND( - OUTPUT ${_gmoFile} + ADD_CUSTOM_COMMAND( + OUTPUT ${_gmoFile} COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_absFile} ${_absPotFile} COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_absFile} - DEPENDS ${_absPotFile} ${_absFile} + DEPENDS ${_absPotFile} ${_absFile} ) - INSTALL(FILES ${_gmoFile} DESTINATION share/locale/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo) + INSTALL(FILES ${_gmoFile} DESTINATION share/locale/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo) SET(_gmoFiles ${_gmoFiles} ${_gmoFile}) ENDFOREACH (_currentPoFile ) @@ -65,6 +83,78 @@ MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg) ENDMACRO(GETTEXT_CREATE_TRANSLATIONS ) + +FUNCTION(GETTEXT_PROCESS_POT_FILE _potFile) + SET(_gmoFiles) + SET(_options ALL) + SET(_oneValueArgs INSTALL_DESTINATION) + SET(_multiValueArgs LANGUAGES) + + CMAKE_PARSE_ARGUMENTS(_parsedArguments "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) + + GET_FILENAME_COMPONENT(_potBasename ${_potFile} NAME_WE) + GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE) + + FOREACH (_lang ${_parsedArguments_LANGUAGES}) + SET(_poFile "${CMAKE_CURRENT_BINARY_DIR}/${_lang}.po") + SET(_gmoFile "${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo") + + ADD_CUSTOM_COMMAND( + OUTPUT "${_poFile}" + COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_poFile} ${_absPotFile} + DEPENDS ${_absPotFile} + ) + + ADD_CUSTOM_COMMAND( + OUTPUT "${_gmoFile}" + COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_poFile} + DEPENDS ${_absPotFile} ${_poFile} + ) + + IF(_parsedArguments_INSTALL_DESTINATION) + INSTALL(FILES ${_gmoFile} DESTINATION ${_parsedArguments_INSTALL_DESTINATION}/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo) + ENDIF(_parsedArguments_INSTALL_DESTINATION) + LIST(APPEND _gmoFiles ${_gmoFile}) + ENDFOREACH (_lang ) + + IF(_parsedArguments_ALL) + ADD_CUSTOM_TARGET(potfiles ALL DEPENDS ${_gmoFiles}) + ELSE(_parsedArguments_ALL) + ADD_CUSTOM_TARGET(potfiles DEPENDS ${_gmoFiles}) + ENDIF(_parsedArguments_ALL) +ENDFUNCTION(GETTEXT_PROCESS_POT_FILE) + + +FUNCTION(GETTEXT_PROCESS_PO_FILES _lang) + SET(_options ALL) + SET(_oneValueArgs INSTALL_DESTINATION) + SET(_multiValueArgs PO_FILES) + SET(_gmoFiles) + + CMAKE_PARSE_ARGUMENTS(_parsedArguments "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN}) + + FOREACH(_current_PO_FILE ${_parsedArguments_PO_FILES}) + GET_FILENAME_COMPONENT(_basename ${_current_PO_FILE} NAME_WE) + SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo) + ADD_CUSTOM_COMMAND(OUTPUT ${_gmoFile} + COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_current_PO_FILE} + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + DEPENDS ${_current_PO_FILE} + ) + + IF(_parsedArguments_INSTALL_DESTINATION) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo DESTINATION ${_parsedArguments_INSTALL_DESTINATION}/${_lang}/LC_MESSAGES/ RENAME ${_basename}.mo) + ENDIF(_parsedArguments_INSTALL_DESTINATION) + LIST(APPEND _gmoFiles ${_gmoFile}) + ENDFOREACH(_current_PO_FILE) + + IF(_parsedArguments_ALL) + ADD_CUSTOM_TARGET(pofiles ALL DEPENDS ${_gmoFiles}) + ELSE(_parsedArguments_ALL) + ADD_CUSTOM_TARGET(pofiles DEPENDS ${_gmoFiles}) + ENDIF(_parsedArguments_ALL) +ENDFUNCTION(GETTEXT_PROCESS_PO_FILES) + IF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE ) SET(GETTEXT_FOUND TRUE) ELSE (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE ) @@ -73,6 +163,3 @@ ELSE (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE ) MESSAGE(FATAL_ERROR "GetText not found") ENDIF (GetText_REQUIRED) ENDIF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE ) - - - diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index 6f01ea0..bc60638 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -10,8 +10,8 @@ # are specified, then the find module will default to finding only the HDF5 C # library. If one or more COMPONENTS are specified, the module will attempt to # find the language bindings for the specified components. The only valid -# components are C, CXX, Fortran, and HL. If the COMPONENTS argument is not -# given, the module will attempt to find only the C bindings. +# components are C, CXX, Fortran, HL, and Fortran_HL. If the COMPONENTS +# argument is not given, the module will attempt to find only the C bindings. # # On UNIX systems, this module will read the variable HDF5_USE_STATIC_LIBRARIES # to determine whether or not to prefer a static link to a dynamic link for HDF5 @@ -34,6 +34,8 @@ # HDF5_CXX_LIBRARIES - Required libraries for the HDF5 C++ bindings # HDF5_Fortran_LIBRARIES - Required libraries for the HDF5 Fortran bindings # HDF5_HL_LIBRARIES - Required libraries for the HDF5 high level API +# HDF5_Fortran_HL_LIBRARIES - Required libraries for the high level Fortran +# bindings. # HDF5_LIBRARIES - Required libraries for all requested bindings # HDF5_FOUND - true if HDF5 was found on the system # HDF5_LIBRARY_DIRS - the full set of library directories @@ -67,6 +69,7 @@ set( HDF5_VALID_COMPONENTS CXX Fortran HL + Fortran_HL ) # Validate the list of find components. @@ -189,6 +192,7 @@ if( NOT HDF5_FOUND ) set( HDF5_CXX_TARGET hdf5_cpp ) set( HDF5_HL_TARGET hdf5_hl ) set( HDF5_Fortran_TARGET hdf5_fortran ) + set( HDF5_Fortran_HL_TARGET hdf5_hl_fortran ) foreach( _component ${HDF5_LANGUAGE_BINDINGS} ) list( FIND HDF5_VALID_COMPONENTS ${_component} _component_location ) get_target_property( _comp_location ${HDF5_${_component}_TARGET} LOCATION ) @@ -211,7 +215,10 @@ if( NOT HDF5_FOUND ) set( HDF5_C_LIBRARY_NAMES_INIT hdf5 ) set( HDF5_HL_LIBRARY_NAMES_INIT hdf5_hl ${HDF5_C_LIBRARY_NAMES_INIT} ) set( HDF5_CXX_LIBRARY_NAMES_INIT hdf5_cpp ${HDF5_C_LIBRARY_NAMES_INIT} ) - set( HDF5_Fortran_LIBRARY_NAMES_INIT hdf5_fortran ${HDF5_C_LIBRARY_NAMES_INIT} ) + set( HDF5_Fortran_LIBRARY_NAMES_INIT hdf5_fortran + ${HDF5_C_LIBRARY_NAMES_INIT} ) + set( HDF5_Fortran_HL_LIBRARY_NAMES_INIT hdf5hl_fortran + ${HDF5_Fortran_LIBRARY_NAMES_INIT} ) foreach( LANGUAGE ${HDF5_LANGUAGE_BINDINGS} ) if( HDF5_${LANGUAGE}_COMPILE_LINE ) @@ -222,8 +229,8 @@ if( NOT HDF5_FOUND ) HDF5_${LANGUAGE}_LIBRARY_NAMES ) - # take a guess that the includes may be in the 'include' sibling directory - # of a library directory. + # take a guess that the includes may be in the 'include' sibling + # directory of a library directory. foreach( dir ${HDF5_${LANGUAGE}_LIBRARY_DIRS} ) list( APPEND HDF5_${LANGUAGE}_INCLUDE_FLAGS ${dir}/../include ) endforeach() @@ -233,7 +240,7 @@ if( NOT HDF5_FOUND ) list( APPEND HDF5_DEFINITIONS ${HDF5_${LANGUAGE}_DEFINITIONS} ) # find the HDF5 include directories - if(${LANGUAGE} STREQUAL "Fortran") + if(${LANGUAGE} MATCHES "Fortran.*") set(HDF5_INCLUDE_FILENAME hdf5.mod) else() set(HDF5_INCLUDE_FILENAME hdf5.h) diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake index 1b11a34..34a7077 100644 --- a/Modules/FindJava.cmake +++ b/Modules/FindJava.cmake @@ -130,11 +130,6 @@ IF(Java_JAVA_EXECUTABLE) else( ) set(Java_VERSION ${Java_VERSION_MAJOR}.${Java_VERSION_MINOR}.${Java_VERSION_PATCH}.${Java_VERSION_TWEAK}) endif( ) - # display info - #MESSAGE( STATUS "Java version ${Java_VERSION_STRING} configured successfully!" ) # keep me, used for debug - IF(NOT Java_FIND_QUIETLY) - MESSAGE( STATUS "Java version ${Java_VERSION} configured successfully!" ) - ENDIF(NOT Java_FIND_QUIETLY) ENDIF() ENDIF(Java_JAVA_EXECUTABLE) diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake index bf45406..80fe867 100644 --- a/Modules/FindLAPACK.cmake +++ b/Modules/FindLAPACK.cmake @@ -148,31 +148,28 @@ if(BLAS_FOUND) set(BLA_VENDOR "All") endif(NOT BLA_VENDOR) endif ($ENV{BLA_VENDOR} MATCHES ".+") + +if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") + if(NOT LAPACK_LIBRARIES) + check_lapack_libraries( + LAPACK_LIBRARIES + LAPACK + cheev + "" + "goto2" + "${BLAS_LIBRARIES}" + "" + ) + endif(NOT LAPACK_LIBRARIES) +endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") + + #acml lapack - if (BLA_VENDOR STREQUAL "ACML" OR BLA_VENDOR STREQUAL "All") - if(NOT LAPACK_LIBRARIES) - check_lapack_libraries( - LAPACK_LIBRARIES - LAPACK - cheev - "" - "acml;acml_mv" - "" - "" - ) - endif(NOT LAPACK_LIBRARIES) - if(NOT LAPACK_LIBRARIES) - check_lapack_libraries( - LAPACK_LIBRARIES - LAPACK - cheev - "" - "acml_mp;acml_mv" - "" - "" - ) - endif(NOT LAPACK_LIBRARIES) - endif (BLA_VENDOR STREQUAL "ACML" OR BLA_VENDOR STREQUAL "All") + if (BLA_VENDOR STREQUAL "ACML.*" OR BLA_VENDOR STREQUAL "All") + if (BLAS_LIBRARIES MATCHES ".+acml.+") + set (LAPACK_LIBRARIES ${BLAS_LIBRARIES}) + endif () + endif () # Apple LAPACK library? if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All") diff --git a/Modules/FindX11.cmake b/Modules/FindX11.cmake index df44979..9df3f01 100644 --- a/Modules/FindX11.cmake +++ b/Modules/FindX11.cmake @@ -6,6 +6,7 @@ # # and also the following more fine grained variables: # Include paths: X11_ICE_INCLUDE_PATH, X11_ICE_LIB, X11_ICE_FOUND +# X11_SM_INCLUDE_PATH, X11_SM_LIB, X11_SM_FOUND # X11_X11_INCLUDE_PATH, X11_X11_LIB # X11_Xaccessrules_INCLUDE_PATH, X11_Xaccess_FOUND # X11_Xaccessstr_INCLUDE_PATH, X11_Xaccess_FOUND @@ -27,6 +28,7 @@ # X11_Xinput_INCLUDE_PATH, X11_Xinput_LIB, X11_Xinput_FOUND # X11_Xkb_INCLUDE_PATH, X11_Xkb_FOUND # X11_Xkblib_INCLUDE_PATH, X11_Xkb_FOUND +# X11_Xkbfile_INCLUDE_PATH, X11_Xkbfile_LIB, X11_Xkbfile_FOUND # X11_Xpm_INCLUDE_PATH, X11_Xpm_LIB, X11_Xpm_FOUND # X11_XTest_INCLUDE_PATH, X11_XTest_LIB, X11_XTest_FOUND # X11_Xrandr_INCLUDE_PATH, X11_Xrandr_LIB, X11_Xrandr_FOUND @@ -35,6 +37,8 @@ # X11_Xt_INCLUDE_PATH, X11_Xt_LIB, X11_Xt_FOUND # X11_Xutil_INCLUDE_PATH, X11_Xutil_FOUND # X11_Xv_INCLUDE_PATH, X11_Xv_LIB, X11_Xv_FOUND +# X11_XSync_INCLUDE_PATH, (in X11_Xext_LIB), X11_XSync_FOUND + #============================================================================= # Copyright 2001-2009 Kitware, Inc. @@ -57,11 +61,11 @@ IF (UNIX) SET(CMAKE_FIND_FRAMEWORK NEVER) SET(X11_INC_SEARCH_PATH /usr/pkg/xorg/include - /usr/X11R6/include - /usr/X11R7/include + /usr/X11R6/include + /usr/X11R7/include /usr/include/X11 - /usr/openwin/include - /usr/openwin/share/include + /usr/openwin/include + /usr/openwin/share/include /opt/graphics/OpenGL/include ) @@ -69,7 +73,7 @@ IF (UNIX) /usr/pkg/xorg/lib /usr/X11R6/lib /usr/X11R7/lib - /usr/openwin/lib + /usr/openwin/lib ) FIND_PATH(X11_X11_INCLUDE_PATH X11/X.h ${X11_INC_SEARCH_PATH}) @@ -77,9 +81,10 @@ IF (UNIX) # Look for includes; keep the list sorted by name of the cmake *_INCLUDE_PATH # variable (which doesn't need to match the include file name). - + # Solaris lacks XKBrules.h, so we should skip kxkbd there. FIND_PATH(X11_ICE_INCLUDE_PATH X11/ICE/ICE.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_SM_INCLUDE_PATH X11/SM/SM.h ${X11_INC_SEARCH_PATH}) FIND_PATH(X11_Xaccessrules_INCLUDE_PATH X11/extensions/XKBrules.h ${X11_INC_SEARCH_PATH}) FIND_PATH(X11_Xaccessstr_INCLUDE_PATH X11/extensions/XKBstr.h ${X11_INC_SEARCH_PATH}) FIND_PATH(X11_Xau_INCLUDE_PATH X11/Xauth.h ${X11_INC_SEARCH_PATH}) @@ -97,6 +102,7 @@ IF (UNIX) FIND_PATH(X11_Xinput_INCLUDE_PATH X11/extensions/XInput.h ${X11_INC_SEARCH_PATH}) FIND_PATH(X11_Xkb_INCLUDE_PATH X11/extensions/XKB.h ${X11_INC_SEARCH_PATH}) FIND_PATH(X11_Xkblib_INCLUDE_PATH X11/XKBlib.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_Xkbfile_INCLUDE_PATH X11/extensions/XKBfile.h ${X11_INC_SEARCH_PATH}) FIND_PATH(X11_Xpm_INCLUDE_PATH X11/xpm.h ${X11_INC_SEARCH_PATH}) FIND_PATH(X11_XTest_INCLUDE_PATH X11/extensions/XTest.h ${X11_INC_SEARCH_PATH}) FIND_PATH(X11_XShm_INCLUDE_PATH X11/extensions/XShm.h ${X11_INC_SEARCH_PATH}) @@ -107,6 +113,7 @@ IF (UNIX) FIND_PATH(X11_Xutil_INCLUDE_PATH X11/Xutil.h ${X11_INC_SEARCH_PATH}) FIND_PATH(X11_Xt_INCLUDE_PATH X11/Intrinsic.h ${X11_INC_SEARCH_PATH}) FIND_PATH(X11_Xv_INCLUDE_PATH X11/extensions/Xvlib.h ${X11_INC_SEARCH_PATH}) + FIND_PATH(X11_XSync_INCLUDE_PATH X11/extensions/sync.h ${X11_INC_SEARCH_PATH}) FIND_LIBRARY(X11_X11_LIB X11 ${X11_LIB_SEARCH_PATH}) @@ -125,6 +132,7 @@ IF (UNIX) FIND_LIBRARY(X11_Xi_LIB Xi ${X11_LIB_SEARCH_PATH}) FIND_LIBRARY(X11_Xinerama_LIB Xinerama ${X11_LIB_SEARCH_PATH}) FIND_LIBRARY(X11_Xinput_LIB Xi ${X11_LIB_SEARCH_PATH}) + FIND_LIBRARY(X11_Xkbfile_LIB xkbfile ${X11_LIB_SEARCH_PATH}) FIND_LIBRARY(X11_Xpm_LIB Xpm ${X11_LIB_SEARCH_PATH}) FIND_LIBRARY(X11_Xrandr_LIB Xrandr ${X11_LIB_SEARCH_PATH}) FIND_LIBRARY(X11_Xrender_LIB Xrender ${X11_LIB_SEARCH_PATH}) @@ -277,15 +285,30 @@ IF (UNIX) SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkb_INCLUDE_PATH} ) ENDIF (X11_Xkb_INCLUDE_PATH AND X11_Xkblib_INCLUDE_PATH AND X11_Xlib_INCLUDE_PATH) + IF (X11_Xkbfile_INCLUDE_PATH AND X11_Xkbfile_LIB AND X11_Xlib_INCLUDE_PATH) + SET(X11_Xkbfile_FOUND TRUE) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkbfile_INCLUDE_PATH} ) + ENDIF (X11_Xkbfile_INCLUDE_PATH AND X11_Xkbfile_LIB AND X11_Xlib_INCLUDE_PATH) + IF (X11_Xinput_INCLUDE_PATH AND X11_Xinput_LIB) SET(X11_Xinput_FOUND TRUE) SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinput_INCLUDE_PATH}) ENDIF (X11_Xinput_INCLUDE_PATH AND X11_Xinput_LIB) + IF (X11_XSync_INCLUDE_PATH) + SET(X11_XSync_FOUND TRUE) + SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XSync_INCLUDE_PATH}) + ENDIF (X11_XSync_INCLUDE_PATH) + IF(X11_ICE_LIB AND X11_ICE_INCLUDE_PATH) SET(X11_ICE_FOUND TRUE) ENDIF(X11_ICE_LIB AND X11_ICE_INCLUDE_PATH) + IF(X11_SM_LIB AND X11_SM_INCLUDE_PATH) + SET(X11_SM_FOUND TRUE) + ENDIF(X11_SM_LIB AND X11_SM_INCLUDE_PATH) + + # Deprecated variable for backwards compatibility with CMake 1.4 IF (X11_X11_INCLUDE_PATH AND X11_LIBRARIES) SET(X11_FOUND 1) @@ -306,11 +329,11 @@ IF (UNIX) CHECK_LIBRARY_EXISTS("${X11_LIBRARIES}" "XOpenDisplay" "${X11_LIBRARY_DIR}" X11_LIB_X11_SOLO) IF(NOT X11_LIB_X11_SOLO) # Find library needed for dnet_ntoa. - CHECK_LIBRARY_EXISTS("dnet" "dnet_ntoa" "" X11_LIB_DNET_HAS_DNET_NTOA) + CHECK_LIBRARY_EXISTS("dnet" "dnet_ntoa" "" X11_LIB_DNET_HAS_DNET_NTOA) IF (X11_LIB_DNET_HAS_DNET_NTOA) SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet) ELSE (X11_LIB_DNET_HAS_DNET_NTOA) - CHECK_LIBRARY_EXISTS("dnet_stub" "dnet_ntoa" "" X11_LIB_DNET_STUB_HAS_DNET_NTOA) + CHECK_LIBRARY_EXISTS("dnet_stub" "dnet_ntoa" "" X11_LIB_DNET_STUB_HAS_DNET_NTOA) IF (X11_LIB_DNET_STUB_HAS_DNET_NTOA) SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet_stub) ENDIF (X11_LIB_DNET_STUB_HAS_DNET_NTOA) @@ -320,11 +343,11 @@ IF (UNIX) # Find library needed for gethostbyname. CHECK_FUNCTION_EXISTS("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME) IF(NOT CMAKE_HAVE_GETHOSTBYNAME) - CHECK_LIBRARY_EXISTS("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME) + CHECK_LIBRARY_EXISTS("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME) IF (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME) SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lnsl) ELSE (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME) - CHECK_LIBRARY_EXISTS("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME) + CHECK_LIBRARY_EXISTS("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME) IF (CMAKE_LIB_BSD_HAS_GETHOSTBYNAME) SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lbsd) ENDIF (CMAKE_LIB_BSD_HAS_GETHOSTBYNAME) @@ -334,7 +357,7 @@ IF (UNIX) # Find library needed for connect. CHECK_FUNCTION_EXISTS("connect" CMAKE_HAVE_CONNECT) IF(NOT CMAKE_HAVE_CONNECT) - CHECK_LIBRARY_EXISTS("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT) + CHECK_LIBRARY_EXISTS("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT) IF (CMAKE_LIB_SOCKET_HAS_CONNECT) SET (X11_X_EXTRA_LIBS -lsocket ${X11_X_EXTRA_LIBS}) ENDIF (CMAKE_LIB_SOCKET_HAS_CONNECT) @@ -343,7 +366,7 @@ IF (UNIX) # Find library needed for remove. CHECK_FUNCTION_EXISTS("remove" CMAKE_HAVE_REMOVE) IF(NOT CMAKE_HAVE_REMOVE) - CHECK_LIBRARY_EXISTS("posix" "remove" "" CMAKE_LIB_POSIX_HAS_REMOVE) + CHECK_LIBRARY_EXISTS("posix" "remove" "" CMAKE_LIB_POSIX_HAS_REMOVE) IF (CMAKE_LIB_POSIX_HAS_REMOVE) SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lposix) ENDIF (CMAKE_LIB_POSIX_HAS_REMOVE) @@ -352,7 +375,7 @@ IF (UNIX) # Find library needed for shmat. CHECK_FUNCTION_EXISTS("shmat" CMAKE_HAVE_SHMAT) IF(NOT CMAKE_HAVE_SHMAT) - CHECK_LIBRARY_EXISTS("ipc" "shmat" "" CMAKE_LIB_IPS_HAS_SHMAT) + CHECK_LIBRARY_EXISTS("ipc" "shmat" "" CMAKE_LIB_IPS_HAS_SHMAT) IF (CMAKE_LIB_IPS_HAS_SHMAT) SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lipc) ENDIF (CMAKE_LIB_IPS_HAS_SHMAT) @@ -422,6 +445,8 @@ IF (UNIX) X11_Xdmcp_INCLUDE_PATH X11_Xkb_INCLUDE_PATH X11_Xkblib_INCLUDE_PATH + X11_Xkbfile_INCLUDE_PATH + X11_Xkbfile_LIB X11_Xscreensaver_INCLUDE_PATH X11_Xscreensaver_LIB X11_Xpm_INCLUDE_PATH @@ -437,6 +462,8 @@ IF (UNIX) X11_ICE_LIB X11_ICE_INCLUDE_PATH X11_SM_LIB + X11_SM_INCLUDE_PATH + X11_XSync_INCLUDE_PATH ) SET(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_SAVE}) ENDIF (UNIX) diff --git a/Modules/Platform/AIX-VisualAge-Fortran.cmake b/Modules/Platform/AIX-VisualAge-Fortran.cmake new file mode 100644 index 0000000..19e59d6 --- /dev/null +++ b/Modules/Platform/AIX-VisualAge-Fortran.cmake @@ -0,0 +1 @@ +include(Platform/AIX-XL-Fortran) diff --git a/Modules/WriteBasicConfigVersionFile.cmake b/Modules/WriteBasicConfigVersionFile.cmake new file mode 100644 index 0000000..0b6519d --- /dev/null +++ b/Modules/WriteBasicConfigVersionFile.cmake @@ -0,0 +1,69 @@ +# WRITE_BASIC_CONFIG_VERSION_FILE( filename VERSION major.minor.patch COMPATIBILITY (AnyNewerVersion|SameMajorVersion) ) +# +# Writes a file for use as <package>ConfigVersion.cmake file to <filename>. +# See the documentation of FIND_PACKAGE() for details on this. +# filename is the output filename, it should be in the build tree. +# major.minor.patch is the version number of the project to be installed +# The COMPATIBILITY mode AnyNewerVersion means that the installed package version +# will be considered compatible if it is newer or exactly the same as the requested version. +# If SameMajorVersion is used instead, then the behaviour differs from AnyNewerVersion +# in that the major version number must be the same as requested, e.g. version 2.0 will +# not be considered compatible if 1.0 is requested. +# If your project has more elaborated version matching rules, you will need to write your +# own custom ConfigVersion.cmake file instead of using this macro. +# +# Example: +# write_basic_config_version_file(${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake +# VERSION 1.2.3 +# COMPATIBILITY SameMajorVersion ) +# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake +# ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake +# DESTINATION lib/cmake/Foo ) +# +# Internally, this macro executes configure_file() to create the resulting +# version file. Depending on the COMPATIBLITY, either the file +# BasicConfigVersion-SameMajorVersion.cmake.in or BasicConfigVersion-AnyNewerVersion.cmake.in +# is used. Please note that these two files are internal to CMake and you should +# not call configure_file() on them yourself, but they can be used as starting +# point to create more sophisticted custom ConfigVersion.cmake files. + +#============================================================================= +# Copyright 2008-2011 Alexander Neundorf, <neundorf@kde.org> +# Copyright 2004-2009 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.) + +include(CMakeParseArguments) + +function(WRITE_BASIC_CONFIG_VERSION_FILE _filename) + + set(options ) + set(oneValueArgs VERSION COMPATIBILITY ) + set(multiValueArgs ) + + cmake_parse_arguments(CVF "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + if(CVF_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "Unknown keywords given to WRITE_BASIC_CONFIG_VERSION_FILE(): \"${CVF_UNPARSED_ARGUMENTS}\"") + endif(CVF_UNPARSED_ARGUMENTS) + + set(versionTemplateFile "${CMAKE_ROOT}/Modules/BasicConfigVersion-${CVF_COMPATIBILITY}.cmake.in") + if(NOT EXISTS "${versionTemplateFile}") + message(FATAL_ERROR "Bad COMPATIBILITY value used for WRITE_BASIC_CONFIG_VERSION_FILE(): \"${CVF_COMPATIBILITY}\"") + endif() + + if("${CVF_VERSION}" STREQUAL "") + message(FATAL_ERROR "No VERSION specified for WRITE_BASIC_CONFIG_VERSION_FILE()") + endif() + + configure_file("${versionTemplateFile}" "${_filename}" @ONLY) + +endfunction(WRITE_BASIC_CONFIG_VERSION_FILE) diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index b824e47..9b12393 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -33,6 +33,7 @@ #include <float.h> #include <memory> // auto_ptr +#include <set> //---------------------------------------------------------------------- class cmCTestSubdirCommand : public cmCommand @@ -617,9 +618,13 @@ int cmCTestTestHandler::ProcessHandler() << "The following tests FAILED:" << std::endl); this->StartLogFile("TestsFailed", ofs); - std::vector<cmCTestTestHandler::cmCTestTestResult>::iterator ftit; - for(ftit = this->TestResults.begin(); - ftit != this->TestResults.end(); ++ftit) + typedef std::set<cmCTestTestHandler::cmCTestTestResult, + cmCTestTestResultLess> SetOfTests; + SetOfTests resultsSet(this->TestResults.begin(), + this->TestResults.end()); + + for(SetOfTests::iterator ftit = resultsSet.begin(); + ftit != resultsSet.end(); ++ftit) { if ( ftit->Status != cmCTestTestHandler::COMPLETED ) { diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h index 3089d35..8e59e59 100644 --- a/Source/CTest/cmCTestTestHandler.h +++ b/Source/CTest/cmCTestTestHandler.h @@ -125,7 +125,16 @@ public: cmCTestTestProperties* Properties; }; - // add configuraitons to a search path for an executable + struct cmCTestTestResultLess + { + bool operator() (const cmCTestTestResult &lhs, + const cmCTestTestResult &rhs) const + { + return lhs.TestCount < rhs.TestCount; + } + }; + + // add configurations to a search path for an executable static void AddConfigurations(cmCTest *ctest, std::vector<std::string> &attempted, std::vector<std::string> &attemptedConfigs, @@ -141,7 +150,7 @@ public: typedef std::vector<cmCTestTestProperties> ListOfTests; protected: - // comput a final test list + // compute a final test list virtual int PreProcessHandler(); virtual int PostProcessHandler(); virtual void GenerateTestCommand(std::vector<std::string>& args); diff --git a/Source/cmBuildCommand.h b/Source/cmBuildCommand.h index 703ff88..1d247d2 100644 --- a/Source/cmBuildCommand.h +++ b/Source/cmBuildCommand.h @@ -15,9 +15,9 @@ #include "cmCommand.h" /** \class cmBuildCommand - * \brief Build a CMAKE variable + * \brief build_command command * - * cmBuildCommand sets a variable to a value with expansion. + * cmBuildCommand implements the build_command CMake command */ class cmBuildCommand : public cmCommand { diff --git a/Source/cmBuildNameCommand.h b/Source/cmBuildNameCommand.h index 35c0ae0..29a680f 100644 --- a/Source/cmBuildNameCommand.h +++ b/Source/cmBuildNameCommand.h @@ -15,9 +15,9 @@ #include "cmCommand.h" /** \class cmBuildNameCommand - * \brief BuildName a CMAKE variable + * \brief build_name command * - * cmBuildNameCommand sets a variable to a value with expansion. + * cmBuildNameCommand implements the build_name CMake command */ class cmBuildNameCommand : public cmCommand { diff --git a/Source/cmCMakeMinimumRequired.h b/Source/cmCMakeMinimumRequired.h index 9bf7ef8..1121386 100644 --- a/Source/cmCMakeMinimumRequired.h +++ b/Source/cmCMakeMinimumRequired.h @@ -15,9 +15,9 @@ #include "cmCommand.h" /** \class cmCMakeMinimumRequired - * \brief Build a CMAKE variable + * \brief cmake_minimum_required command * - * cmCMakeMinimumRequired sets a variable to a value with expansion. + * cmCMakeMinimumRequired implements the cmake_minimum_required CMake command */ class cmCMakeMinimumRequired : public cmCommand { diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index a4ca363..3a0ed06 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -276,9 +276,11 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index, for(std::set<cmStdString>::const_iterator i = utils.begin(); i != utils.end(); ++i) { - cmTarget* transitive_dependee = - dependee->GetMakefile()->FindTargetToUse(i->c_str()); - this->AddTargetDepend(depender_index, transitive_dependee, false); + if(cmTarget* transitive_dependee = + dependee->GetMakefile()->FindTargetToUse(i->c_str())) + { + this->AddTargetDepend(depender_index, transitive_dependee, false); + } } } else diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 5aed5e2..2e72b58 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -191,6 +191,9 @@ void cmFindPackageCommand::GenerateDocumentation() "\"<config-file>-version.cmake\" or \"<config-file>Version.cmake\". " "If no such version file is available then the configuration file " "is assumed to not be compatible with any requested version. " + "A basic version file containing generic version matching code can be " + "created using the macro write_basic_config_version_file(), see its " + "documentation for more details. " "When a version file is found it is loaded to check the requested " "version number. " "The version file is loaded in a nested scope in which the following " diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index b3e2e7a..73967912 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -336,6 +336,9 @@ cmGlobalXCodeGenerator::PostBuildMakeTarget(std::string const& tName, } //---------------------------------------------------------------------------- +#define CMAKE_CHECK_BUILD_SYSTEM_TARGET "ZERO_CHECK" + +//---------------------------------------------------------------------------- void cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root, std::vector<cmLocalGenerator*>& gens) @@ -366,8 +369,18 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root, makecommand.push_back(this->CurrentXCodeHackMakefile.c_str()); makecommand.push_back(""); // placeholder, see below - // Add Re-Run CMake rules - this->CreateReRunCMakeFile(root, gens); + // Add ZERO_CHECK + bool regenerate = !mf->IsOn("CMAKE_SUPPRESS_REGENERATION"); + if (regenerate) + { + this->CreateReRunCMakeFile(root, gens); + std::string file = this->ConvertToRelativeForMake( + this->CurrentReRunCMakeMakefile.c_str()); + cmSystemTools::ReplaceString(file, "\\ ", " "); + mf->AddUtilityCommand(CMAKE_CHECK_BUILD_SYSTEM_TARGET, true, no_depends, + no_working_directory, + "make", "-f", file.c_str()); + } // now make the allbuild depend on all the non-utility targets // in the project @@ -379,10 +392,17 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root, { continue; } + cmTargets& tgts = lg->GetMakefile()->GetTargets(); for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); l++) { cmTarget& target = l->second; + + if (regenerate && (l->first != CMAKE_CHECK_BUILD_SYSTEM_TARGET)) + { + target.AddUtility(CMAKE_CHECK_BUILD_SYSTEM_TARGET); + } + // make all exe, shared libs and modules // run the depend check makefile as a post build rule // this will make sure that when the next target is built @@ -402,8 +422,8 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root, cmTarget::POST_BUILD, "Depend check for xcode", dir.c_str()); - } + if(!target.GetPropertyAsBool("EXCLUDE_FROM_ALL")) { allbuild->AddUtility(target.GetName()); @@ -1114,11 +1134,6 @@ void cmGlobalXCodeGenerator::CreateCustomCommands(cmXCodeObject* buildPhases, commands.push_back(*(*i)->GetCustomCommand()); } } - std::vector<cmCustomCommand> reruncom; - cmXCodeObject* cmakeReRunPhase = - this->CreateBuildPhase("CMake ReRun", "cmakeReRunPhase", - cmtarget, reruncom); - buildPhases->AddObject(cmakeReRunPhase); // create prebuild phase cmXCodeObject* cmakeRulesBuildPhase = this->CreateBuildPhase("CMake Rules", @@ -1207,20 +1222,6 @@ cmGlobalXCodeGenerator::AddCommandsToBuildPhase(cmXCodeObject* buildphase, const & commands, const char* name) { - if(strcmp(name, "cmakeReRunPhase") == 0) - { - std::string cdir = this->CurrentMakefile->GetHomeOutputDirectory(); - cdir = this->ConvertToRelativeForMake(cdir.c_str()); - std::string makecmd = "make -C "; - makecmd += cdir; - makecmd += " -f "; - makecmd += - this->ConvertToRelativeForMake(this->CurrentReRunCMakeMakefile.c_str()); - cmSystemTools::ReplaceString(makecmd, "\\ ", "\\\\ "); - buildphase->AddAttribute("shellScript", - this->CreateString(makecmd.c_str())); - return; - } // collect multiple outputs of custom commands into a set // which will be used for every configuration @@ -1757,7 +1758,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, default: break; } - if(this->XcodeVersion >= 22) + if(this->XcodeVersion >= 22 && this->XcodeVersion < 40) { buildSettings->AddAttribute("PREBINDING", this->CreateString("NO")); diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx index 1850c16..ef378f9 100644 --- a/Source/cmLocalVisualStudio10Generator.cxx +++ b/Source/cmLocalVisualStudio10Generator.cxx @@ -93,10 +93,18 @@ void cmLocalVisualStudio10Generator::Generate() for(cmTargets::iterator l = tgts.begin(); l != tgts.end(); ++l) { - cmVisualStudio10TargetGenerator tg( - &l->second, static_cast<cmGlobalVisualStudio10Generator*>( - this->GetGlobalGenerator())); - tg.Generate(); + if(static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator) + ->TargetIsFortranOnly(l->second)) + { + this->CreateSingleVCProj(l->first.c_str(),l->second); + } + else + { + cmVisualStudio10TargetGenerator tg( + &l->second, static_cast<cmGlobalVisualStudio10Generator*>( + this->GetGlobalGenerator())); + tg.Generate(); + } } this->WriteStampFiles(); } diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 372e644..1f99cba 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -846,6 +846,13 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout, tool = "VFMIDLTool"; } fout << "\t\t\t<Tool\n\t\t\t\tName=\"" << tool << "\"\n"; + fout << "\t\t\t\tAdditionalIncludeDirectories=\""; + for(i = includes.begin(); i != includes.end(); ++i) + { + std::string ipath = this->ConvertToXMLOutputPath(i->c_str()); + fout << ipath << ";"; + } + fout << "\"\n"; fout << "\t\t\t\tMkTypLibCompatible=\"FALSE\"\n"; if( this->PlatformName == "x64" ) { @@ -1643,6 +1650,10 @@ WriteCustomRule(std::ostream& fout, } std::string script = this->ConstructScript(command, i->c_str()); + if(this->FortranProject) + { + cmSystemTools::ReplaceString(script, "$(Configuration)", i->c_str()); + } fout << "\t\t\t\t\t<Tool\n" << "\t\t\t\t\tName=\"" << customTool << "\"\n" << "\t\t\t\t\tDescription=\"" diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h index d1b5b00..cdd714e 100644 --- a/Source/cmLocalVisualStudio7Generator.h +++ b/Source/cmLocalVisualStudio7Generator.h @@ -74,6 +74,8 @@ public: virtual void ReadAndStoreExternalGUID(const char* name, const char* path); +protected: + void CreateSingleVCProj(const char *lname, cmTarget &tgt); private: typedef cmVisualStudioGeneratorOptions Options; typedef cmLocalVisualStudio7GeneratorFCInfo FCInfo; @@ -84,7 +86,6 @@ private: void WriteVCProjHeader(std::ostream& fout, const char *libName, cmTarget &tgt, std::vector<cmSourceGroup> &sgs); void WriteVCProjFooter(std::ostream& fout, cmTarget &target); - void CreateSingleVCProj(const char *lname, cmTarget &tgt); void WriteVCProjFile(std::ostream& fout, const char *libName, cmTarget &tgt); void WriteConfigurations(std::ostream& fout, diff --git a/Source/cmMarkAsAdvancedCommand.h b/Source/cmMarkAsAdvancedCommand.h index 0a5eb9e..26e0a07 100644 --- a/Source/cmMarkAsAdvancedCommand.h +++ b/Source/cmMarkAsAdvancedCommand.h @@ -15,9 +15,9 @@ #include "cmCommand.h" /** \class cmMarkAsAdvancedCommand - * \brief MarkAsAdvanced a CMAKE variable + * \brief mark_as_advanced command * - * cmMarkAsAdvancedCommand sets a variable to a value with expansion. + * cmMarkAsAdvancedCommand implements the mark_as_advanced CMake command */ class cmMarkAsAdvancedCommand : public cmCommand { diff --git a/Source/cmRemoveCommand.h b/Source/cmRemoveCommand.h index 87c416f..bae2ee1 100644 --- a/Source/cmRemoveCommand.h +++ b/Source/cmRemoveCommand.h @@ -15,9 +15,9 @@ #include "cmCommand.h" /** \class cmRemoveCommand - * \brief Set a CMAKE variable + * \brief remove command * - * cmRemoveCommand sets a variable to a value with expansion. + * cmRemoveCommand implements the remove CMake command */ class cmRemoveCommand : public cmCommand { diff --git a/Source/cmSeparateArgumentsCommand.h b/Source/cmSeparateArgumentsCommand.h index 10b3c40..736f066 100644 --- a/Source/cmSeparateArgumentsCommand.h +++ b/Source/cmSeparateArgumentsCommand.h @@ -15,9 +15,9 @@ #include "cmCommand.h" /** \class cmSeparateArgumentsCommand - * \brief SeparateArguments a CMAKE variable + * \brief separate_arguments command * - * cmSeparateArgumentsCommand sets a variable to a value with expansion. + * cmSeparateArgumentsCommand implements the separate_arguments CMake command */ class cmSeparateArgumentsCommand : public cmCommand { diff --git a/Source/cmSiteNameCommand.h b/Source/cmSiteNameCommand.h index 6357569..ac7f426 100644 --- a/Source/cmSiteNameCommand.h +++ b/Source/cmSiteNameCommand.h @@ -15,9 +15,9 @@ #include "cmCommand.h" /** \class cmSiteNameCommand - * \brief SiteName a CMAKE variable + * \brief site_name command * - * cmSiteNameCommand sets a variable to a value with expansion. + * cmSiteNameCommand implements the site_name CMake command */ class cmSiteNameCommand : public cmCommand { diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index ac4296c..551b0ad 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -437,7 +437,7 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source, (*this->BuildFileStream ) << sep << out; sep = ";"; } - (*this->BuildFileStream ) << ";%(Outputs)</Outputs>\n"; + (*this->BuildFileStream ) << "</Outputs>\n"; } this->WriteString("</CustomBuild>\n", 2); } @@ -1578,6 +1578,13 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences() i != depends.end(); ++i) { cmTarget* dt = *i; + // skip fortran targets as they can not be processed by MSBuild + // the only reference will be in the .sln file + if(static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator) + ->TargetIsFortranOnly(*dt)) + { + continue; + } this->WriteString("<ProjectReference Include=\"", 2); cmMakefile* mf = dt->GetMakefile(); std::string name = dt->GetName(); diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx index 71c7c25..30e5076 100644 --- a/Source/cmXCodeObject.cxx +++ b/Source/cmXCodeObject.cxx @@ -241,7 +241,7 @@ void cmXCodeObject::PrintString(std::ostream& os,cmStdString String) // considered special by the Xcode project file parser. bool needQuote = (String.empty() || - String.find_first_of(" <>.+-=@$[]") != String.npos); + String.find_first_of(" <>.+-=@$[],") != String.npos); const char* quote = needQuote? "\"" : ""; // Print the string, quoted and escaped as necessary. diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index c4aff4a..695949a 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -4573,8 +4573,6 @@ void SystemTools::ClassInitialize() // for windows because drive letters need to be maintained. Also, // there are not sym-links and mount points on windows anyway. #if !defined(_WIN32) || defined(__CYGWIN__) - // Work-around an SGI problem by always adding this mapping: - SystemTools::AddTranslationPath("/tmp_mnt/", "/"); // The tmp path is frequently a logical path so always keep it: SystemTools::AddKeepPath("/tmp/"); diff --git a/Source/kwsys/hash_fun.hxx.in b/Source/kwsys/hash_fun.hxx.in index f21efc5..926ec92 100644 --- a/Source/kwsys/hash_fun.hxx.in +++ b/Source/kwsys/hash_fun.hxx.in @@ -38,7 +38,7 @@ #define @KWSYS_NAMESPACE@_hash_fun_hxx #include <@KWSYS_NAMESPACE@/Configure.hxx> - +#include <@KWSYS_NAMESPACE@/FundamentalType.h> #include <@KWSYS_NAMESPACE@/cstddef> // size_t namespace @KWSYS_NAMESPACE@ @@ -110,6 +110,28 @@ struct hash<unsigned long> { size_t operator()(unsigned long __x) const { return __x; } }; +// use long long or __int64 +#if @KWSYS_NAMESPACE@_USE_LONG_LONG +@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION +struct hash<long long> { + size_t operator()(long long __x) const { return __x; } +}; + +@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION +struct hash<unsigned long long> { + size_t operator()(unsigned long long __x) const { return __x; } +}; +#elif @KWSYS_NAMESPACE@_USE___INT64 +@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION +struct hash<__int64> { + size_t operator()(__int64 __x) const { return __x; } +}; +@KWSYS_NAMESPACE@_CXX_DEFINE_SPECIALIZATION +struct hash<unsigned __int64> { + size_t operator()(unsigned __int64 __x) const { return __x; } +}; +#endif // use long long or __int64 + } // namespace @KWSYS_NAMESPACE@ #endif diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 9526dcd..2644ba5 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 08) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 07) +SET(KWSYS_DATE_STAMP_DAY 25) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 9d8a091..cfc1846 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -16,6 +16,8 @@ MACRO(ADD_TEST_MACRO NAME COMMAND) LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${dir}") ENDMACRO(ADD_TEST_MACRO) +INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CheckFortran.cmake) + # Fake a user home directory to avoid polluting the real one. IF(DEFINED ENV{HOME} AND NOT CTEST_NO_TEST_HOME) SET(TEST_HOME "${CMake_BINARY_DIR}/Tests/CMakeFiles/TestHome") @@ -155,6 +157,9 @@ IF(BUILD_TESTING) ADD_TEST_MACRO(MissingSourceFile MissingSourceFile) SET_TESTS_PROPERTIES(MissingSourceFile PROPERTIES PASS_REGULAR_EXPRESSION "CMake Error at CMakeLists.txt:3 \\(add_executable\\):[ \r\n]*Cannot find source file:[ \r\n]*DoesNotExist/MissingSourceFile.c") + IF(CMAKE_Fortran_COMPILER) + ADD_TEST_MACRO(FortranOnly FortranOnly) + ENDIF() ADD_TEST_MACRO(COnly COnly) ADD_TEST_MACRO(CxxOnly CxxOnly) ADD_TEST_MACRO(IPO COnly/COnly) @@ -1918,7 +1923,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ # fortran does not work for IDE builds because # CMAKE_STANDARD_LIBRARIES needs to be per language IF(CMAKE_TEST_GENERATOR MATCHES "Make|KDevelop") - INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CheckFortran.cmake) IF(CMAKE_Fortran_COMPILER) ADD_TEST(Fortran ${CMAKE_CTEST_COMMAND} --build-and-test diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt index 0169ac9..9a4bdfe 100644 --- a/Tests/FindPackageTest/CMakeLists.txt +++ b/Tests/FindPackageTest/CMakeLists.txt @@ -303,3 +303,94 @@ SET(CMakeTestExportPackage_DIR "" CACHE FILEPATH "Wipe out find results for testing." FORCE) STRING(REGEX REPLACE "-.*$" "" version ${CMAKE_VERSION}) FIND_PACKAGE(CMakeTestExportPackage 1.${version} EXACT REQUIRED) + +#----------------------------------------------------------------------------- +# Test write_basic_config_version_file(). + +include(WriteBasicConfigVersionFile) + +write_basic_config_version_file(${CMAKE_CURRENT_BINARY_DIR}/Foo123ConfigVersion.cmake + VERSION 1.2.3 + COMPATIBILITY AnyNewerVersion) + +set(PACKAGE_FIND_VERSION 2.3.4) +include(${CMAKE_CURRENT_BINARY_DIR}/Foo123ConfigVersion.cmake) +if(PACKAGE_VERSION_COMPATIBLE) + message(SEND_ERROR "Found Foo123 with version 1.2.3, but 2.3.4 was requested !") +endif() + +set(PACKAGE_FIND_VERSION 0.0.1) +include(${CMAKE_CURRENT_BINARY_DIR}/Foo123ConfigVersion.cmake) +if(NOT PACKAGE_VERSION_COMPATIBLE) + message(SEND_ERROR "Did not find Foo123 with version 1.2.3 (0.0.1 was requested) !") +endif() + +set(PACKAGE_FIND_VERSION 1.0.0) +include(${CMAKE_CURRENT_BINARY_DIR}/Foo123ConfigVersion.cmake) +if(NOT PACKAGE_VERSION_COMPATIBLE) + message(SEND_ERROR "Did not find Foo123 with version 1.2.3 (1.0.0 was requested) !") +endif() +if(PACKAGE_VERSION_EXACT) + message(SEND_ERROR "PACKAGE_VERSION_EXACT set, although it should not be !") +endif() + +set(PACKAGE_FIND_VERSION 1.2.3) +include(${CMAKE_CURRENT_BINARY_DIR}/Foo123ConfigVersion.cmake) +if(NOT PACKAGE_VERSION_COMPATIBLE) + message(SEND_ERROR "Did not find Foo123 with version 1.2.3 (1.2.3 was requested) !") +endif() +if(NOT PACKAGE_VERSION_EXACT) + message(SEND_ERROR "PACKAGE_VERSION_EXACT not set, although it should be !") +endif() + + +####################### + +write_basic_config_version_file(${CMAKE_CURRENT_BINARY_DIR}/Boo123ConfigVersion.cmake + VERSION 1.2.3 + COMPATIBILITY SameMajorVersion) + +set(PACKAGE_VERSION_EXACT FALSE) +set(PACKAGE_FIND_VERSION 2.3.4) +set(PACKAGE_FIND_VERSION_MAJOR 2) +include(${CMAKE_CURRENT_BINARY_DIR}/Boo123ConfigVersion.cmake) +if(PACKAGE_VERSION_COMPATIBLE) + message(SEND_ERROR "Found Boo123 with version 1.2.3, but 2.3.4 was requested !") +endif() +if(PACKAGE_VERSION_EXACT) + message(SEND_ERROR "PACKAGE_VERSION_EXACT set, although it should not be !") +endif() + +set(PACKAGE_FIND_VERSION 0.0.1) +set(PACKAGE_FIND_VERSION_MAJOR 0) +include(${CMAKE_CURRENT_BINARY_DIR}/Boo123ConfigVersion.cmake) +if(PACKAGE_VERSION_COMPATIBLE) + message(SEND_ERROR "Found Boo123 with version 1.2.3, but 0.0.1 was requested !") +endif() +if(PACKAGE_VERSION_EXACT) + message(SEND_ERROR "PACKAGE_VERSION_EXACT set, although it should not be !") +endif() + +set(PACKAGE_FIND_VERSION 1.0.0) +set(PACKAGE_FIND_VERSION_MAJOR 1) +include(${CMAKE_CURRENT_BINARY_DIR}/Boo123ConfigVersion.cmake) +if(NOT PACKAGE_VERSION_COMPATIBLE) + message(SEND_ERROR "Did not find Boo123 with version 1.2.3 (1.0.0 was requested) !") +endif() +if(PACKAGE_VERSION_EXACT) + message(SEND_ERROR "PACKAGE_VERSION_EXACT set, although it should not be !") +endif() + +set(PACKAGE_FIND_VERSION 1.2.3) +set(PACKAGE_FIND_VERSION_MAJOR 1) +include(${CMAKE_CURRENT_BINARY_DIR}/Boo123ConfigVersion.cmake) +if(NOT PACKAGE_VERSION_COMPATIBLE) + message(SEND_ERROR "Did not find Boo123 with version 1.2.3 (1.2.3 was requested) !") +endif() +if(NOT PACKAGE_VERSION_EXACT) + message(SEND_ERROR "PACKAGE_VERSION_EXACT not set, although it should be !") +endif() + +if(PACKAGE_VERSION_UNSUITABLE) + message(SEND_ERROR "PACKAGE_VERSION_UNSUITABLE set, but must not be !") +endif() diff --git a/Tests/FortranOnly/CMakeLists.txt b/Tests/FortranOnly/CMakeLists.txt new file mode 100644 index 0000000..3c4f0e7 --- /dev/null +++ b/Tests/FortranOnly/CMakeLists.txt @@ -0,0 +1,42 @@ +cmake_minimum_required (VERSION 2.8) +project(FortranOnly Fortran) +message("CTEST_FULL_OUTPUT ") + +# create a library with hello and world functions +add_library(FortranOnlylib hello.f world.f) +# create an executable that calls hello and world +add_executable(FortranOnly testf.f) +target_link_libraries(FortranOnly FortranOnlylib) + +# create a custom command that runs FortranOnly and puts +# the output into the file testfhello.txt +add_custom_command(OUTPUT ${FortranOnly_BINARY_DIR}/testfhello.txt + COMMAND ${FortranOnly_BINARY_DIR}/${CMAKE_CFG_INTDIR}/FortranOnly + > testfhello.txt) +# create a second executable FortranOnly2 that has +# testfhello.txt has an source file so that it will +# run the above custom command. +add_executable(FortranOnly2 testfhello.txt testf.f) +target_link_libraries(FortranOnly2 FortranOnlylib) +# create a custom target to check the content of testfhello.txt +# by running the cmake script checktestf2.cmake +add_custom_target(checktestf2 ALL + COMMAND ${CMAKE_COMMAND} + -P ${FortranOnly_SOURCE_DIR}/checktestf2.cmake) + +# create a custom target that runs FortranOnly exectuable and creates +# a file out.txt that should have hello world in it. +add_custom_target(sayhello ALL + COMMAND ${FortranOnly_BINARY_DIR}/${CMAKE_CFG_INTDIR}/FortranOnly > out.txt +) +# make sure stuff is built in the right order +add_dependencies(checktestf2 FortranOnly2) +add_dependencies(sayhello FortranOnly) +add_dependencies(FortranOnly2 FortranOnly) + +# add a custom target that checkes that out.txt has the correct +# content +add_custom_target(checksayhello ALL + COMMAND ${CMAKE_COMMAND} -P ${FortranOnly_SOURCE_DIR}/checksayhello.cmake + ) +add_dependencies(checksayhello sayhello) diff --git a/Tests/FortranOnly/checksayhello.cmake b/Tests/FortranOnly/checksayhello.cmake new file mode 100644 index 0000000..5352290 --- /dev/null +++ b/Tests/FortranOnly/checksayhello.cmake @@ -0,0 +1,7 @@ +file(READ out.txt IN) +message("${IN}") +if(IN MATCHES Hello AND IN MATCHES World) + message("Passed") +else() + message(FATAL_ERROR "Hello world not found") +endif() diff --git a/Tests/FortranOnly/checktestf2.cmake b/Tests/FortranOnly/checktestf2.cmake new file mode 100644 index 0000000..f0e6be3 --- /dev/null +++ b/Tests/FortranOnly/checktestf2.cmake @@ -0,0 +1,8 @@ +file(READ testfhello.txt IN) +message("${IN}") +if(IN MATCHES Hello AND IN MATCHES World) + message("Passed") +else() + message(FATAL_ERROR "Hello world not found") +endif() +file(WRITE testfhello2.txt ${IN}) diff --git a/Tests/FortranOnly/hello.f b/Tests/FortranOnly/hello.f new file mode 100644 index 0000000..63e6408 --- /dev/null +++ b/Tests/FortranOnly/hello.f @@ -0,0 +1,5 @@ + SUBROUTINE HELLO + + PRINT *, 'Hello' + + END diff --git a/Tests/FortranOnly/testf.f b/Tests/FortranOnly/testf.f new file mode 100644 index 0000000..4909181 --- /dev/null +++ b/Tests/FortranOnly/testf.f @@ -0,0 +1,6 @@ + PROGRAM TESTF + + CALL HELLO() + CALL WORLD() + + END diff --git a/Tests/FortranOnly/world.f b/Tests/FortranOnly/world.f new file mode 100644 index 0000000..deae3fa --- /dev/null +++ b/Tests/FortranOnly/world.f @@ -0,0 +1,5 @@ + SUBROUTINE WORLD + + PRINT *, 'World!' + + END |