Commit e35ce980 authored by Lynn Garren's avatar Lynn Garren
Browse files

use CMAKE_CXX_COMPILER_ID everywhere

parent 8863eb9b
......@@ -210,19 +210,22 @@ macro( clhep_set_compiler_flags )
message(STATUS "cmake build type is ${CMAKE_BUILD_TYPE}")
_clhep_check_cxxstd()
if(THREADS_HAVE_PTHREAD_ARG)
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread" )
elseif(CMAKE_COMPILER_IS_GNUCXX)
# needed when building with gcc on OSX
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread" )
endif()
if( CLHEP_DEBUG_MESSAGES )
message(STATUS "enable c++11 extensions: ${CMAKE_CXX_FLAGS}")
endif()
message(STATUS "enable c++11 extensions: ${CMAKE_CXX_FLAGS}")
if( CLHEP_DEBUG_MESSAGES )
message(STATUS "clhep_set_compiler_flags debug: CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
message(STATUS "clhep_set_compiler_flags debug: cmake compilers ${CMAKE_CXX_COMPILER} ${CMAKE_C_COMPILER}")
endif( CLHEP_DEBUG_MESSAGES )
get_filename_component(clhep_cxx_compiler ${CMAKE_CXX_COMPILER} NAME)
get_filename_component(clhep_c_compiler ${CMAKE_C_COMPILER} NAME)
if( CLHEP_DEBUG_MESSAGES )
message(STATUS "using compilers ${clhep_cxx_compiler} ${clhep_c_compiler}")
message(STATUS "using compiler ${CMAKE_CXX_COMPILER_ID}")
endif( CLHEP_DEBUG_MESSAGES )
if( ${clhep_c_compiler} STREQUAL "clang" )
if( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" )
set(CMAKE_C_FLAGS "-O -pedantic -Wall ${CMAKE_C_FLAGS}")
elseif( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel" )
set(CMAKE_C_FLAGS "-O -ansi -pedantic -Wall {CMAKE_C_FLAGS}")
......@@ -230,11 +233,12 @@ macro( clhep_set_compiler_flags )
elseif( CMAKE_COMPILER_IS_GNUCC )
set(CMAKE_C_FLAGS "-O -ansi -pedantic -Wall -D_GNU_SOURCE ${CMAKE_C_FLAGS}")
endif()
if( ${clhep_cxx_compiler} STREQUAL "clang++" )
if( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" )
set(CMAKE_CXX_FLAGS "-O -pedantic -Wall ${CMAKE_CXX_FLAGS}")
elseif(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "-O -ansi -pedantic -Wall -D_GNU_SOURCE ${CMAKE_CXX_FLAGS}")
endif()
message(STATUS "clhep_set_compiler_flags debug: CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
# linker flags
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined,error")
......@@ -255,7 +259,7 @@ macro( clhep_set_compiler_flags )
endif()
endif()
clhep_autoconf_variables()
message( STATUS "compiling with ${clhep_cxx_compiler} ${CMAKE_CXX_FLAGS} ${CXXFLAGS}")
message( STATUS "compiling with ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_FLAGS} ${CXXFLAGS}")
endmacro( clhep_set_compiler_flags )
macro( clhep_package_config_no_lib )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment