1. 11 Nov, 2018 1 commit
  2. 18 Apr, 2018 1 commit
  3. 23 Jan, 2018 1 commit
    • Christian Pfeiffer's avatar
      GenericSystem: Remove misspelled flag default · cd3e1600
      Christian Pfeiffer authored
      In CMakeGenericSystem, it should be ``CMAKE_INCLUDE_SEP_<LANG>`` and not
      ``CMAKE_INCLUDE_<LANG>_SEP``. However, if the flag is defined, include
      behavior changes to Java-style non-repeating flags, which isn't
      intended. Therefore, removing the (misspelled) default initialization
      should help remove confusion and unintended side effects.
      cd3e1600
  4. 08 Jan, 2018 1 commit
    • Beren Minor's avatar
      Unhardcode the CMAKE_CONFIGURATION_TYPES values · 48f7e2d3
      Beren Minor authored
      This removes duplicated code for per-config variable initialization by
      providing a `cmake_initialize_per_config_variable(<PREFIX> <DOCSTRING>)`
      function.
      
      This function initializes a `<PREFIX>` cache variable from `<PREFIX>_INIT`
      and unless the `CMAKE_NOT_USING_CONFIG_FLAGS` variable is defined, does
      the same with `<PREFIX>_<CONFIG>` from `<PREFIX>_<CONFIG>_INIT` for every
      `<CONFIG>` in `CMAKE_CONFIGURATION_TYPES` for multi-config generators or
      `CMAKE_BUILD_TYPE` for single-config generators.
      48f7e2d3
  5. 14 Dec, 2017 1 commit
    • Yurii Batrak's avatar
      Makefiles: Drop 'requires' step and its supporting infrastructure · 7ab9a625
      Yurii Batrak authored
      The 'requires' step was used to provide implicit dependencies between
      the generated Fortran module files and a Fortran target that needs these
      module files to ensure the correct compilation order.  After recent
      refactoring to resolve all dependencies explicitly through `.mod.stamp`
      make targets, the separate 'requires' step is not needed anymore.
      7ab9a625
  6. 08 Nov, 2017 1 commit
  7. 27 Sep, 2016 1 commit
    • Brad King's avatar
      Simplify CMake per-source license notices · 86578ecc
      Brad King authored
      Per-source copyright/license notice headers that spell out copyright holder
      names and years are hard to maintain and often out-of-date or plain wrong.
      Precise contributor information is already maintained automatically by the
      version control tool.  Ultimately it is the receiver of a file who is
      responsible for determining its licensing status, and per-source notices are
      merely a convenience.  Therefore it is simpler and more accurate for
      each source to have a generic notice of the license name and references to
      more detailed information on copyright holders and full license terms.
      
      Our `Copyright.txt` file now contains a list of Contributors whose names
      appeared source-level copyright notices.  It also references version control
      history for more precise information.  Therefore we no longer need to spell
      out the list of Contributors in each source file notice.
      
      Replace CMake per-source copyright/license notice headers with a short
      description of the license and links to `Copyright.txt` and online information
      available from "https://cmake.org/licensing".  The online URL also handles
      cases of modules being copied out of our source into other projects, so we
      can drop our notices about replacing links with full license text.
      
      Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority
      of the replacements mechanically.  Manually fix up shebang lines and trailing
      newlines in a few files.  Manually update the notices in a few files that the
      script does not handle.
      86578ecc
  8. 01 Jul, 2016 1 commit
  9. 07 Dec, 2015 1 commit
  10. 23 Nov, 2015 1 commit
    • Brad King's avatar
      Revert "Disable shared library support when compiler links statically" (#15855) · 9682de56
      Brad King authored
      In commit v3.4.0-rc1~18^2 (Disable shared library support when compiler
      links statically, 2015-09-30) we tried to detect when the compiler is
      not capable of linking shared libraries (possibly due to flags in use).
      However, the approach is not robust against flags like `-nostdlib`.
      Revert it for now pending another solution to the original problem.
      9682de56
  11. 30 Sep, 2015 1 commit
    • Brad King's avatar
      Disable shared library support when compiler links statically · 8b4873a1
      Brad King authored
      When a user or a compiler wrapper adds '-static' to the compiler flags
      then it will always link static binaries.  Detect this from the compiler
      id binary and disable TARGET_SUPPORTS_SHARED_LIBS.  This will prevent
      projects from accidentally adding shared libraries when the toolchain
      does not support them.  It also helps CMake avoid linking with flags
      that require shared libraries to be supported.
      8b4873a1
  12. 09 Sep, 2015 1 commit
  13. 13 Jul, 2015 1 commit
    • Brad King's avatar
      Factor an <INCLUDES> placeholder out of <FLAGS> in rule variables · c736de7b
      Brad King authored
      Teach the Makefile and Ninja generators to substitute for an <INCLUDES>
      placeholder instead of putting -I in <FLAGS>.  Update our values for
      
        CMAKE_<LANG>_COMPILE_OBJECT,
        CMAKE_<LANG>_CREATE_ASSEMBLY_SOURCE, and
        CMAKE_<LANG>_CREATE_PREPROCESSED_SOURCE
      
      to place <INCLUDES> just before <FLAGS>.
      c736de7b
  14. 16 Apr, 2014 1 commit
    • Brad King's avatar
      Support duplicate object names in large archives (#14874) · 1ec6485c
      Brad King authored
      Generalize the change from commit 39d0ade0 (Windows-GNU: Support
      duplicate object names in large archives, 2014-04-14) to the default
      archive rules.  These rules have used an incremental append approach
      since commit v2.8.0~1856 (Build large archives incrementally,
      2008-08-04).  Switch from "ar r" to "ar q" to be sure we always append
      objects instead of replacing them.
      1ec6485c
  15. 03 Dec, 2013 1 commit
  16. 02 Dec, 2013 2 commits
  17. 22 Oct, 2013 1 commit
    • Brad King's avatar
      Quote ${CMAKE_<LANG>_COMPILER} while enabling a language · 705ae004
      Brad King authored
      Even though this variable gets set to CMAKE_<LANG>_COMPILER-NOTFOUND when
      the compiler is not found, CMake<LANG>Compiler.cmake gets removed by
      cmGlobalGenerator::EnableLanguage so in try compiles the value is empty.
      Quote references to the variable in
      
       Modules/CMake(C|CXX|Fortran)Information.cmake
       Modules/CMakeDetermineCompilerId.cmake
      
      to avoid dropping arguments from commands that expect them.
      705ae004
  18. 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
      9db31162
    • 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
      77543bde
    • 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/ \+$//'
      7bbaa428
  19. 12 Jun, 2012 2 commits
    • Stephen Kelly's avatar
      Add platform variable for flags specific to shared libraries · 55d7aa4c
      Stephen Kelly authored
      Store in CMAKE_${lang}_COMPILE_OPTIONS_DLL flags from
      CMAKE_SHARED_LIBRARY_${lang}_FLAGS that are truly exclusive to shared
      libraries.
      55d7aa4c
    • Stephen Kelly's avatar
      Add platform variables for position independent code flags · 31d7a0f2
      Stephen Kelly authored
      Store in new platform variables
      
        CMAKE_${lang}_COMPILE_OPTIONS_PIC
        CMAKE_${lang}_COMPILE_OPTIONS_PIE
      
      flags for position independent code generation.
      
      In almost all cases, this means duplication of the
      CMAKE_SHARED_LIBRARY_${lang}_FLAGS for the _PIC case and using the
      assumed pie equivalent for the _PIE case.  Note that the GNU compiler
      has supported -fPIE since 3.4 and that there is no -fPIC on GNU for
      Windows or Cygwin.
      
      There is a possibility that the _PIE variables are not correct.
      However, as there is no backwards compatibility to be concerned about
      (as the POSITION_INDEPENDENT_CODE property is not used anywhere yet),
      the current state suffices.
      31d7a0f2
  20. 30 Apr, 2012 1 commit
    • Modestas Vainius's avatar
      Support building shared libraries or modules without soname (#13155) · e1409ac5
      Modestas Vainius authored
      Add a boolean target property NO_SONAME which may be used to disable
      soname for the specified shared library or module even if the platform
      supports it.  This property should be useful for private shared
      libraries or various plugins which live in private directories and have
      not been designed to be found or loaded globally.
      
      Replace references to <CMAKE_SHARED_LIBRARY_SONAME_${LANG}_FLAG> and
      hard-coded -install_name flags with a conditional <SONAME_FLAG> which is
      expanded to the value of the CMAKE_SHARED_LIBRARY_SONAME_${LANG}_FLAG
      definition as long as soname supports is enabled for the target in
      question.  Keep expanding CMAKE_SHARED_LIBRARY_SONAME_${LANG}_FLAG in
      rules in case third party projects still use it.  Such projects would
      not yet use NO_SONAME so the adjacent <TARGET_SONAME> will always be
      expanded.  Make <TARGET_INSTALLNAME_DIR> NO_SONAME aware as well.  Since
      -install_name is soname on OS X, this should not be a problem if this
      variable is expanded only if soname is enabled.
      
      The Ninja generator performs rule variable substitution only once
      globally per rule to put its own placeholders.  Final substitution is
      performed by ninja at build time.  Therefore we cannot conditionally
      replace the soname placeholders on a per-target basis.  Rather than
      omitting $SONAME from rules.ninja, simply do not write its contents for
      targets which have NO_SONAME.  Since 3 variables are affected by
      NO_SONAME ($SONAME, $SONAME_FLAG, $INSTALLNAME_DIR), set them only if
      soname is enabled.
      e1409ac5
  21. 03 Feb, 2012 1 commit
    • Brad King's avatar
      Fix CXX/Fortran MODULE flags when enabled before C (#12929) · 74958450
      Brad King authored
      If CXX or Fortran is enabled before C then the values of
      
        CMAKE_SHARED_MODULE_C_FLAGS
        CMAKE_SHARED_MODULE_CREATE_C_FLAGS
      
      may not be available.  On platforms where MODULE library (plugin) creation
      is the same as SHARED library creation initialize the MODULE creation
      flags from the SHARED creation flags of the matching language instead of
      assuming that C has been enabled first.
      
      Teach the COnly and CxxOnly tests to build MODULE libraries.  The latter
      covers this specific case.
      74958450
  22. 05 Dec, 2011 1 commit
    • Brad King's avatar
      Load platform files that need to know the ABI when possible · a603250a
      Brad King authored
      Load platform files named in CMAKE_<lang>_ABI_FILES for each language
      once the ABI sizeof(void*) is known.  During the first configuration
      this is after the test for working compiler and ABI detection checks.
      During later configurations the ABI information is immediately available
      because it has been saved in CMake<lang>Compiler.cmake.
      a603250a
  23. 31 Jan, 2011 1 commit
    • Brad King's avatar
      Pass -o after -c for Fortran to avoid mpif77 ordering bug · 93f230e4
      Brad King authored
      When running
      
        $ mpif77 -c example.f -o example.f.o
      
      mpif77 recognizes -o and produces example.f.o, but when running
      
        $ mpif77 -o example.f.o -c example.f
      
      the -o option is ignored and the object file is example.o.  Performing
      the same experiment on the underlying compiler tool or with the mpicc
      and mpiCC wrappers does not exhibit this behavior, so the issue appears
      to be specific to mpif77.
      Reported-by: 's avatarZhen Wang <zwang26@emory.edu>
      93f230e4
  24. 19 Jan, 2011 1 commit
    • Brad King's avatar
      Fix relative CMAKE_USER_MAKE_RULES_OVERRIDE (#11725) · a146e034
      Brad King authored
      In commit 295b5b60 (Honor CMAKE_USER_MAKE_RULES_OVERRIDE in try_compile,
      2010-06-29) we started passing the value of this variable when building
      a try_compile project.  If the variable contains a relative path it must
      be treated with respect to the file where it is first used.  Ensure that
      the value is converted to a full path so that it is correctly referenced
      in the try_compile projects.
      a146e034
  25. 10 Jan, 2011 1 commit
  26. 09 Dec, 2010 1 commit
    • Brad King's avatar
      Allow Fortran platform files to set empty values · 83892c4a
      Brad King authored
      Teach CMakeFortranInformation to use default flags only for variables
      that have not been set at all, rather then not set or empty.  This will
      allow platform or compiler-specific information files to set empty
      values without getting the defaults.
      83892c4a
  27. 28 Sep, 2010 1 commit
    • Brad King's avatar
      Reset platform/compiler info status for each language · 20f49730
      Brad King authored
      In each CMake<lang>Information.cmake file we use an _INCLUDED_FILE
      variable to track whether a compiler information file has been loaded.
      Reset this variable for each language.
      
      This fixes Fortran under VS generators with the Intel plugin.
      Previously the variable would be left set true from C and C++ and then
      Fortran would not load old-style files like Platform/Windows-ifort.
      20f49730
  28. 09 Aug, 2010 1 commit
  29. 28 Jan, 2010 1 commit
  30. 02 Dec, 2009 2 commits
    • Brad King's avatar
      Reduce duplication in Platform/<os>.cmake files · 4d72006b
      Brad King authored
      Several platform-wide linker flag variables are defined in
      Modules/Platform/<os>.cmake files for C and then copied by the
      Modules/CMake<lang>Information.cmake file for each language.
      We now use this approach for the variables
      
        CMAKE_EXE_EXPORTS_${lang}_FLAG
        CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG
        CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS
      
      to avoid duplication for multiple languages in each platform file.
      4d72006b
    • Brad King's avatar
      Remove CMAKE_SHARED_MODULE_RUNTIME_${lang}_FLAG · 9daa4a6c
      Brad King authored
      This platform configuration variable is unused.  Modules are built using
      the value of CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG.
      9daa4a6c
  31. 09 Oct, 2009 1 commit
  32. 06 Oct, 2009 1 commit
    • Brad King's avatar
      Use work-around from bug 4772 for C++ and Fortran · d0c03f80
      Brad King authored
      The commit "fix for bug 4772" added a work-around to CMakeCInformation
      for platform config files that put compiler information in the system
      file (like SunOS flags for GCC).  This commit adds the same work-around
      for CXX and Fortran.  It is necessary to support enabling these
      languages separately from C in other subdirectories.
      
      The commit "Avoid (Unix|Windows)Paths.cmake multiple include" added
      include blockers that prevent the files from multiple inclusion, so it
      is safe to include the system information files from every language.
      
      See issue #4772 and issue #9656.
      d0c03f80
  33. 01 Oct, 2009 1 commit
  34. 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.
      3a666595
  35. 23 Jul, 2009 1 commit
    • Brad King's avatar
      ENH: Load platform-independent per-compiler files · 797e49a1
      Brad King authored
      This teaches the language configuration modules to load per-compiler
      information for each language using the compiler id but no system name.
      They look for modules named "Compiler/<id>-<lang>.cmake".  Such modules
      may specify compiler flags that do not depend on the platform.
      797e49a1