[CMake] my lib path

Mathias Hoffmann spam.me at gmx.info
Sat Aug 28 13:19:14 EDT 2010


Dear all,

I'm a cmake-beginner and my problem is to avoid the application of a system library.

It exist a hdf5 installation in the system /usr/lib and in my home directory, but if I set in my CMakeLists.txt something like [1] nothing is happend, i.e. the system libs are still used. :(

Thanks for help!


[1]

SET(HDF5_PATHS "/home/test/install/gcc/hdf5-1.8.4_serial_v16")

FIND_LIBRARY(HDF5_LIBRARY hdf5 ${HDF5_PATHS}/lib  NO_DEFAULT_PATH )

FIND_PATH(HDF5_INCLUDE_DIR hdf5.h ${HDF5_PATHS}/include NO_DEFAULT_PATH NO_CMAKE_SYSTEM_PATH)

SET(EXTRA_LIBS ${HDF5_LIBRARY})

ADD_EXECUTABLE(vibrating_string main.cpp)

target_link_libraries(vibrating_string ${EXTRA_LIBS})


More information about the CMake mailing list