[CMake] LINK_DIRECTORIES gives errors

abhijeet mhatre abhijeetmhatre at yahoo.com
Tue May 29 10:08:48 EDT 2007


Hi  list
  I am using cmake as a tool for generating Linux makefiles.

I read the documentation and made a CmakeLists.txt file.
but when I do a cmake . , I get  errors

here is the CmakeLists.txt file 
----------------------
PROJECT(myproject)
SET_TARGET_PROPERTIES(HelloWorld PROPERTIES LINKER_LANGUAGE CXX)
INCLUDE_DIRECTORIES(../dcmtk-3.5.4/dcmnet/apps  ../dcmtk-3.5.4/dcmnet/include ../dcmtk-3.5.4/dcmdata/include ../dcmtk-3.5.4/dcmdata ../dcmtk-3.5.4/ofstd/include ../dcmtk-3.5.4/config/include)
ADD_DEFINITIONS(-DHAVE_CONFIG_H -DNDEBUG -D_REENTRANT -D_XOPEN_SOURCE_EXTENDED -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_BSD_COMPAT -D_OSF_SOURCE -D_POSIX_C_SOURCE=199506L)
LINK_DIRECTORIES(../dcmtk-3.5.4/dcmnet/libsrc ../dcmtk-3.5.4/dcmdata/libsrc ../dcmtk-3.5.4/ofstd/libsrc ../dcmtk-3.5.4/dcmtls/libsrc)
TARGET_LINK_LIBRARIES(HelloWorld dcmnet dcmdata ofstd z wrap dcmtls dl m rt pthread nsl)
ADD_EXECUTABLE(HelloWorld HelloWorld.cpp)
--------------------

and here are the errors
--------------------
CMake Error: Attempt to add link library "dcmnet" to target "HelloWorld" which is not built by this project.
CMake Error: Attempt to add link library "dcmdata" to target "HelloWorld" which is not built by this project.
....
---------------------

Agreed that I am linking to a library that's not built by CMake. But shouldn't I be allowed to do it?

Could anyone please help me on this.
I am using cmake version 2.4-patch 6 on Fedora Core 6

Regards
Abhijeet



 
---------------------------------
Food fight? Enjoy some healthy debate
in the Yahoo! Answers Food & Drink Q&A.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20070529/e26280d6/attachment.htm


More information about the CMake mailing list