[Cmake-commits] [cmake-commits] david.cole committed CMakeTestCCompiler.cmake 1.28 1.29 CMakeTestCXXCompiler.cmake 1.21 1.22 CMakeTestCompilerCommon.cmake NONE 1.1 CMakeTestFortranCompiler.cmake 1.12 1.13

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Feb 12 14:32:22 EST 2010


Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv22172/Modules

Modified Files:
	CMakeTestCCompiler.cmake CMakeTestCXXCompiler.cmake 
	CMakeTestFortranCompiler.cmake 
Added Files:
	CMakeTestCompilerCommon.cmake 
Log Message:
Make a common function that prints the status during the checks for working compilers. Call it from all of the CMakeTesten_US.UTF-8Compiler.cmake files. In the message, print the full path to the tested compiler only for the Makefile generators. For Xcode and Visual Studio generators, print the generator instead so that users are not misled with the full path to a compiler that the generator may not even use. Xcode and Visual Studio have their own mechanisms for choosing the compiler to use during try_compile and build...


Index: CMakeTestCCompiler.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeTestCCompiler.cmake,v
retrieving revision 1.28
retrieving revision 1.29
diff -C 2 -d -r1.28 -r1.29
*** CMakeTestCCompiler.cmake	28 Sep 2009 15:46:50 -0000	1.28
--- CMakeTestCCompiler.cmake	12 Feb 2010 19:32:20 -0000	1.29
***************
*** 13,16 ****
--- 13,18 ----
  #  License text for the above reference.)
  
+ INCLUDE(CMakeTestCompilerCommon)
+ 
  # This file is used by EnableLanguage in cmGlobalGenerator to
  # determine that that selected C compiler can actually compile
***************
*** 19,23 ****
  # any makefiles or projects.
  IF(NOT CMAKE_C_COMPILER_WORKS)
!   MESSAGE(STATUS "Check for working C compiler: ${CMAKE_C_COMPILER}")
    FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c
      "#ifdef __cplusplus\n"
--- 21,25 ----
  # any makefiles or projects.
  IF(NOT CMAKE_C_COMPILER_WORKS)
!   PrintTestCompilerStatus("C" "")
    FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c
      "#ifdef __cplusplus\n"
***************
*** 39,43 ****
  
  IF(NOT CMAKE_C_COMPILER_WORKS)
!   MESSAGE(STATUS "Check for working C compiler: ${CMAKE_C_COMPILER} -- broken")
    FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
      "Determining if the C compiler works failed with "
--- 41,45 ----
  
  IF(NOT CMAKE_C_COMPILER_WORKS)
!   PrintTestCompilerStatus("C" " -- broken")
    FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
      "Determining if the C compiler works failed with "
***************
*** 54,58 ****
  ELSE(NOT CMAKE_C_COMPILER_WORKS)
    IF(C_TEST_WAS_RUN)
!     MESSAGE(STATUS "Check for working C compiler: ${CMAKE_C_COMPILER} -- works")
      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
        "Determining if the C compiler works passed with "
--- 56,60 ----
  ELSE(NOT CMAKE_C_COMPILER_WORKS)
    IF(C_TEST_WAS_RUN)
!     PrintTestCompilerStatus("C" " -- works")
      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
        "Determining if the C compiler works passed with "

Index: CMakeTestCXXCompiler.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeTestCXXCompiler.cmake,v
retrieving revision 1.21
retrieving revision 1.22
diff -C 2 -d -r1.21 -r1.22
*** CMakeTestCXXCompiler.cmake	28 Sep 2009 15:46:50 -0000	1.21
--- CMakeTestCXXCompiler.cmake	12 Feb 2010 19:32:20 -0000	1.22
***************
*** 13,16 ****
--- 13,18 ----
  #  License text for the above reference.)
  
+ INCLUDE(CMakeTestCompilerCommon)
+ 
  # This file is used by EnableLanguage in cmGlobalGenerator to
  # determine that that selected C++ compiler can actually compile
***************
*** 19,23 ****
  # any makefiles or projects.
  IF(NOT CMAKE_CXX_COMPILER_WORKS)
!   MESSAGE(STATUS "Check for working CXX compiler: ${CMAKE_CXX_COMPILER}")
    FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx 
      "#ifndef __cplusplus\n"
--- 21,25 ----
  # any makefiles or projects.
  IF(NOT CMAKE_CXX_COMPILER_WORKS)
!   PrintTestCompilerStatus("CXX" "")
    FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx 
      "#ifndef __cplusplus\n"
***************
*** 32,36 ****
  
  IF(NOT CMAKE_CXX_COMPILER_WORKS)
!   MESSAGE(STATUS "Check for working CXX compiler: ${CMAKE_CXX_COMPILER} -- broken")
    # if the compiler is broken make sure to remove the platform file
    # since Windows-cl configures both c/cxx files both need to be removed
--- 34,38 ----
  
  IF(NOT CMAKE_CXX_COMPILER_WORKS)
!   PrintTestCompilerStatus("CXX" " -- broken")
    # if the compiler is broken make sure to remove the platform file
    # since Windows-cl configures both c/cxx files both need to be removed
***************
*** 47,51 ****
  ELSE(NOT CMAKE_CXX_COMPILER_WORKS)
    IF(CXX_TEST_WAS_RUN)
!     MESSAGE(STATUS "Check for working CXX compiler: ${CMAKE_CXX_COMPILER} -- works")
      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
        "Determining if the CXX compiler works passed with "
--- 49,53 ----
  ELSE(NOT CMAKE_CXX_COMPILER_WORKS)
    IF(CXX_TEST_WAS_RUN)
!     PrintTestCompilerStatus("CXX" " -- works")
      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
        "Determining if the CXX compiler works passed with "

Index: CMakeTestFortranCompiler.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeTestFortranCompiler.cmake,v
retrieving revision 1.12
retrieving revision 1.13
diff -C 2 -d -r1.12 -r1.13
*** CMakeTestFortranCompiler.cmake	28 Sep 2009 15:46:50 -0000	1.12
--- CMakeTestFortranCompiler.cmake	12 Feb 2010 19:32:20 -0000	1.13
***************
*** 13,16 ****
--- 13,18 ----
  #  License text for the above reference.)
  
+ INCLUDE(CMakeTestCompilerCommon)
+ 
  # This file is used by EnableLanguage in cmGlobalGenerator to
  # determine that that selected Fortran compiler can actually compile
***************
*** 19,23 ****
  # any makefiles or projects.
  IF(NOT CMAKE_Fortran_COMPILER_WORKS)
!   MESSAGE(STATUS "Check for working Fortran compiler: ${CMAKE_Fortran_COMPILER}")
    FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f "
          PROGRAM TESTFortran
--- 21,25 ----
  # any makefiles or projects.
  IF(NOT CMAKE_Fortran_COMPILER_WORKS)
!   PrintTestCompilerStatus("Fortran" "")
    FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f "
          PROGRAM TESTFortran
***************
*** 32,36 ****
  
  IF(NOT CMAKE_Fortran_COMPILER_WORKS)
!   MESSAGE(STATUS "Check for working Fortran compiler: ${CMAKE_Fortran_COMPILER} -- broken")
    FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
      "Determining if the Fortran compiler works failed with "
--- 34,38 ----
  
  IF(NOT CMAKE_Fortran_COMPILER_WORKS)
!   PrintTestCompilerStatus("Fortran" "  -- broken")
    FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
      "Determining if the Fortran compiler works failed with "
***************
*** 42,46 ****
  ELSE(NOT CMAKE_Fortran_COMPILER_WORKS)
    IF(FORTRAN_TEST_WAS_RUN)
!     MESSAGE(STATUS "Check for working Fortran compiler: ${CMAKE_Fortran_COMPILER} -- works")
      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
        "Determining if the Fortran compiler works passed with "
--- 44,48 ----
  ELSE(NOT CMAKE_Fortran_COMPILER_WORKS)
    IF(FORTRAN_TEST_WAS_RUN)
!     PrintTestCompilerStatus("Fortran" "  -- works")
      FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
        "Determining if the Fortran compiler works passed with "

--- NEW FILE: CMakeTestCompilerCommon.cmake ---

#=============================================================================
# Copyright 2010 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 distributed this file outside of CMake, substitute the full
#  License text for the above reference.)

function(PrintTestCompilerStatus LANG MSG)
  IF(CMAKE_GENERATOR MATCHES Make)
    MESSAGE(STATUS "Check for working ${LANG} compiler: ${CMAKE_${LANG}_COMPILER}${MSG}")
  ELSE()
    MESSAGE(STATUS "Check for working ${LANG} compiler using: ${CMAKE_GENERATOR}${MSG}")
  ENDIF()
endfunction()



More information about the Cmake-commits mailing list