[cmake-commits] king committed eCos.cmake 1.3 1.4
cmake-commits at cmake.org
cmake-commits at cmake.org
Mon Feb 11 17:01:04 EST 2008
Update of /cvsroot/CMake/CMake/Modules/Platform
In directory public:/mounts/ram/cvs-serv29622/Modules/Platform
Modified Files:
eCos.cmake
Log Message:
ENH: Fix eCos.cmake to not require a forced compiler
- Search for libtarget.a explicitly
- Do not complain about compiler id during try-compile
Index: eCos.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/Platform/eCos.cmake,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- eCos.cmake 17 Jan 2008 20:54:49 -0000 1.3
+++ eCos.cmake 11 Feb 2008 22:01:02 -0000 1.4
@@ -20,27 +20,29 @@
INCLUDE(Platform/UnixPaths)
# eCos can be built only with gcc
-IF(CMAKE_C_COMPILER AND NOT "${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
- MESSAGE(FATAL_ERROR "GNU gcc is required for eCos")
-ENDIF(CMAKE_C_COMPILER AND NOT "${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
-IF(CMAKE_CXX_COMPILER AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
+GET_PROPERTY(_IN_TC GLOBAL PROPERTY IN_TRY_COMPILE)
+IF(CMAKE_C_COMPILER AND NOT "${CMAKE_C_COMPILER_ID}" MATCHES "GNU" AND NOT _IN_TC)
MESSAGE(FATAL_ERROR "GNU gcc is required for eCos")
-ENDIF(CMAKE_CXX_COMPILER AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
+ENDIF(CMAKE_C_COMPILER AND NOT "${CMAKE_C_COMPILER_ID}" MATCHES "GNU" AND NOT _IN_TC)
+IF(CMAKE_CXX_COMPILER AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" AND NOT _IN_TC)
+ MESSAGE(FATAL_ERROR "GNU g++ is required for eCos")
+ENDIF(CMAKE_CXX_COMPILER AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" AND NOT _IN_TC)
-# this is a header which is part of every eCos "installation"
-# it would be better to search for libtarget.a, but this isn't possible
-# at this point in the setup process, since CMAKE_SIZEOF_VOID_P is still
-# unknown, which is used in FIND_LIBRARY()
+# find eCos system files
FIND_PATH(ECOS_SYSTEM_CONFIG_HEADER_PATH NAMES pkgconf/system.h)
+FIND_LIBRARY(ECOS_SYSTEM_TARGET_LIBRARY NAMES libtarget.a)
IF(NOT ECOS_SYSTEM_CONFIG_HEADER_PATH)
MESSAGE(FATAL_ERROR "Could not find eCos pkgconf/system.h. Build eCos first and set up CMAKE_FIND_ROOT_PATH correctly.")
ENDIF(NOT ECOS_SYSTEM_CONFIG_HEADER_PATH)
-GET_FILENAME_COMPONENT(ECOS_LIBTARGET_DIRECTORY "${ECOS_SYSTEM_CONFIG_HEADER_PATH}" PATH)
+IF(NOT ECOS_SYSTEM_TARGET_LIBRARY)
+ MESSAGE(FATAL_ERROR "Could not find eCos \"libtarget.a\". Build eCos first and set up CMAKE_FIND_ROOT_PATH correctly.")
+ENDIF(NOT ECOS_SYSTEM_TARGET_LIBRARY)
+
+GET_FILENAME_COMPONENT(ECOS_LIBTARGET_DIRECTORY "${ECOS_SYSTEM_TARGET_LIBRARY}" PATH)
INCLUDE_DIRECTORIES(${ECOS_SYSTEM_CONFIG_HEADER_PATH})
ADD_DEFINITIONS(-D__ECOS__=1 -D__ECOS=1)
-SET(ECOS_LIBTARGET_DIRECTORY "${ECOS_LIBTARGET_DIRECTORY}/lib")
# special link commands for eCos executables
SET(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -nostdlib -nostartfiles -L${ECOS_LIBTARGET_DIRECTORY} -Ttarget.ld <LINK_LIBRARIES>")
More information about the Cmake-commits
mailing list