[cmake-commits] alex committed CMakeDetermineSystem.cmake 1.27 1.28
CMakeFindBinUtils.cmake 1.7 1.8 CMakeSystem.cmake.in 1.7 1.8
CMakeSystemWithToolchainFile.cmake.in 1.5 NONE
cmake-commits at cmake.org
cmake-commits at cmake.org
Wed Aug 15 14:26:02 EDT 2007
Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv333
Modified Files:
CMakeDetermineSystem.cmake CMakeFindBinUtils.cmake
CMakeSystem.cmake.in
Removed Files:
CMakeSystemWithToolchainFile.cmake.in
Log Message:
STYLE: don't use an extra file to generate CMakeSystem.cmake but instead
configure the toolchain file into it if required
-also search for nm, objdump and objcpy, so these can be used in macros
Alex
Index: CMakeSystem.cmake.in
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeSystem.cmake.in,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- CMakeSystem.cmake.in 29 May 2007 15:36:07 -0000 1.7
+++ CMakeSystem.cmake.in 15 Aug 2007 18:26:00 -0000 1.8
@@ -1,3 +1,5 @@
+ at INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED@
+
SET(CMAKE_SYSTEM "@CMAKE_SYSTEM@")
SET(CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@")
SET(CMAKE_SYSTEM_VERSION "@CMAKE_SYSTEM_VERSION@")
Index: CMakeFindBinUtils.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeFindBinUtils.cmake,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- CMakeFindBinUtils.cmake 2 Jul 2007 19:54:41 -0000 1.7
+++ CMakeFindBinUtils.cmake 15 Aug 2007 18:26:00 -0000 1.8
@@ -47,7 +47,17 @@
FIND_PROGRAM(CMAKE_LINKER NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ld PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH)
FIND_PROGRAM(CMAKE_LINKER NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ld)
- MARK_AS_ADVANCED(CMAKE_AR CMAKE_RANLIB CMAKE_STRIP CMAKE_LINKER)
+ FIND_PROGRAM(CMAKE_NM NAMES ${_CMAKE_TOOLCHAIN_PREFIX}nm PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH)
+ FIND_PROGRAM(CMAKE_NM NAMES ${_CMAKE_TOOLCHAIN_PREFIX}nm)
+
+ FIND_PROGRAM(CMAKE_OBJDUMP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objdump PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH)
+ FIND_PROGRAM(CMAKE_OBJDUMP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objdump)
+
+ FIND_PROGRAM(CMAKE_OBJCOPY NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objcopy PATHS ${_CMAKE_TOOLCHAIN_LOCATION} NO_DEFAULT_PATH)
+ FIND_PROGRAM(CMAKE_OBJCOPY NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objcopy)
+
+ MARK_AS_ADVANCED(CMAKE_AR CMAKE_RANLIB CMAKE_STRIP CMAKE_LINKER CMAKE_NM CMAKE_OBJDUMP CMAKE_OBJCOPY)
+
ENDIF("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"
OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
--- CMakeSystemWithToolchainFile.cmake.in DELETED ---
Index: CMakeDetermineSystem.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeDetermineSystem.cmake,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- CMakeDetermineSystem.cmake 10 Aug 2007 13:07:39 -0000 1.27
+++ CMakeDetermineSystem.cmake 15 Aug 2007 18:26:00 -0000 1.28
@@ -73,9 +73,10 @@
ENDIF(NOT _INCLUDED_TOOLCHAIN_FILE)
IF(_INCLUDED_TOOLCHAIN_FILE)
- SET(CMAKE_TOOLCHAIN_FILE "${_INCLUDED_TOOLCHAIN_FILE}")
+ SET(CMAKE_TOOLCHAIN_FILE "${_INCLUDED_TOOLCHAIN_FILE}" CACHE FILEPATH "The CMake toolchain file" FORCE)
ELSE(_INCLUDED_TOOLCHAIN_FILE)
MESSAGE(FATAL_ERROR "Could not find toolchain file: ${CMAKE_TOOLCHAIN_FILE}")
+ SET(CMAKE_TOOLCHAIN_FILE "NOTFOUND" CACHE FILEPATH "The CMake toolchain file" FORCE)
ENDIF(_INCLUDED_TOOLCHAIN_FILE)
ENDIF(CMAKE_TOOLCHAIN_FILE)
@@ -138,26 +139,16 @@
"The system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n")
ENDIF(PRESET_CMAKE_SYSTEM_NAME)
+ # if a toolchain file is used, it needs to be included in the configured file,
+ # so settings done there are also available if they don't go in the cache and in TRY_COMPILE()
+ SET(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED)
+ IF(DEFINED CMAKE_TOOLCHAIN_FILE)
+ SET(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED "INCLUDE(\"${CMAKE_TOOLCHAIN_FILE}\")")
+ ENDIF(DEFINED CMAKE_TOOLCHAIN_FILE)
- # if a toolchain file is used use configure_file() to copy it into the
- # build tree, because this way e.g. ${CMAKE_SOURCE_DIR} will be replaced
- # with its full path, and so it will also work when used in try_compile()
- IF (CMAKE_TOOLCHAIN_FILE)
-
- SET(_OWN_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY})
- CONFIGURE_FILE(${CMAKE_TOOLCHAIN_FILE}
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeToolchainFile.cmake)
-
- CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeSystemWithToolchainFile.cmake.in
+ # configure variables set in this file for fast reload, the template file is defined at the top of this file
+ CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeSystem.cmake.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake
IMMEDIATE @ONLY)
- ELSE (CMAKE_TOOLCHAIN_FILE)
-
- # configure variables set in this file for fast reload, the template file is defined at the top of this file
- CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeSystem.cmake.in
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake
- IMMEDIATE @ONLY)
-
- ENDIF (CMAKE_TOOLCHAIN_FILE)
ENDIF(CMAKE_BINARY_DIR)
More information about the Cmake-commits
mailing list