[CMake] MakeFile problem with TARGET_LINK_LIBRARIES and non-standard 3rd party dyn lib

fbonin.ext at orange-ftgroup.com fbonin.ext at orange-ftgroup.com
Thu Apr 10 12:09:40 EDT 2008


Hello,
 
I'm very new to cmake but i thing i found a problem :
 
I build cmakelist.txt files for target :
    1/ "Visual Studio 8 2005" projects using "Cmake 2.4-patch 8" on
Windows XP, i386
    2/ "XCode" projects using  "Cmake 2.4-patch 8" on Mac Os X 10.5,
i386
    3/ "Unix Makefiles"  makfiles using "Cmake 2.4-patch 8" on Mac Os X
10.5, i386
 
I use out of source cmake generation 
 
Let say i want to build a shared library called TEST that depend on
non-standard 3rd party shared library called "external"
 
To do so I could have wrote this cmakelist.txt :
------------------------------------------------------------------------
--------
 
PROJECT (TEST)
 
SET(TEST_MODULE_SRCS   "whatever.cpp")
SOURCE_GROUP(src FILES ${TEST_MODULE_SRCS})
 
SET(TEST_MODULE_HDRS"whatever.h")
SOURCE_GROUP(inc FILES ${TEST_MODULE_HDRS})
 
ADD_LIBRARY(TEST    SHARED  ${TEST_MODULE_SRCS}  ${TEST_MODULE_HDRS}

#add an External non-standard library depandency, located somewhere :
IF(WIN32)
 TARGET_LINK_LIBRARIES(
 TEST
 debug ${CMAKE_SOURCE_DIR}/path/to/debug/win32/External 
 optimized ${CMAKE_SOURCE_DIR}/path/to/release/win32/External  )
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
 TARGET_LINK_LIBRARIES(
 TEST
 debug ${CMAKE_SOURCE_DIR}/path/to/debug/darwin/i686/External 
 optimized ${CMAKE_SOURCE_DIR}/path/to/release/darwin/i686/External  )
ENDIF(WIN32)
------------------------------------------------------------------------
--------
 
this cmakelist.txt works well for "Visual Studio 8 2005" and "XCode"
targets
 
but for "Unix Makefiles" it generate a wrong dependancy rule that I
finaly found in "build.make" generated file :
 
"out_source_path/libTEST.dylib :
(...)/path/to/release/darwin/i686/External"
 
obviously, make don't now how to build
"(...)/path/to/release/darwin/i686/External"
 
And if comment out this line by myself, generate makefile works !
 
So, I think there is a generator problem here.
 
Franck Bonin
 
 
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080410/8c588cc9/attachment.htm>


More information about the CMake mailing list