[CMake] Link different libraries in different targets

2013-04-02 Thread domenico
Hi there ! I'm quite new to CMake, so please forgive me if the question seems obvious. My project has lines like : link_directories(/path/to/libA/) add_library(my_project SHARED my_file.cpp) target_link_libraries(my_project A) I browsed help and googled a few, but I still wonder how I could set

Re: [CMake] Link different libraries in different targets

2013-04-02 Thread Leif Walsh
A few ideas: Set the targets' LINK_FLAGS separately to specify the linker dirs.  Use target_link_libraries on the file path rather than the lib name.  Make an imported library target for the libs in each dir and then link with those targets. (I'm assuming these are not libs you're building)

Re: [CMake] Link different libraries in different targets

2013-04-02 Thread Ansis Māliņš
Just add more link_directories commands or put more arguments in the one your have: link_directories(/path/to/libA path/to/libB) -- 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

Re: [CMake] Link different libraries in different targets

2013-04-02 Thread Matthew Woehlke
On 2013-04-02 12:08, domenico wrote: I'm quite new to CMake, so please forgive me if the question seems obvious. My project has lines like : link_directories(/path/to/libA/) add_library(my_project SHARED my_file.cpp) target_link_libraries(my_project A) I browsed help and googled a few, but I