ENH: fix for CMakeTmp move broken stuff

This commit is contained in:
Bill Hoffman 2006-01-13 11:44:39 -05:00
parent 96f948adf5
commit 2622956159
3 changed files with 5 additions and 4 deletions

View File

@ -201,7 +201,7 @@ int cmTryCompileCommand::CoreTryCompileCode(
projectName = "CMAKE_TRY_COMPILE";
targetName = "cmTryCompileExec";
// if the source is not in CMakeTmp
if(source.find(argv[1] + "/CMakeFiles/CMakeTmp") == source.npos)
if(source.find("CMakeTmp") == source.npos)
{
mf->AddCMakeDependFile(source.c_str());
}

View File

@ -23,7 +23,7 @@ MACRO(CHECK_TYPE_SIZE TYPE VARIABLE)
SET(CHECK_TYPE_SIZE_PREMAIN "${CHECK_TYPE_SIZE_PREMAIN}#include \"${def}\"\n")
ENDFOREACH(def)
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/CMake/CheckTypeSize.c.in"
"${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckTypeSize.c" @ONLY)
"${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckTypeSize.c" IMMEDIATE @ONLY)
FILE(READ "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckTypeSize.c"
CHECK_TYPE_SIZE_FILE_CONTENT)
MESSAGE(STATUS "Check size of ${TYPE}")

View File

@ -15,9 +15,10 @@ MACRO(TRY_COMPILE_FROM_SOURCE SOURCE VAR)
ENDFOREACH(inc)
SET(src "${src}\nint main() { ${SOURCE} ; return 0; }")
FILE(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/src.c"
FILE(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/src2.c"
"${src}")
EXEC_PROGRAM("${CMAKE_COMMAND}" "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp"
ARGS -E copy src2.c src.c)
MESSAGE(STATUS "Performing Test ${VAR}")
TRY_COMPILE(${VAR}
${CMAKE_BINARY_DIR}