ENH: put CmakeTmp into CMakeFiles

This commit is contained in:
Ken Martin 2006-01-12 13:49:32 -05:00
parent 1fd9060406
commit 4bdca3b404
19 changed files with 54 additions and 52 deletions

View File

@ -6,13 +6,13 @@
# any makefiles or projects.
IF(NOT CMAKE_C_COMPILER_WORKS)
MESSAGE(STATUS "Check for working C compiler: ${CMAKE_C_COMPILER}")
FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeTmp/testCCompiler.c
FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/testCCompiler.c
"#ifdef __cplusplus\n"
"# error \"The CMAKE_C_COMPILER is set to a C++ compiler\"\n"
"#endif\n"
"int main(){return 0;}\n")
TRY_COMPILE(CMAKE_C_COMPILER_WORKS ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/CMakeTmp/testCCompiler.c
${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/testCCompiler.c
OUTPUT_VARIABLE OUTPUT)
SET(C_TEST_WAS_RUN 1)
ENDIF(NOT CMAKE_C_COMPILER_WORKS)

View File

@ -6,13 +6,13 @@
# any makefiles or projects.
IF(NOT CMAKE_CXX_COMPILER_WORKS)
MESSAGE(STATUS "Check for working CXX compiler: ${CMAKE_CXX_COMPILER}")
FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeTmp/testCXXCompiler.cxx
FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
"#ifndef __cplusplus\n"
"# error \"The CMAKE_CXX_COMPILER is set to a C compiler\"\n"
"#endif\n"
"int main(){return 0;}\n")
TRY_COMPILE(CMAKE_CXX_COMPILER_WORKS ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/CMakeTmp/testCXXCompiler.cxx
${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
OUTPUT_VARIABLE OUTPUT)
SET(CXX_TEST_WAS_RUN 1)
ENDIF(NOT CMAKE_CXX_COMPILER_WORKS)

View File

@ -6,13 +6,13 @@
# any makefiles or projects.
IF(NOT CMAKE_Fortran_COMPILER_WORKS)
MESSAGE(STATUS "Check for working Fortran compiler: ${CMAKE_Fortran_COMPILER}")
FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeTmp/testFortranCompiler.f "
FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/testFortranCompiler.f "
PROGRAM TESTFortran
PRINT *, 'Hello'
END
")
TRY_COMPILE(CMAKE_Fortran_COMPILER_WORKS ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/CMakeTmp/testFortranCompiler.f
${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/testFortranCompiler.f
OUTPUT_VARIABLE OUTPUT)
SET(FORTRAN_TEST_WAS_RUN 1)
ENDIF(NOT CMAKE_Fortran_COMPILER_WORKS)
@ -41,13 +41,13 @@ IF(CMAKE_Fortran_COMPILER_WORKS)
IF(DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90)
ELSE(DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90)
MESSAGE(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90")
FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeTmp/testFortranCompilerF90.f90 "
FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/testFortranCompilerF90.f90 "
PROGRAM TESTFortran90
stop = 1 ; do while ( stop .eq. 0 ) ; end do
END PROGRAM TESTFortran90
")
TRY_COMPILE(CMAKE_Fortran_COMPILER_SUPPORTS_F90 ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/CMakeTmp/testFortranCompilerF90.f90
${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/testFortranCompilerF90.f90
OUTPUT_VARIABLE OUTPUT)
IF(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
MESSAGE(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90 -- yes")

View File

@ -20,13 +20,13 @@ MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR)
SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
ENDIF(CMAKE_REQUIRED_INCLUDES)
FILE(WRITE "${CMAKE_BINARY_DIR}/CMakeTmp/src.c"
FILE(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/src.c"
"${SOURCE}")
MESSAGE(STATUS "Performing Test ${VAR}")
TRY_COMPILE(${VAR}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/CMakeTmp/src.c
${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/src.c
CMAKE_FLAGS
"${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}"
"${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"

View File

@ -20,13 +20,13 @@ MACRO(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
ENDIF(CMAKE_REQUIRED_INCLUDES)
FILE(WRITE "${CMAKE_BINARY_DIR}/CMakeTmp/src.c"
FILE(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/src.c"
"${SOURCE}")
MESSAGE(STATUS "Performing Test ${VAR}")
TRY_COMPILE(${VAR}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/CMakeTmp/src.cxx
${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/src.cxx
CMAKE_FLAGS
"${CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES}"
"${CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES}"
@ -34,14 +34,14 @@ MACRO(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
IF(${VAR})
SET(${VAR} 1 CACHE INTERNAL "Test ${FUNCTION}")
MESSAGE(STATUS "Performing Test ${VAR} - Success")
WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeOutput.log
WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log
"Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n"
"${OUTPUT}\n"
"Source file was:\n${SOURCE}\n" APPEND)
ELSE(${VAR})
MESSAGE(STATUS "Performing Test ${VAR} - Failed")
SET(${VAR} "" CACHE INTERNAL "Test ${FUNCTION}")
WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeError.log
WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
"Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n"
"${OUTPUT}\n"
"Source file was:\n${SOURCE}\n" APPEND)

View File

@ -12,7 +12,7 @@ MACRO(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
SET(MACRO_CHECK_INCLUDE_FILE_FLAGS ${CMAKE_REQUIRED_FLAGS})
SET(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CheckIncludeFile.c.in
${CMAKE_BINARY_DIR}/CMakeTmp/CheckIncludeFile.c IMMEDIATE)
${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckIncludeFile.c IMMEDIATE)
MESSAGE(STATUS "Looking for ${INCLUDE}")
IF(${ARGC} EQUAL 3)
SET(CMAKE_C_FLAGS_SAVE ${CMAKE_C_FLAGS})
@ -21,7 +21,7 @@ MACRO(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
TRY_COMPILE(${VARIABLE}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/CMakeTmp/CheckIncludeFile.c
${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckIncludeFile.c
CMAKE_FLAGS
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILE_FLAGS}
OUTPUT_VARIABLE OUTPUT)

View File

@ -12,7 +12,7 @@ MACRO(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
SET(MACRO_CHECK_INCLUDE_FILE_FLAGS ${CMAKE_REQUIRED_FLAGS})
SET(CHECK_INCLUDE_FILE_VAR ${INCLUDE})
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CheckIncludeFile.cxx.in
${CMAKE_BINARY_DIR}/CMakeTmp/CheckIncludeFile.cxx IMMEDIATE)
${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckIncludeFile.cxx IMMEDIATE)
MESSAGE(STATUS "Looking for C++ include ${INCLUDE}")
IF(${ARGC} EQUAL 3)
SET(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS})
@ -21,7 +21,7 @@ MACRO(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
TRY_COMPILE(${VARIABLE}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/CMakeTmp/CheckIncludeFile.cxx
${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckIncludeFile.cxx
CMAKE_FLAGS
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILE_FLAGS}
OUTPUT_VARIABLE OUTPUT)

View File

@ -19,20 +19,20 @@ MACRO(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
ENDFOREACH(FILE)
SET(CHECK_INCLUDE_FILES_CONTENT
"${CHECK_INCLUDE_FILES_CONTENT}\n\nint main(){return 0;}\n")
FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeTmp/CheckIncludeFiles.c
FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckIncludeFiles.c
"${CHECK_INCLUDE_FILES_CONTENT}")
MESSAGE(STATUS "Looking for include files ${VARIABLE}")
TRY_COMPILE(${VARIABLE}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/CMakeTmp/CheckIncludeFiles.c
${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckIncludeFiles.c
CMAKE_FLAGS
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILES_FLAGS}
OUTPUT_VARIABLE OUTPUT)
IF(${VARIABLE})
MESSAGE(STATUS "Looking for include files ${VARIABLE} - found")
SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${VARIABLE}")
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeFiles/CMakeOutput.log
"Determining if files ${INCLUDE} "
"exist passed with the following output:\n"
"${OUTPUT}\n\n")

View File

@ -25,13 +25,13 @@ MACRO(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
SET(CHECK_SYMBOL_EXISTS_CONTENT
"${CHECK_SYMBOL_EXISTS_CONTENT}\nvoid cmakeRequireSymbol(int dummy,...){(void)dummy;}\nint main()\n{\n#ifndef ${SYMBOL}\n cmakeRequireSymbol(0,&${SYMBOL});\n#endif\n return 0;\n}\n")
FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeTmp/CheckSymbolExists.c
FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckSymbolExists.c
"${CHECK_SYMBOL_EXISTS_CONTENT}")
MESSAGE(STATUS "Looking for ${SYMBOL}")
TRY_COMPILE(${VARIABLE}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/CMakeTmp/CheckSymbolExists.c
${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckSymbolExists.c
CMAKE_FLAGS
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_SYMBOL_EXISTS_FLAGS}
"${CHECK_SYMBOL_EXISTS_LIBS}"
@ -42,7 +42,7 @@ MACRO(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log
"Determining if the ${SYMBOL} "
"exist passed with the following output:\n"
"${OUTPUT}\nFile ${CMAKE_BINARY_DIR}/CMakeTmp/CheckSymbolExists.c:\n"
"${OUTPUT}\nFile ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckSymbolExists.c:\n"
"${CHECK_SYMBOL_EXISTS_CONTENT}\n")
ELSE(${VARIABLE})
MESSAGE(STATUS "Looking for ${SYMBOL} - not found.")
@ -50,7 +50,7 @@ MACRO(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
"Determining if the ${SYMBOL} "
"exist failed with the following output:\n"
"${OUTPUT}\nFile ${CMAKE_BINARY_DIR}/CMakeTmp/CheckSymbolExists.c:\n"
"${OUTPUT}\nFile ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckSymbolExists.c:\n"
"${CHECK_SYMBOL_EXISTS_CONTENT}\n")
ENDIF(${VARIABLE})
ENDIF("${VARIABLE}" MATCHES "^${VARIABLE}$")

View File

@ -22,8 +22,8 @@ MACRO(CHECK_TYPE_SIZE TYPE VARIABLE)
SET(CHECK_TYPE_SIZE_PREMAIN "${CHECK_TYPE_SIZE_PREMAIN}#include \"${def}\"\n")
ENDFOREACH(def)
CONFIGURE_FILE("${CMAKE_ROOT}/Modules/CheckTypeSize.c.in"
"${CMAKE_BINARY_DIR}/CMakeTmp/CheckTypeSize.c" IMMEDIATE @ONLY)
FILE(READ "${CMAKE_BINARY_DIR}/CMakeTmp/CheckTypeSize.c"
"${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}")
IF(CMAKE_REQUIRED_LIBRARIES)
@ -32,7 +32,7 @@ MACRO(CHECK_TYPE_SIZE TYPE VARIABLE)
ENDIF(CMAKE_REQUIRED_LIBRARIES)
TRY_RUN(${VARIABLE} HAVE_${VARIABLE}
${CMAKE_BINARY_DIR}
"${CMAKE_BINARY_DIR}/CMakeTmp/CheckTypeSize.c"
"${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckTypeSize.c"
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_TYPE_SIZE_FLAGS}
"${CHECK_TYPE_SIZE_ADD_LIBRARIES}"
OUTPUT_VARIABLE OUTPUT)

View File

@ -147,7 +147,7 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
# To minimize external dependencies, create a sdlsound test program
# which will be used to figure out if additional link dependencies are
# required for the link phase.
FILE(WRITE ${PROJECT_BINARY_DIR}/CMakeTmp/DetermineSoundLibs.c
FILE(WRITE ${PROJECT_BINARY_DIR}/CMakeFiles/CMakeTmp/DetermineSoundLibs.c
"#include \"SDL_sound.h\"
#include \"SDL.h\"
int main(int argc, char* argv[])
@ -176,7 +176,7 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
# in the TARGET_LINK_LIBRARIES, I seem to loose everything
# in the SDL_LIBRARY string after the "-framework".
# But if I quote the stuff in INCLUDE_DIRECTORIES, it doesn't work.
FILE(WRITE ${PROJECT_BINARY_DIR}/CMakeTmp/CMakeLists.txt
FILE(WRITE ${PROJECT_BINARY_DIR}/CMakeFiles/CMakeTmp/CMakeLists.txt
"PROJECT(DetermineSoundLibs)
INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR} ${SDL_SOUND_INCLUDE_DIR})
ADD_EXECUTABLE(DetermineSoundLibs DetermineSoundLibs.c)
@ -185,8 +185,8 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
TRY_COMPILE(
MY_RESULT
${PROJECT_BINARY_DIR}/CMakeTmp
${PROJECT_BINARY_DIR}/CMakeTmp
${PROJECT_BINARY_DIR}/CMakeFiles/CMakeTmp
${PROJECT_BINARY_DIR}/CMakeFiles/CMakeTmp
DetermineSoundLibs
OUTPUT_VARIABLE MY_OUTPUT
)

View File

@ -115,12 +115,12 @@ IF(CMAKE_GENERATOR MATCHES "NMake Makefiles")
# try to figure out if we are running the free command line
# tools from Microsoft. These tools do not provide debug libraries,
# so the link flags used have to be different.
MAKE_DIRECTORY("${CMAKE_BINARY_DIR}/CMakeTmp2")
MAKE_DIRECTORY("${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp2")
SET(testForFreeVCFile
"${CMAKE_ROOT}/Modules/CMakeTestForFreeVC.cxx")
STRING(REGEX REPLACE "/" "\\\\" testForFreeVCFile "${testForFreeVCFile}")
MESSAGE(STATUS "Check if this is a free VC compiler")
EXEC_PROGRAM(${CMAKE_C_COMPILER} ${CMAKE_BINARY_DIR}/CMakeTmp2
EXEC_PROGRAM(${CMAKE_C_COMPILER} ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp2
ARGS /nologo /MD /EHsc
\"${testForFreeVCFile}\"
OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT

View File

@ -23,8 +23,8 @@ 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}/CMakeTmp/CheckTypeSize.c" IMMEDIATE @ONLY)
FILE(READ "${CMAKE_BINARY_DIR}/CMakeTmp/CheckTypeSize.c"
"${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckTypeSize.c" @ONLY)
FILE(READ "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckTypeSize.c"
CHECK_TYPE_SIZE_FILE_CONTENT)
MESSAGE(STATUS "Check size of ${TYPE}")
IF(CMAKE_REQUIRED_LIBRARIES)
@ -33,7 +33,7 @@ MACRO(CHECK_TYPE_SIZE TYPE VARIABLE)
ENDIF(CMAKE_REQUIRED_LIBRARIES)
TRY_RUN(${VARIABLE} HAVE_${VARIABLE}
${CMAKE_BINARY_DIR}
"${CMAKE_BINARY_DIR}/CMakeTmp/CheckTypeSize.c"
"${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckTypeSize.c"
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_TYPE_SIZE_FLAGS}
"${CHECK_TYPE_SIZE_ADD_LIBRARIES}"
OUTPUT_VARIABLE OUTPUT)

View File

@ -110,7 +110,7 @@ int cmTryCompileCommand::CoreTryCompileCode(
// signature
if (srcFileSignature)
{
tmpString = argv[1] + "/CMakeTmp";
tmpString = argv[1] + "/CMakeFiles/CMakeTmp";
binaryDirectory = tmpString.c_str();
}
// make sure the binary directory exists
@ -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] + "/CMakeTmp") == source.npos)
if(source.find(argv[1] + "/CMakeFiles/CMakeTmp") == source.npos)
{
mf->AddCMakeDependFile(source.c_str());
}

View File

@ -89,7 +89,7 @@ public:
"extra flags that can be included are, "
"INCLUDE_DIRECTORIES, LINK_DIRECTORIES, and LINK_LIBRARIES. "
"COMPILE_DEFINITIONS are -Ddefinition that will be passed to the "
"compile line. If srcfile is specified the files in bindir/CMakeTmp "
"compile line. If srcfile is specified the files in bindir/CMakeFiles/CMakeTmp "
"are cleaned automatically. If OUTPUT_VARIABLE is specified, then the "
"output from the build process is stored in the given variable. "
"TRY_COMPILE creates a CMakeList.txt "

View File

@ -67,7 +67,7 @@ bool cmTryRunCommand::InitialPass(std::vector<std::string> const& argv)
int res = cmTryCompileCommand::CoreTryCompileCode(m_Makefile, tryCompile, false);
// now try running the command if it compiled
std::string binaryDirectory = argv[2] + "/CMakeTmp";
std::string binaryDirectory = argv[2] + "/CMakeFiles/CMakeTmp";
if (!res)
{
int retVal = -1;

View File

@ -2,7 +2,7 @@ PROJECT(TryCompile)
# try to compile a file that should compile
TRY_COMPILE(SHOULD_PASS
${TryCompile_BINARY_DIR}/CMakeTmp
${TryCompile_BINARY_DIR}/CMakeFiles/CMakeTmp
${TryCompile_SOURCE_DIR}/pass.c
OUTPUT_VARIABLE TRY_OUT)
IF(NOT SHOULD_PASS)
@ -11,7 +11,7 @@ ENDIF(NOT SHOULD_PASS)
# try to compile a file that should not compile
TRY_COMPILE(SHOULD_FAIL
${TryCompile_BINARY_DIR}/CMakeTmp
${TryCompile_BINARY_DIR}/CMakeFiles/CMakeTmp
${TryCompile_SOURCE_DIR}/fail.c
OUTPUT_VARIABLE TRY_OUT)
IF(SHOULD_FAIL)
@ -20,7 +20,7 @@ ENDIF(SHOULD_FAIL)
# try to compile a file that should compile
TRY_COMPILE(SHOULD_PASS
${TryCompile_BINARY_DIR}/CMakeTmp
${TryCompile_BINARY_DIR}/CMakeFiles/CMakeTmp
${TryCompile_SOURCE_DIR}/pass.c
OUTPUT_VARIABLE TRY_OUT)
IF(NOT SHOULD_PASS)
@ -29,7 +29,7 @@ ENDIF(NOT SHOULD_PASS)
# try to compile a file that should not compile
TRY_COMPILE(SHOULD_FAIL
${TryCompile_BINARY_DIR}/CMakeTmp
${TryCompile_BINARY_DIR}/CMakeFiles/CMakeTmp
${TryCompile_SOURCE_DIR}/fail.c
OUTPUT_VARIABLE TRY_OUT)
IF(SHOULD_FAIL)
@ -45,7 +45,8 @@ IF(NOT SHOULD_FAIL)
ELSE(NOT SHOULD_FAIL)
MESSAGE("Test failed")
ENDIF(NOT SHOULD_FAIL)
TRY_COMPILE(CMAKE_ANSI_FOR_SCOPE ${TryCompile_BINARY_DIR}/CMakeTmp
TRY_COMPILE(CMAKE_ANSI_FOR_SCOPE
${TryCompile_BINARY_DIR}/CMakeFiles/CMakeTmp
${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx OUTPUT_VARIABLE OUT)
IF (CMAKE_ANSI_FOR_SCOPE)
MESSAGE("Compiler supports ansi for")
@ -53,7 +54,8 @@ ELSE(CMAKE_ANSI_FOR_SCOPE)
MESSAGE("Compiler does not support ansi for scope")
ENDIF(CMAKE_ANSI_FOR_SCOPE)
TRY_COMPILE(CMAKE_ANSI_FOR_SCOPE ${TryCompile_BINARY_DIR}/CMakeTmp
TRY_COMPILE(CMAKE_ANSI_FOR_SCOPE
${TryCompile_BINARY_DIR}/CMakeFiles/CMakeTmp
${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx OUTPUT_VARIABLE OUT)
IF (CMAKE_ANSI_FOR_SCOPE)
MESSAGE("Compiler supports ansi for")

View File

@ -23,8 +23,8 @@ 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}/CMakeTmp/CheckTypeSize.c" IMMEDIATE @ONLY)
FILE(READ "${CMAKE_BINARY_DIR}/CMakeTmp/CheckTypeSize.c"
"${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckTypeSize.c" @ONLY)
FILE(READ "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckTypeSize.c"
CHECK_TYPE_SIZE_FILE_CONTENT)
MESSAGE(STATUS "Check size of ${TYPE}")
IF(CMAKE_REQUIRED_LIBRARIES)
@ -33,7 +33,7 @@ MACRO(CHECK_TYPE_SIZE TYPE VARIABLE)
ENDIF(CMAKE_REQUIRED_LIBRARIES)
TRY_RUN(${VARIABLE} HAVE_${VARIABLE}
${CMAKE_BINARY_DIR}
"${CMAKE_BINARY_DIR}/CMakeTmp/CheckTypeSize.c"
"${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckTypeSize.c"
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_TYPE_SIZE_FLAGS}
"${CHECK_TYPE_SIZE_ADD_LIBRARIES}"
OUTPUT_VARIABLE OUTPUT)

View File

@ -15,13 +15,13 @@ MACRO(TRY_COMPILE_FROM_SOURCE SOURCE VAR)
ENDFOREACH(inc)
SET(src "${src}\nint main() { ${SOURCE} ; return 0; }")
FILE(WRITE "${CMAKE_BINARY_DIR}/CMakeTmp/src.c"
FILE(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/src.c"
"${src}")
MESSAGE(STATUS "Performing Test ${VAR}")
TRY_COMPILE(${VAR}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/CMakeTmp/src.c
${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/src.c
CMAKE_FLAGS
"${TRY_COMPILE_FROM_SOURCE_ADD_LIBRARIES}"
OUTPUT_VARIABLE OUTPUT)