[CMake] How to use lib from include_external_msproject

Howard Rubin howard.rubin at hl.konicaminolta.us
Thu Aug 20 11:33:51 EDT 2015


I have a C++/CLI LIB (and DLL) that I generate with
include_external_msproject. I need to link to it from my C++ project, which
I'm trying to do with target_link_libraries. This gives the below error
message. Since I'm not creating it with add_library I don't see how to
indicate it's a shared lib.

 

How can I indicate the lib is a SHARED lib, or otherwise link to it in a
CMake project?

 

 

CMake Error at modules/PptxWriterCpp/sample/CMakeLists.txt:4
(target_link_libraries):

  Target "PptxWriterCpp" of type UTILITY may not be linked into another

 target.  One may link only to STATIC or SHARED libraries, or to executables

  with the ENABLE_EXPORTS property set.

 

References:

http://stackoverflow.com/questions/6399493/what-is-cli-c-exactly-how-does-it
-differ-from-normal-c

 

http://www.cmake.org/cmake/help/v2.8.10/cmake.html#command:include_external_
msproject

 

http://www.cmake.org/cmake/help/v2.8.10/cmake.html#command:target_link_libra
ries

 

http://www.cmake.org/cmake/help/v2.8.10/cmake.html#command:add_library

 

 

 

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


More information about the CMake mailing list