ENH: fix problem where rc language recursively included itself because CMAKE_BASE_NAME was used from c compiler, do the same fix for other uses of CMAKE_BASE_NAME

This commit is contained in:
Bill Hoffman 2008-10-14 16:07:11 -04:00
parent ec9f2a18cc
commit 9d9582ffef
7 changed files with 9 additions and 7 deletions

View File

@ -7,7 +7,7 @@ ELSE(UNIX)
ENDIF(UNIX)
SET(CMAKE_INCLUDE_FLAG_ASM${ASM_DIALECT} "-I") # -I
SET(CMAKE_BASE_NAME)
GET_FILENAME_COMPONENT(CMAKE_BASE_NAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME_WE)
IF("${CMAKE_BASE_NAME}" STREQUAL "as")

View File

@ -12,7 +12,7 @@ IF(UNIX)
ELSE(UNIX)
SET(CMAKE_C_OUTPUT_EXTENSION .obj)
ENDIF(UNIX)
SET(CMAKE_BASE_NAME)
GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_C_COMPILER} NAME_WE)
IF(CMAKE_COMPILER_IS_GNUCC)
SET(CMAKE_BASE_NAME gcc)

View File

@ -13,7 +13,7 @@ ELSE(UNIX)
SET(CMAKE_CXX_OUTPUT_EXTENSION .obj)
ENDIF(UNIX)
SET(CMAKE_BASE_NAME)
GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_CXX_COMPILER} NAME_WE)
# since the gnu compiler has several names force g++
IF(CMAKE_COMPILER_IS_GNUCXX)

View File

@ -46,3 +46,4 @@ MARK_AS_ADVANCED(CMAKE_RC_COMPILER)
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeRCCompiler.cmake.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeRCCompiler.cmake IMMEDIATE)
SET(CMAKE_RC_COMPILER_ENV_VAR "RC")
SET(ENABLE_LANGUAGE_RC_CALLED TRUE)

View File

@ -3,6 +3,7 @@
# It also loads the available platform file for the system-compiler
# if it exists.
SET(CMAKE_BASE_NAME)
GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_Fortran_COMPILER} NAME_WE)
# since the gnu compiler has several names force g++
IF(CMAKE_COMPILER_IS_GNUG77)

View File

@ -3,12 +3,15 @@
# It also loads the available platform file for the system-compiler
# if it exists.
# make sure we don't use CMAKE_BASE_NAME from somewhere else
SET(CMAKE_BASE_NAME)
GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_RC_COMPILER} NAME_WE)
SET(CMAKE_SYSTEM_AND_RC_COMPILER_INFO_FILE
${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
SET (CMAKE_RC_FLAGS "$ENV{RCFLAGS} ${CMAKE_RC_FLAGS_INIT}" CACHE STRING
"Flags for Fortran compiler.")

View File

@ -29,10 +29,7 @@ ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 9")
# make sure to enable languages after setting configuration types
IF(NOT ENABLE_LANGUAGE_RC_CALLED AND NOT CMAKE_DO_TRY_COMPILE)
ENABLE_LANGUAGE(RC)
ENDIF(NOT ENABLE_LANGUAGE_RC_CALLED AND NOT CMAKE_DO_TRY_COMPILE)
SET(ENABLE_LANGUAGE_RC_CALLED TRUE)
ENABLE_LANGUAGE(RC)
SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
# for nmake we need to compute some information about the compiler