[CMake] Adding a compiled library into a Cmake based project

nadine kempe n.kempe at gmx.net
Tue Oct 16 17:26:40 EDT 2007


Hello,

I currently try to expand an existing Camke based C++ project. For this, I have to use a library which I have only compiled, that means I have only the header-files and the .so libraryfile.

Unfortunately I can hardly find any instructions for it.

I tried to insert the following into the CmakeLists.txt: (msml is the name of the library and /usr/local/include/msml the path to the header)

INCLUDE_DIRECTORIES(/usr/local/include/msml)
FIND_LIBRARY(LIB_VAR “msml” [/usr/local/lib])
LINK_LIBRARIES("msml")

But this gives me the follwoing error:  (GoSPect is the name of the project)

gmake[1]: *** [CMakeFiles/GOSPECT_EXE.dir/all] Fehler 2
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/local/lib/libmsml.so when searching for -lmsml
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/local/lib/libmsml.a when searching for -lmsml
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: cannot find -lmsml
collect2: ld returned 1 exit status


As I am a beginner with Cmake, I do not really know where in the CmakeLists.txt I have to insert the code.

(Btw: I am running a openSUSE 10.2 (X86-64) on a AMD 64 bit, including the  32bit runtimenvironment)


Can anybody maybe help me?

Thanks!
Nadine

-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer


More information about the CMake mailing list