[Insight-developers] Building application with CMake

Luis Ibanez ibanez@choroid.cs.unc.edu
Thu, 5 Apr 2001 11:18:27 -0400 (EDT)


Hi,

I'm building an application using CMake.
The application is composed by a set of 6
.cxx files. I'm creating a library with 5
of them, and using the last one as the
main code for the application.

The problem is that CMake put the LINK_LIBRARIES
on the library project as well as in the
executable project.  Thats make the librarian
to try to insert the whole content of ITK libs
in the target library.

Is there a way to indicate that the LINK_LIBRARIES
should only be used in the project for the executable
and ignored in the project for the lib ?


Thanks


Luis




============================================

The CMakeList.txt file looks like:

INCLUDE_DIRECTORIES(
${ITK_SOURCE_DIR}/Code/Common
...
)

LINK_DIRECTORIES(
${ITK_BINARY_DIR}/Code/Common
...
)

SOURCE_FILES(
file1
file2
...
)

LIBRARY(
GaussianFilterLib
)

LINK_LIBRARIES(
VXLNumerics
ITKCommon
ITKBasicFilters
MetaImageIO
)

UNIX_LIBRARIES(
-lm
)

EXECUTABLE(GaussianFilter)


======================================