[CMake] problem with export(TARGETS ...)

Clinton Stimpson clinton at elemtech.com
Thu Jan 27 15:08:55 EST 2011


I have this snippet of cmake code:

add_library(A SHARED a.cpp)
add_library(B SHARED b.cpp)
target_link_libraries(B A)
set_target_properties(B PROPERTIES LINK_INTERFACE_LIBRARIES "")
export(TARGETS B FILE B-exports.cmake)

that gives me an error 
"export called with target "B" which requires target "A" that is not in the
  export list."


If I change A to be a static library, the error goes away.
If I change A to be a static library, and don't set the 
LINK_INTERFACE_LIBRARIES property on B, I get the error.

I don't want to export private shared libraries.  Is there some other property 
like LINK_INTERFACE_LIBRARIES that I need to set?

-- 
Clinton Stimpson
Elemental Technologies, Inc
Computational Simulation Software, LLC
www.csimsoft.com


More information about the CMake mailing list