From Luigi Calori, "when we link against something that comes out from a Find... we ususally have a variable <LINK_VAR_NAME>available like OPENTHREADS_LIBRARY,

so I' ve set up a macro that uses the variable name expanded for linking, and  test if a variable ${LINK_VAR_NAME}_DEBUG
like OPENTHREADS_LIBRARY_DEBUG exists and in case uses it for linking in debug mode.
I' ve also set up FindOpenThreads to set up these variables.
I had to edit the core libraries CMakeLists to add the calls to the macros used.
I' ve tested under MSVC"
This commit is contained in:
Robert Osfield
2007-03-26 13:02:38 +00:00
parent 7013c12a0d
commit b419fa93ef
14 changed files with 127 additions and 69 deletions

View File

@@ -72,20 +72,19 @@ ENDIF(WIN32)
TARGET_LINK_LIBRARIES(${LIB_NAME}
LINK_INTERNAL(${LIB_NAME}
osgGA
osgText
osgDB
osgUtil
osg
${OPENTHREADS_LIBRARY}
${OPENGL_LIBRARIES}
)
LINK_CORELIB_DEFAULT(${LIB_NAME})
IF(MINGW)
TARGET_LINK_LIBRARIES(${LIB_NAME}
LINK_EXTERNAL(${LIB_NAME}
gdi32
)
)
ENDIF(MINGW)
INCLUDE(ModuleInstall OPTIONAL)