[CMake] ELSEIF? ...is or is not implemented?

Kishore, Jonnalagadda (IE10) Kishore.Jonnalagadda at honeywell.com
Wed Apr 4 13:07:44 EDT 2007


> -----Original Message-----
> From: cmake-bounces+kishore.jonnalagadda=honeywell.com at cmake.org
> [mailto:cmake-bounces+kishore.jonnalagadda=honeywell.com at cmake.org] On
> Behalf Of Matthew Woehlke
> Sent: Wednesday, April 04, 2007 10:15 PM
> To: cmake at cmake.org
> Subject: [CMake] ELSEIF? ...is or is not implemented?
> 
> I found this:
> http://www.cmake.org/pipermail/cmake/2006-September/011115.html
> 
> There is also mention of 'ELSEIF' in the CMake manpage (2.4.6), but it
> doesn't seem to work. Was this implemented? If yes, can someone give a
> simple example of using it? If no, why does the manpage mention it?

I does work with 2.4.6. Here is an example of how it is meant to be
used:

IF(${TOOLCHAIN} STREQUAL "GCC")
	MESSAGE(STATUS "setting the C compiler to m68k-elf-gcc")
	ENABLE_CROSSCOMPILE()
	SET(CMAKE_C_COMPILER m68k-elf-gcc CACHE INTERNAL "" FORCE)
	SET(CMAKE_CXX_COMPILER m68k-elf-g++ CACHE INTERNAL "" FORCE)
	SET(CMAKE_AR m68k-elf-ar  CACHE INTERNAL "" FORCE)
	SET(CMAKE_RANLIB m68k-elf-ranlib  CACHE INTERNAL "" FORCE)
	SET(CMAKE_C_COMPILER_IS_GNUC 1  CACHE INTERNAL "" FORCE)
	SET(CMAKE_CXX_COMPILER_IS_GNUCXX 1  CACHE INTERNAL "" FORCE)
	SET(ARCH_COMPILE_FLAGS "-DUINT_SIZE=32 -m5206e")
	SET(CMAKE_C_FLAGS "${ARCH_COMPILE_FLAGS} ${PLATFORM_C_FLAGS}"
CACHE STRING "" FORCE)
	SET(CMAKE_CXX_FLAGS "${ARCH_COMPILE_FLAGS}
${PLATFORM_CXX_FLAGS}" CACHE STRING "" FORCE)
ELSEIF(${TOOLCHAIN} STREQUAL "METROWERKS")
	MESSAGE(FATAL_ERROR "The toolchain METROWERKS is not supported
for the m68k architecture.
	Supported toolchains are GCC.")
ENDIF(${TOOLCHAIN} STREQUAL "GCC")

Warm regards,
Kishore


More information about the CMake mailing list