[CMake] porting to cmake 2.6 from 2.4.6

Pau Garcia i Quiles pgquiles at elpauer.org
Thu Jun 19 02:29:00 EDT 2008


Quoting David Blado <dblado at decarta.com>:

> Hi all,
>
> I recently took up the task of porting to 2.6 (again…fell off my   
> plate for a while ☺ )
>
> I’m seeing this when running cmake:
> CMake Error: Cannot determine link language for target "libraryX".
>
> All of the source files listed are cpp files:
> SET(SRCS
>   fileA
> )
>
> fileA is really fileA.cpp but I’ve noticed that I can ignore the   
> .cpp extension and CMake will find it.
>
> I’m building an so:
> SET(BUILD_SHARED_LIBS ON)
>
> And using: ADD_LIBRARY(${LIB_NAME} ${SRCS})
>
> Any idea why CMake 2.6 is all of a sudden requesting that I use:   
> SET_TARGET_PROPERTIES(XYZ PROPERTIES LINKER_LANGUAGE CXX) when it   
> never did w/ CMake 2.4.x?

Try SET_SOURCE_FILE_PROPERTIES( fileA PROPERTIES LANGUAGE CXX ). It's  
backwards-compatible with 2.4.x, BTW.

-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)



More information about the CMake mailing list