[CMake] CMake and Clanlib

Nathan Huesken cmake at lonely-star.org
Sun May 11 11:32:13 EDT 2008


Hi,

I am completly new to cmake, I want to use it in a project, where I also use ClanLib.
What I did:
I downloaded http://www.cmake.org/Wiki/CMakeUserFindClanLib into
ClanLibConfig.cmake

This is my CMakeLists.txt:
SET(sources main.cc)
SET(ClanLib_DIR /home/ls/Project/)
FIND_PACKAGE(ClanLib)
INCLUDE_DIRECTORIES(${ClanLib_INCLUDE_DIR})
ADD_EXECUTABLE(schueler ${sources})
TARGET_LINK_LIBRARIES(schueler ${ClanLib_LIBRARY})

The line SET(ClanLib_DIR /home/ls/Project/) sets ClanLib_DIR to the directory of ClanLibConfig.cmake.
Unfortantly this setup does not find the ClanLib library.
My questions:

1. What am I doing wrong?
2. How can I set ClanLib_DIR to the current directory? "." does not work
3. How can I make CMake stop with an error if it does not find ClanLib?

Thanks!
Nathan


More information about the CMake mailing list