[CMake] dependency on external libraries (and Visual Studio)

Kris Thielemans kris.f.thielemans at gmail.com
Thu Apr 20 20:03:01 EDT 2017


Hi

 

I have a project with a shared library that depends on some external static
libraries. Those are CMake imported targets. It appears that my shared
library does not get rebuild when the external libraries are updated. (It
would need to be relinked). Is this expected?

 

A bit more info on my set-up:

CMake 3.8.0

Visual Studio Community 2015

 

Some content of my CMakeLists.txt (the external libraries are set in
$(STIR_LIBRARIES}). Full project is on https://github.com/CCPPETMR/SIRF/

 

# static library depending on external

add_library(cstir cstir_p.cpp)

target_link_libraries(cstir ${STIR_LIBRARIES})

 

# shared library depending on external (probably not necessary as depends on
cstir already)

add_library(mstir SHARED mstir.c)

target_link_libraries(mstir  cstir ${STIR_LIBRARIES})

 

When checking the Visual Studio project, mstir has a "Reference" to cstir,
but neither of them refers to any of the externals.

 

Thanks

Kris

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170421/e74876bd/attachment.html>


More information about the CMake mailing list