[CMake] link problem with a name changed target

Ingrid Kemgoum ingrid.kemgoum at gmail.com
Thu Aug 21 09:27:36 EDT 2008


HI,
i'm building a project with 3 targets in Linux. each target has a different
name when in debug.

the executable i want to link to the 2 libraries fail to find thoz libs when
i'm in debug (not the case in release, everything's good).

here is the CMakeLists of the executable


cmake_minimum_required(VERSION 2.6)
include_directories (${ORIGIN}/tst_xsystem/../../../import/xdefaut/inc
${ORIGIN}/tst_xsystem/../../../inc
${ORIGIN}/tst_xsystem/../../../imports/xdefaut/inc )
set(sources ${ORIGIN}/tst_xsystem/../../../src/tst_xsystem.c
${ORIGIN}/tst_xsystem/../../../imports/xdefaut/inc/x_defaut.h)
if (CMAKE_HOST_WIN32)
  set (sources ${sources} ${ORIGIN}/tst_xsystem/tst_xsystem.rc)
endif(CMAKE_HOST_WIN32)
if (CMAKE_HOST_UNIX)
  set (sources ${sources} ${DEST}/tst_xsystem/tst_xsystem.c)
endif(CMAKE_HOST_UNIX)
add_executable(tst_xsystem ${sources})
add_dependencies(tst_xsystem  libxsystem libxsystem_so)


if (${CONFIG} MATCHES "DEBUG")
 target_link_libraries(tst_xsystem libxsystemd_so libxsystemd pthread rt dl
nsl) ###########"
else(${CONFIG} MATCHES "DEBUG")
 target_link_libraries(tst_xsystem libxsystem_so libxsystem pthread rt dl
nsl)
endif(${CONFIG} MATCHES "DEBUG")
set_target_properties(tst_xsystem PROPERTIES
 PREFIX ""
 DEBUG_OUTPUT_NAME "tst_xsystemd"
 LINKER_LANGUAGE "CXX"
 LINK_FLAGS_RELEASE ${linkexecutablerel}
)


the problem is in the red line (marqued ########).
names are differents and the error is

Linking CXX executable
/home/ikemgoum/workspace/reference/xsystem/code/os/linux_redhatEL4_0_i386__gcc3_4/bin/tst_xsystemd
/usr/bin/ld: can not find -llibxsystemd

am i missing something?
thanks for help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080821/e4e2130d/attachment.htm>


More information about the CMake mailing list