I trying to support multiple configurations in a single binary directory (in my
case for MSVC 2010) and ran into a situation that I'm not sure how to tackle.
I have a library target which links against OpenSceneGraph. If OpenSceneGraph
is not found, that target and everything that depends on it is not built since
the 3D GUI is optional.
CMake snippet:
FIND_PACKAGE ("OpenSceneGraph")
IF (OPENSCENEGRAPH_FOUND)
INCLUDE_DIRECTORIES (${OPENSCENEGRAPH_INCLUDE_DIRS})
ADD_LIBRARY (LtfSceneBuilder ${SOURCES})
TARGET_LINK_LIBRARIES (LtfSceneBuilder
${OPENSCENEGRAPH_LIBRARIES})
INSTALL (TARGETS LtfSceneBuilder RUNTIME DESTINATION bin
LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
ENDIF ()
With a multi-configuration build it is possible for Debug OSG to be found and
not Release (or vice-versa) and I would like to support that case if possible.
Since this is Windows and OSG is heavy on memory allocation across DLL
boundaries, it is not a good thing to mix and match Release and Debug. Is
there a way to add my library target only for a specific configuration based on
whether the appropriate OSG libraries for that configuration were found? I
know the MSVC IDE has a way of setting projects to be built only in certain
configurations but I am not sure if there is a way to do it from CMake and, if
so, whether it plays nicely with INSTALL.
Currently if only Debug OSG is found, CMake generation fails due to NOT_FOUND
values for the Release OSG libraries being referenced by the MSVC project. If
only Release OSG is found, CMake generation succeeds and the Debug build links
against Release OSG libraries.
Ideas?
Thanks,
Gregory Peele, Jr.
Senior Scientist
Applied Research Associates, Inc.
Central Florida Division
_______________________________________________
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