[CMake] how to link to the libsvm in cmake?

kdsfinger at gmail.com kdsfinger at gmail.com
Sat Oct 4 12:33:38 EDT 2008


hi, there
I want to use the libsvm library in c++ with cmake but it seems I did
not set it correct in the CMakeLists.txt.

Here is what I did in CMakeLists.txt:

ADD_DEFINITIONS(-Wall -O2)

#build a shared library
ADD_LIBRARY(svm SHARED mytoy.cpp)

#for testing the shared library you probably need some test app too
ADD_EXECUTABLE(svm mytoy.cpp)

#need to link to some other libraries ? just add them here
TARGET_LINK_LIBRARIES(svm ${SVM_LIBRARY})

In my program's header file, I have
#import <svm.h>

Yet, I got the error message when try to compile:
svm.h: no such file or directory

The svm library (develop version) has been installed correctly on the
ubuntu linux box. Please help. Have a good weekend.

zl2k


More information about the CMake mailing list