ENH: check for CMAKE_HOST_SYSTEM_NAME to decide whether to load

CMakeDetermineSystem.cmake, since CMAKE_SYSTEM_NAME might already be preset
when using cmake for cross compiling
use type STRING instead of FILEPATH since otherwise a strange filename was
generated

Alex
This commit is contained in:
Alexander Neundorf 2007-06-26 13:00:42 -04:00
parent 2b1ae31453
commit 5fb7dab541
3 changed files with 4 additions and 4 deletions

View File

@ -75,7 +75,7 @@ ELSE(NOT CMAKE_C_COMPILER)
FIND_PROGRAM(CMAKE_C_COMPILER_WITH_PATH NAMES ${CMAKE_C_COMPILER})
MARK_AS_ADVANCED(CMAKE_C_COMPILER_WITH_PATH)
IF(CMAKE_C_COMPILER_WITH_PATH)
SET(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_WITH_PATH} CACHE FILEPATH "C compiler" FORCE)
SET(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_WITH_PATH} CACHE STRING "C compiler" FORCE)
ENDIF(CMAKE_C_COMPILER_WITH_PATH)
ENDIF(NOT _CMAKE_USER_C_COMPILER_PATH)
ENDIF(NOT CMAKE_C_COMPILER)

View File

@ -73,7 +73,7 @@ ELSE(NOT CMAKE_CXX_COMPILER)
FIND_PROGRAM(CMAKE_CXX_COMPILER_WITH_PATH NAMES ${CMAKE_CXX_COMPILER})
MARK_AS_ADVANCED(CMAKE_CXX_COMPILER_WITH_PATH)
IF(CMAKE_CXX_COMPILER_WITH_PATH)
SET(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER_WITH_PATH} CACHE FILEPATH "CXX compiler" FORCE)
SET(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER_WITH_PATH} CACHE STRING "CXX compiler" FORCE)
ENDIF(CMAKE_CXX_COMPILER_WITH_PATH)
ENDIF(NOT _CMAKE_USER_CXX_COMPILER_PATH)
ENDIF(NOT CMAKE_CXX_COMPILER)

View File

@ -160,7 +160,7 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf)
//
// CMakeSystem.cmake - configured file created by CMakeDetermineSystem.cmake
// CMakeDetermineSystem.cmake - figure out os info and create
// CMakeSystem.cmake IFF CMAKE_SYSTEM_NAME
// CMakeSystem.cmake IF CMAKE_HOST_SYSTEM_NAME
// not set
// CMakeSystem.cmake - configured file created by
// CMakeDetermineSystem.cmake IFF CMAKE_SYSTEM_LOADED
@ -243,7 +243,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
}
// Load the CMakeDetermineSystem.cmake file and find out
// what platform we are running on
if (!mf->GetDefinition("CMAKE_SYSTEM_NAME"))
if (!mf->GetDefinition("CMAKE_HOST_SYSTEM_NAME"))
{
#if defined(_WIN32) && !defined(__CYGWIN__)
/* Windows version number data. */