[Cmake] Some problems

David Svoboda xsvobod2 at informatics . muni . cz
Wed, 18 Jun 2003 12:13:20 +0200


Hello,

I'm sorry, but I'm begginer in using CMake package. Here are some
questions, I'm not able to answer them:

******
1. Built in options and string variables in Cache file can be implicitly
changed by setting something like the following code:

  OPTION(CMAKE_VERBOSE_MAKEFILE "Tracing the compilation process" ON)

but before typing the keyword PROJECT(<name of the project>). When setting
this after PROJECT keyword, it doesn't work. Why?

******
2. I've been developing library. The root CMakeLists.txt file looks like:

PROJECT(<name of project>)
SET(LIBRARY_NAME i3d)
SUBDIRS(src examples)

In the src/CMakeLists.txt the shared library is built with using the
keyword TARGET_LINK_LIBRARIES(${LIBRARY_NAME} <needed libs>) to link the
neccesary libs to the result.

In the examples/CMakeLists.txt the samples are build using the keywords

LINK_LIBRARIES(${LIBRARY_NAME})
ADD_EXECUTABLE(example1 example1.cc)
ADD_EXECUTABLE(example2 example2.cc)

When linking the examples, the libraries used for linking library
${LIBRARY_NAME} are linked to these examples as well. Why? How to avoid
this?


-David