[CMake] Linking directories on a "sub" CMakeLists

Xavier Larrode Xavier.Larrode at irisa.fr
Tue Aug 22 10:50:31 EDT 2006


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 compilation is ok but at the linking part, it is still using 
CMAKE_CXX_FLAGS and not -L to add linking dir.

I'm on Linux Fedora core 4 with cmake 2.4
here is my log :

Linking CXX shared library ../../../../../lib/libPieMenu.so
cd 
/local/xlarrode/gvt/gvtCoetmieux/src/common/share/openMASKUtilities/pieMenu 
&& /local/xlarrode/soft/cmake/bin/cmake -P 
CMakeFiles/PieMenu.dir/cmake_clean_target.cmake
cd 
/local/xlarrode/gvt/gvtCoetmieux/src/common/share/openMASKUtilities/pieMenu 
&& /usr/bin/c++  -fPIC 
-I/local/xlarrode/soft/4.02/shareOMKBunraku/include -ftemplate-depth-50 
-Wno-deprecated -I/local/xlarrode/soft/4.02/shareOSGBunraku/include 
-DOSG_WITH_GLUT -D_OSG_HAVE_CONFIGURED_H_ -D_USE_OSG  -shared 
-Wl,-soname,libPieMenu.so -o ../../../../../lib/libPieMenu.so 
"CMakeFiles/PieMenu.dir/PsvLeaderPartner.o" 
"CMakeFiles/PieMenu.dir/PieUnit.o" "CMakeFiles/PieMenu.dir/PieButton.o"  
-lRelationPosition -lOMKInputHandler
/usr/bin/ld: ne peut trouver -lRelationPosition

The complete CMakeLists is here : 
http://www.irisa.fr/siames/xlarrode/CMakeLists.txt

Thanks all.




-------------- 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/02283492/Xavier.Larrode-0001.vcf


More information about the CMake mailing list