[CMake] Problem with shared libraries

Marco Spatz marco.spatz at icido.de
Wed Sep 14 07:15:39 EDT 2005


Hi,

we're using CMake since version 1.8.3. Actually, we're using CMake 
2.0.6, but I had to switch to 2.2.0 because 2.0.6 doesn't seem to 
provide a KDevelop3 generator. So I switched and started to use 2.2.0., 
but it seems that the CMakeFiles aren't 100% compatible.

Here's some sample code

/*******************code***************************/
LINK_DIRECTORIES(${IDO_SOURCE_DIR}/bin/linux/${INSTALL_PATH})
	
ADD_EXECUTABLE(idoCheckLicense ${IDO_CHECK_LICENSE_SRC})
	
SET (EXECUTABLE_OUTPUT_PATH ${IDO_SOURCE_DIR}/bin/linux/${INSTALL_PATH})
	
TARGET_LINK_LIBRARIES(idoCheckLicense dl pthread IDOBase)	

ADD_DEPENDENCIES(idoCheckLicense IDOBase)
/*******************code***************************/

IDOBase is an existing shared library located in the path 
LINK_DIRECTORIES is set to. But during linking I get the following error 
message:

gmake[2]: *** No rule to make target »install/debug/plugins/libIDOBase.so«,
needed by »install/debug/plugins/idoCheckLicense«


But if I change the line

TARGET_LINK_LIBRARIES(idoCheckLicense dl pthread IDOBase)

to

TARGET_LINK_LIBRARIES(idoCheckLicense dl pthread libIDOBase.so)

everthing works fine. But I don't want to step through the whole project 
and change every single cmake file if it isn't necessary.

Is this a bug in cmake? Or is there some error in my code?


Thx,
Marco


More information about the CMake mailing list