[CMake] Linking directories on a "sub" CMakeLists

Xavier Larrode Xavier.Larrode at irisa.fr
Tue Aug 22 11:09:35 EDT 2006


Hi Brad and thanks, it seems better.
But now i have this error :
 Error: Attempt to add link library "RelationPosition" to target 
"PieMenu" which is not built by this project.

What's wrong with that ?
should i add the library differently ?
Thanks

Brad King a écrit :
> Xavier Larrode wrote:
>   
>> Hi all
>> i'm using cmake to compile lots of different libs, with ADD_SUBDIRECTORY...
>> And i've got a problem with a "sub" CMakeLists and linking my new lib
>> with other libs.
>>
>> my CMakeLists :
>> [...]
>> SET(INSTALL_LIB_HOME  ${GVTROOTDIR}/lib)
>> LINK_DIRECTORIES(${INSTALL_LIB_HOME})
>> TARGET_LINK_LIBRARIES(PieMenu
>>  RelationPosition
>>  OMKInputHandler)
>> SET(CMAKE_CXX_FLAGS "${OMK_CFLAGS}")
>>     
>
> The LINK_DIRECTORIES command must appear before the ADD_* command for
> the target that needs the link directories.  CMAKE_CXX_FLAGS works
> differently by applying the final value of the variable in the directory
> where the ADD_* command appeared.  This inconsistency is historical, so
> by convention you should set CMAKE_CXX_FLAGS before the ADD_* commands too.
>
> -Brad
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>   

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Xavier.Larrode.vcf
Type: text/x-vcard
Size: 169 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/cmake/attachments/20060822/52e37ac2/Xavier.Larrode.vcf


More information about the CMake mailing list