Hi, I try the following to install an imported dll:

ADD_LIBRARY(Foo SHARED IMPORTED)
SET_TARGET_PROPERTIES(Foo PROPERTIES IMPORTED_LOCATION "C:/FooLocation/Foo.dll")
INSTALL(TARGETS Foo RUNTIME DESTINATION bin)

and I get the following error:

install TARGETS given target "Foo" which does not exist in this directory

When looking into the cmake source code, it seems that INSTALL(TARGETS
...) does not look for imported targets (it uses
cmMakefile::FindTarget and not cmMakefile::FindTargetToUse).

Is it the expected behaviour? If yes what is the prefered way to
include an imported DLL in an install? A typical use case is when
importing a library built using cmake and the INSTALL(EXPORT ...)
command (generated cmakes contain ADD_LIBRARY(xxx SHARED IMPORTED)
commands)

Thanks,
Clément Sommelet
_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to