1. 30 Jun, 2015 1 commit
  2. 18 Jun, 2015 2 commits
  3. 19 Feb, 2015 1 commit
    • Brad King's avatar
      Fortran: Add infrastructure to detect compiler version (#15372) · e6ebc814
      Brad King authored
      Fortran does not offer syntax to compose a string literal at
      preprocessing time from numeric compuations.  Instead encode each digit
      of each component as a separate INFO string and compose them in CMake
      code after extraction.  Support MAJOR, MINOR, PATCH, and TWEAK
      components with up to 8 digits each.
  4. 20 Oct, 2014 1 commit
    • Ben Boeckel's avatar
      Avoid if() quoted auto-dereference · 29c3edb8
      Ben Boeckel authored
      When testing CMAKE_<LANG>_COMPILER_ID values, do not explicitly
      dereference or quote the variable. We want if() to auto-dereference the
      variable and not its value. Also replace MATCHES with STREQUAL where
  5. 14 Apr, 2014 2 commits
  6. 10 Mar, 2014 2 commits
  7. 22 Jan, 2014 1 commit
  8. 13 Nov, 2013 1 commit
  9. 24 Oct, 2013 1 commit
    • Brad King's avatar
      CMakeDetermine*Compiler: Remove temporary cache entry · 332771c9
      Brad King authored
      When the user or toolchain file sets CMAKE_<LANG>_COMPILER to a name
      without a path we use find_program with CMAKE_<LANG>_COMPILER_WITH_PATH
      to search for the tool.  Remove the temporary cache entry afterward to
      avoid exposing it to projects.  It is not set by other logic paths so no
      one should be using it.
  10. 18 Oct, 2013 1 commit
  11. 14 Mar, 2013 2 commits
  12. 11 Sep, 2012 1 commit
  13. 24 Aug, 2012 1 commit
    • Brad King's avatar
      Make platform information files specific to the CMake version · 7195aca5
      Brad King authored
      At the top of a build tree we configure inside the CMakeFiles directory
      files such as "CMakeSystem.cmake" and "CMake<lang>Compiler.cmake" to
      save information detected about the system and compilers in use.  The
      method of detection and the exact results store varies across CMake
      versions as things improve.  This leads to problems when loading files
      configured by a different version of CMake.  Previously we ignored such
      existing files only if the major.minor part of the CMake version
      component changed, and depended on the CMakeCache.txt to tell us the
      last version of CMake that wrote the files.  This led to problems if the
      user deletes the CMakeCache.txt or we add required information to the
      files in a patch-level release of CMake (still a "feature point" release
      by modern CMake versioning convention).
      Ensure that we always have version-consistent platform information files
      by storing them in a subdirectory named with the CMake version.  Every
      version of CMake will do its own system and compiler identification
      checks even when a build tree has already been configured by another
      version of CMake.  Stored results will not clobber those from other
      versions of CMake which may be run again on the same tree in the future.
      Loaded results will match what the system and language modules expect.
      Rename the undocumented variable CMAKE_PLATFORM_ROOT_BIN to
      CMAKE_PLATFORM_INFO_DIR to clarify its purpose.  The new variable points
      at the version-specific directory while the old variable did not.
  14. 22 Aug, 2012 2 commits
    • Brad King's avatar
      Xcode: Detect the compiler id and tool location · 965a69dc
      Brad King authored
      Configure a hand-generated Xcode project to build the compiler id source
      file since we cannot run the compiler command-line tool directly.  Add a
      post-build shell script phase to print out the compiler toolset build
      setting.  Run xcodebuild to compile the identification binary.  Parse
      the full path to the compiler tool from the xcodebuild output.
    • Brad King's avatar
      Re-order C/C++/Fortran compiler determination logic · b8b5c834
      Brad King authored
      Re-organize CMakeDetermine(C|CXX|Fortran)Compiler.cmake to search for
      the compiler command-line tool only under generators for which it makes
      sense.  For the Visual Studio generators we do not expect to find the
      compiler tool from the environment, nor would we use the result anyway.
      Furthermore, set CMAKE_${lang}_COMPILER_ID_TEST_FLAGS only when it has a
      chance to be used.  Extract _CMAKE_TOOLCHAIN_LOCATION from the compiler
      path after running the compiler id step so in the future that step can
      help find the path to the compiler.
  15. 13 Aug, 2012 3 commits
    • Kitware Robot's avatar
      Remove CMake-language block-end command arguments · 9db31162
      Kitware Robot authored
      Ancient versions of CMake required else(), endif(), and similar block
      termination commands to have arguments matching the command starting the
      block.  This is no longer the preferred style.
      Run the following shell code:
      for c in else endif endforeach endfunction endmacro endwhile; do
          echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/'
      done >convert.sed &&
      git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
      egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
      egrep -z -v 'Tests/CMakeTests/While-Endwhile-' |
      xargs -0 sed -i -f convert.sed &&
      rm convert.sed
    • Kitware Robot's avatar
      Convert CMake-language commands to lower case · 77543bde
      Kitware Robot authored
      Ancient CMake versions required upper-case commands.  Later command
      names became case-insensitive.  Now the preferred style is lower-case.
      Run the following shell code:
      cmake --help-command-list |
      grep -v "cmake version" |
      while read c; do
          echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
      done >convert.sed &&
      git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
      egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
      xargs -0 sed -i -f convert.sed &&
      rm convert.sed
    • Kitware Robot's avatar
      Remove trailing whitespace from most CMake and C/C++ code · 7bbaa428
      Kitware Robot authored
      Our Git commit hooks disallow modification or addition of lines with
      trailing whitespace.  Wipe out all remnants of trailing whitespace
      everywhere except third-party code.
      Run the following shell code:
      git ls-files -z -- \
       bootstrap doxygen.config '*.readme' \
       '*.c' '*.cmake' '*.cpp' '*.cxx' \
       '*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \
       '*.mm' '*.pike' '*.py' '*.txt' '*.vim' |
      egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' |
      egrep -z -v '^(Modules/CPack\..*\.in)' |
      xargs -0 sed -i 's/ \+$//'
  16. 02 Aug, 2012 2 commits
    • Brad King's avatar
      Prefer generic system compilers by default for C, C++, and Fortran · 7e58e5bb
      Brad King authored
      Teach CMake to prefer the system default compiler automatically when no
      compiler is specified.  By default use "cc" for C, "CC" for C++, and
      "f95" for Fortran.  Load a new Platform/<os>-<lang>.cmake module to
      allow each platform to specify for each language its system compiler
      name(s) and/or exclude certain names.
      Create Platform/(CYGWIN|Darwin|Linux|Windows)-CXX.cmake modules to
      specify "c++" as the system C++ compiler name for these platforms.  On
      systems that use case-insensitive filesystems exclude C++ compiler names
      that are distinguished from C compiler names only by case.
      This will change the default compiler selection for existing build
      scripts that do not specify a compiler when run on machines with
      separate system and GNU compilers both installed in the PATH.  We do not
      make this change in default behavior lightly.  However:
      (1) If a given build really needs specific compilers one should specify
          them explicitly e.g. by setting CC, CXX, and FC in the environment.
      (2) The motivating case is to prefer the system Clang on newer OS X
          systems over the older GNU compilers typically also installed.  On
          such systems the names "cc" and "c++" link to Clang.  This is the
          first platform known to CMake on which "c++" is not a GNU compiler.
          The old behavior selected "gcc" for C and "c++" C++ and therefore
          chooses GNU for C and Clang for C++ by default.  The new behavior
          selects GNU or Clang consistently for both languages on older or
          newer OS X systems, respectively.
      (3) Other than the motivating OS X case the conditions under which the
          behavior changes do not tend to exist in default OS installations.
          They typically occur only on non-GNU systems with manually-installed
          GNU compilers.
      (4) The consequences of the new behavior are not dire.  At worst the
          project fails to compile with the system compiler when it previously
          worked with the non-system GNU compiler.  Such failure is easy to
          work around (see #1).
      In short this change creates a more sensible default behavior everywhere
      and fixes poor default behavior on a widely-used platform at the cost of
      a modest change in behavior in less-common conditions.
    • Brad King's avatar
      Factor common code out of CMakeDetermine(ASM|C|CXX|Fortran)Compiler · 796e3373
      Brad King authored
      The compiler candidate list selection and search code for C, C++, ASM,
      and Fortran languages was duplicated across four modules.  To look for
      compilers adjacent to already-enabled languages the C and CXX modules
      each used _CMAKE_USER_(C|CXX)_COMPILER_PATH and the ASM module used
      _CMAKE_TOOLCHAIN_LOCATION.  Since commit 4debb7ac (Bias Fortran compiler
      search with C/C++ compilers, 2009-09-09) CMake prefers Fortran compilers
      matching the vendor and directory of an enabled C or C++ compiler.
      Factor out the common functionality among the four languages into a new
      CMakeDetermineCompiler module.  Generalize the Fortran implementation so
      that all languages may each use the vendor and directory of the other
      languages that have already been enabled.  For now do not list any
      vendor-specific names for C, C++, or ASM so that only the directory
      preference is used for these languages (existing behavior).
  17. 08 Feb, 2012 1 commit
  18. 02 Sep, 2011 1 commit
    • Brad King's avatar
      Set CMAKE_<lang>_COMPILER_ID for VS generators · 38aab379
      Brad King authored
      Currently the VS generators do not support Intel C/C++ .icproj files and
      the MS tools do not include a Fortran compiler.  Therefore we can always
      set the C and CXX compiler IDs to "MSVC" and the Fortran ID to "Intel".
      This fixes a regression in support for the Intel Fortran compiler under
      the VS plugin introduced by commit cd43636c (Modernize Intel compiler
      info on Windows, 2010-12-16).  The commit moved the compiler information
      into platform files that only load when the proper compiler id is set.
      It worked for the NMake Makefiles generator but not for the VS IDE
      generator because it did not set the compiler id.
  19. 20 May, 2011 1 commit
  20. 16 Dec, 2010 1 commit
    • Brad King's avatar
      Detect Fortran target architecture on Windows · 58c73c43
      Brad King authored
      Commit 4430bccc (Change the way 32/64 bit compiles are detected with
      MSVC and intel, 2009-11-19) added detection of the target processor to C
      and CXX language builds with MS and Intel tools.  Do the same for Intel
      Fortran for Windows (ifort).  Use /machine:<arch> to link executables.
  21. 09 Dec, 2010 1 commit
    • Brad King's avatar
      Recognize the NAG Fortran compiler · 24cc3d48
      Brad King authored
      The Numerical Algorithms Group (NAG) Fortran compiler does not document
      a preprocessor macro to identify it.  Check for identifying output using
      the -V option.
  22. 09 Aug, 2010 1 commit
  23. 26 Apr, 2010 1 commit
  24. 11 Feb, 2010 1 commit
  25. 02 Feb, 2010 1 commit
    • Brad King's avatar
      Recognize the Compaq Fortran compiler · 11dcef91
      Brad King authored
      The compiler documents symbols _DF_VERSION_ and _VF_VERSION_ but they do
      not seem to be available to the preprocessor.  Instead we add a vendor
      query table entry for Compaq.  Running "f90 -what" produces
        Compaq Visual Fortran Optimizing Compiler Version ...
      This clearly identifies the compiler.
  26. 28 Jan, 2010 1 commit
  27. 10 Dec, 2009 1 commit
    • Brad King's avatar
      New decision method to enable Fortran tests · 55275e01
      Brad King authored
      CMake does not enable Fortran for its own build, but it needs to find a
      Fortran compiler to know if it is possible to enable Fortran tests.
      Previously we searched for a hard-coded list of Fortran compilers which
      was duplicated from the CMakeDetermineFortranCompiler.cmake module.  We
      now run CMake on a small test project that enables the Fortran language
      and reports the compiler it found.  This represents a more realistic
      check of whether the Fortran tests will be able to find a compiler.
  28. 01 Oct, 2009 1 commit
  29. 28 Sep, 2009 1 commit
    • Brad King's avatar
      Convert CMake non-find modules to BSD License · 3a666595
      Brad King authored
      This adds copyright/license notification blocks CMake's non-find
      modules.  Most of the modules had no notices at all.  Some had notices
      referring to the BSD license already.  This commit normalizes existing
      notices and adds missing notices.
  30. 09 Sep, 2009 1 commit
    • Brad King's avatar
      Bias Fortran compiler search with C/C++ compilers · 4debb7ac
      Brad King authored
      When CMAKE_Fortran_COMPILER and ENV{FC} are not defined CMake searches
      for an available Fortran compiler.  This commit teaches the search code
      to look for compiler executables next to the C and C++ compilers if they
      are already found.  Furthermore, we bias the compiler executable name
      preference order based on the vendor of the C and C++ compilers, which
      increases the chance of finding a compatible compiler by default.
  31. 25 Jun, 2009 1 commit
    • Brad King's avatar
      ENH: Identify Fortran compilers with fixed format · ef756b96
      Brad King authored
      This enhances the Fortran compiler id detection by using a source that
      can compile either as free or fixed format.  As long as the compiler
      knows it should preprocess the source file (.F) the identification can
      work.  Even free-format compilers may try fixed-format parsing if the
      user specifies certain flags, so we must support both.
  32. 14 Nov, 2008 1 commit