ariasg...@gmx.de wrote:
Hello,
I have some code that uses some libs in the following defined vars:

# -------------------------------------------------------------------------
# Add everything into executable
# -------------------------------------------------------------------------
ADD_LIBRARY(${PROJECTNAME1} ${sources} ${includes} ${vectors} )

# ----------------------------------------------------------------------------
# Link libraries
# ----------------------------------------------------------------------------
TARGET_LINK_LIBRARIES ( ${PROJECTNAME1} ${OPENSCENEGRAPH_LIBRARIES}
                        ${OSG_LIBRARY}
)

If I build this as a shared library (e.g. DLL) I can see in the linker settings 
all mentioned libraries with TARGET_LINK_LIBRARIES, that is fine.
But when I build a static library, none of the linked libraries occur in the 
/IMPLIB dialog. To be precisely they occur nowhere! So where do they vanish?
I am quite desperate about that.


Static libraries do not link to other static libraries. However, CMake will automatically use them for executables.

add_executable(foo ${foo_sources})
target_link_libraries(foo ${PROJECTNAME1})

Then foo will link to all the libraries you listed (${OPENSCENEGRAPH_LIBRARIES} ${OSG_LIBRARY}.

-Bill
_______________________________________________
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 the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to