e...@cs.bgu.ac.il wrote:


thanks for the tip though but my current problem is in regards to the
linking of external libs, I've used to add them to the
TARGET_LINK_LIBRARIES but it was suggested here not to use it in that
way.
OK, I think I see the problem. For external libraries, you should use find_library and link them in the target_link_libraries. For internal(things built by CMake), you should just use the name.

For example

add_library(foo SHARED foo.c)
find_library(BAR_LIB bar)  # find path to bar
target_link_libraries(foo ${BAR_LIB}) # link bar to foo
add_executable(car car.c)
target_link_libraries(car foo) # this will link foo and bar to car

-Bill
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to