store the compiler in the cache
This commit is contained in:
parent
f5d95fb078
commit
f54bfe467c
|
@ -5,11 +5,15 @@
|
||||||
# the cmake variable CMAKE_GENERATOR_CC which can be defined by a generator
|
# the cmake variable CMAKE_GENERATOR_CC which can be defined by a generator
|
||||||
# as a default compiler
|
# as a default compiler
|
||||||
|
|
||||||
FIND_PROGRAM(CMAKE_C_COMPILER_FULLPATH NAMES $ENV{CC} ${CMAKE_GENERATOR_CC} gcc cc cl bcc )
|
IF(NOT CMAKE_C_COMPILER)
|
||||||
GET_FILENAME_COMPONENT(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_FULLPATH} NAME_WE)
|
FIND_PROGRAM(CMAKE_C_COMPILER_FULLPATH NAMES $ENV{CC} ${CMAKE_GENERATOR_CC} gcc cc cl bcc )
|
||||||
# set this to notfound right after so that it is searched for each time this
|
GET_FILENAME_COMPONENT(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_FULLPATH} NAME_WE)
|
||||||
# file is included
|
# set this to notfound right after so that it is searched for each time this
|
||||||
SET(CMAKE_C_COMPILER_FULLPATH NOTFOUND CACHE INTERNAL "full path to c compiler" FORCE)
|
# file is included
|
||||||
|
SET(CMAKE_C_COMPILER_FULLPATH NOTFOUND CACHE INTERNAL "full path to c compiler" FORCE)
|
||||||
|
SET(CMAKE_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING "C++ compiler")
|
||||||
|
ENDIF(NOT CMAKE_C_COMPILER)
|
||||||
|
MARK_AS_ADVANCED(CMAKE_C_COMPILER)
|
||||||
FIND_PROGRAM(CMAKE_AR NAMES ar PATHS /bin /usr/bin /usr/local/bin)
|
FIND_PROGRAM(CMAKE_AR NAMES ar PATHS /bin /usr/bin /usr/local/bin)
|
||||||
|
|
||||||
FIND_PROGRAM(CMAKE_RANLIB NAMES ranlib PATHS /bin /usr/bin /usr/local/bin)
|
FIND_PROGRAM(CMAKE_RANLIB NAMES ranlib PATHS /bin /usr/bin /usr/local/bin)
|
||||||
|
|
|
@ -5,8 +5,12 @@
|
||||||
# the cmake variable CMAKE_GENERATOR_CXX which can be defined by a generator
|
# the cmake variable CMAKE_GENERATOR_CXX which can be defined by a generator
|
||||||
# as a default compiler
|
# as a default compiler
|
||||||
|
|
||||||
FIND_PROGRAM(CMAKE_CXX_COMPILER_FULLPATH NAMES $ENV{CXX} ${CMAKE_GENERATOR_CXX} c++ g++ CC aCC cl bcc )
|
IF(NOT CMAKE_CXX_COMPILER)
|
||||||
GET_FILENAME_COMPONENT(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER_FULLPATH} NAME_WE)
|
FIND_PROGRAM(CMAKE_CXX_COMPILER_FULLPATH NAMES $ENV{CXX} ${CMAKE_GENERATOR_CXX} c++ g++ CC aCC cl bcc )
|
||||||
|
GET_FILENAME_COMPONENT(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER_FULLPATH} NAME_WE)
|
||||||
|
SET(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER} CACHE STRING "C++ compiler")
|
||||||
|
ENDIF(NOT CMAKE_CXX_COMPILER)
|
||||||
|
MARK_AS_ADVANCED(CMAKE_CXX_COMPILER)
|
||||||
|
|
||||||
# set this to notfound right after so that it is searched for each time this
|
# set this to notfound right after so that it is searched for each time this
|
||||||
# file is included
|
# file is included
|
||||||
|
|
Loading…
Reference in New Issue