1. 15 Feb, 2019 1 commit
    • Brad King's avatar
      try_compile: Restore expansion of ;-list in COMPILE_DEFINITIONS · cde2596a
      Brad King authored
      The quoting added by commit 8c5221fb (try_compile: Preserve special
      characters in COMPILE_DEFINITIONS, 2019-01-21, v3.14.0-rc1~108^2~3)
      broke the case that the `COMPILE_DEFINITIONS` value contains a `;`.
      Without the quoting the `;` would be generated literally in an unquoted
      argument in the test `CMakeLists.txt` file and would then be expanded.
      With quoting the `;` is preserved, which is not the old behavior.
      
      Fix this by expanding the `;`-list ahead of time.  Add test cases for
      behavior with both `#` and `;`.
      
      This was noticed with the PGI compiler where we set
      `CMAKE_CXX*_STANDARD_COMPILE_OPTION` to values like `--c++17;-A`.  The
      symptom had also been observed while preparing commit ef8f2376
      (ParseImplicitIncludeInfo: add SunPro Fortran and PGI compiler, Cray
      fix, 2019-01-29, v3.14.0-rc1~26^2~2) but was not recognized at the time
      as a regression.  Revert the workaround added by that commit.
      
      Fixes: #18919
      cde2596a
  2. 03 Jan, 2018 1 commit
  3. 27 Jul, 2016 1 commit
    • Daniel Pfeifer's avatar
      Use string(APPEND) in Tests · 7a649111
      Daniel Pfeifer authored
      Automate with:
      
      find Tests -type f -print0 | xargs -0 perl -i -0pe \
      's/set\(([a-zA-Z0-9_]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
      7a649111
  4. 09 Mar, 2016 1 commit
    • Brad King's avatar
      Drop Visual Studio 6 generator · b42866a3
      Brad King authored
      This generator has been deprecated since CMake 3.3.  Remove it.
      Update documentation, modules, and tests to drop content specific
      to this generator.
      b42866a3
  5. 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
      equivalent.
      29c3edb8
  6. 15 Jul, 2013 2 commits
    • Brad King's avatar
      try_compile: Add COPY_FILE_ERROR option to capture failure · c28715b1
      Brad King authored
      When the COPY_FILE operation fails optionally capture the error message
      with a COPY_FILE_ERROR option instead of reporting the error
      immediately.  This gives callers a chance to do something else or report
      the error.
      
      Teach the RunCMake.try_compile test to cover bad argument combinations
      involving COPY_FILE_ERROR.  Teach the TryCompile test to cover the case
      of a COPY_FILE error message captured by COPY_FILE_ERROR.
      c28715b1
    • Brad King's avatar
      try_compile: Escape CMAKE_<lang>_FLAGS in test projects (#14268) · 290857bb
      Brad King authored
      If CMAKE_<lang>_FLAGS contains quotes or other CMake language characters
      they must be escaped when written into the generated CMakeLists.txt file
      so that the test project parses them properly.
      
      Teach the TryCompile test to cover this case by adding a flag with
      quotes into CMAKE_C_FLAGS during a C language try_compile.
      290857bb
  7. 06 Jun, 2013 1 commit
    • Brad King's avatar
      try_compile: Add signature to allow multiple SOURCES · 482f1122
      Brad King authored
      Extend the signature
      
       try_compile(RESULT_VAR <bindir> <srcfile> ...)
      
      to allow multiple sources as
      
       try_compile(RESULT_VAR <bindir> SOURCES <srcfile>... ...)
      
      Process the sources to generate a CMakeLists.txt that enables all needed
      languages.
      
      Teach the TryCompile test to try cases with two sources of the same
      language and of mixed languages.  Teach RunCMake.try_compile to cover
      error cases for the signature.
      482f1122
  8. 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
  9. 18 Mar, 2011 1 commit
  10. 16 Dec, 2010 1 commit
  11. 28 Jan, 2010 1 commit
  12. 25 Jan, 2010 1 commit
    • Brad King's avatar
      Avoid PathScale cmd-line bug in TryCompile test · 2b3eee46
      Brad King authored
      The PathScale compiler silently accepts unknown options that start in
      more than one '-':
      
        $ touch foo.c
        $ pathcc -c foo.c --junk
        $ echo $?
        0
        $ pathcc -c foo.c ---junk
        $ echo $?
        0
        $ pathcc -c foo.c -junk
        pathcc ERROR parsing -junk: unknown flag
        $ echo $?
        2
      
      We teach the TryCompile to pass a bogus flag with only one '-' instead
      of three '-'s for this compiler.
      2b3eee46
  13. 03 Nov, 2009 1 commit
  14. 28 Oct, 2009 1 commit
  15. 18 Sep, 2009 1 commit
    • Brad King's avatar
      Fix CHECK_(C|CXX)_COMPILER_FLAG macro test · 997ae66c
      Brad King authored
      The flag "-_this_is_not_a_flag_" was not rejected by GCC 4.0 on older
      Mac OS X.  We now use "---_this_is_not_a_flag_" instead, which will
      hopefully be rejected by all compilers.
      997ae66c
  16. 17 Sep, 2009 1 commit
  17. 04 Aug, 2009 1 commit
    • Brad King's avatar
      No /fast targets in try_compile project mode · 80c947b3
      Brad King authored
      The try_compile command builds the cmTryCompileExec executable using the
      cmTryCompileExec/fast target with Makefile generators in order to save
      time since dependencies are not needed.  However, in project mode the
      command builds an entire source tree that may have dependencies.
      Therefore we can use the /fast target approach only in one-source mode.
      80c947b3
  18. 03 Aug, 2009 1 commit
    • Brad King's avatar
      Test try_compile project mode · 1a159bbf
      Brad King authored
      The try_compile command project mode builds an entire source tree
      instead of one source file.  It uses an existing CMakeLists.txt file in
      the given source tree instead of generating one.  This commit creates a
      test for the mode in the TryCompile test.
      1a159bbf
  19. 16 Jul, 2008 1 commit
  20. 15 Jul, 2008 1 commit
  21. 25 Mar, 2008 1 commit
  22. 31 Jul, 2007 1 commit
    • Alexander Neundorf's avatar
      · 67672b81
      Alexander Neundorf authored
      ENH: add tests for check_c_source_runs(), check_cxx_source_runs(),
      check_c_source_compiles() and check_cxx_source_compiles()
      -TRY_RUN in crosscompiling mode: copy the created executables to
      CMAKE_BINARY_DIR so the user can run them manually on the target
      
      Alex
      67672b81
  23. 01 Jun, 2007 1 commit
    • Alexander Neundorf's avatar
      · eddf1cf3
      Alexander Neundorf authored
      ENH: improve TRY_RUN() for crosscompiling: instead of just failing, it now
      creates two cache variables, one for the RUN_RESULT, one for the RUN_OUTPUT
      (if required), which can be set or preset by the user. It has now also two
      new arguments: RUN_OUTPUT_VARIABLE and COMPILE_OUTPUT_VARIABLE (the old
      OUTPUT_VARIABLE merges both), so if only COMPILE_OUTPUT_VARIABLE is used the
      run time output of the TRY_RUN is unused and the user doesn't have to care
      about the output when crosscompiling. This is now used in FindThreads.cmake,
      CheckC/CXXSourceRuns.cmake and TestBigEndian.cmake, which used the output
      only for the logfile (compile output is still there). Test/TryCompile/ now
      also tests the behaviour of OUTPUT_VARIABLE, RUN_OUTPUT_VARIABLE and
      COMPILE_OUTPUT_VARIABLE.
      
      Alex
      eddf1cf3
  24. 24 May, 2007 2 commits
    • Alexander Neundorf's avatar
      · 7147c3e1
      Alexander Neundorf authored
      ENH: add COPY_FILE argument to TRY_COMPILE, so the compiled executable can
      be used e.g. for getting strings out of it.
      
      Alex
      7147c3e1
    • Alexander Neundorf's avatar
      · 7d7aba29
      Alexander Neundorf authored
      ENH: add two simple tests for TRY_RUN()
      STYLE: create a new base class cmCoreTryCompile, from which
      cmTryCompileCommand and cmTryRunCommand are derived, so there are no public
      static functions with lots of arguments anymore
      
      Alex
      7d7aba29
  25. 31 Jan, 2007 1 commit
  26. 14 Jun, 2006 1 commit
  27. 12 Jan, 2006 1 commit
  28. 20 May, 2004 1 commit
  29. 10 Feb, 2003 3 commits