From Mourad Boufarguine, "Some others modified CMake scripts :

- OsgMacroUtils.cmake, SETUP_LINK_LIBRARIES macro : allow linking with debug/release external libraries
- osgQt/CMakeLists.txt : fix the linking to Qt librairies + linking to debug Qt librairies if found
- examples/ qt examples :  linking to debug Qt librairies if found"
This commit is contained in:
Robert Osfield 2010-03-05 12:43:03 +00:00
parent 5383297cbe
commit 3cd0c50df3
5 changed files with 8 additions and 7 deletions

View File

@ -109,9 +109,10 @@ MACRO(SETUP_LINK_LIBRARIES)
# TARGET_LINK_LIBRARIES(${TARGET_TARGETNAME} optimized ${LINKLIB} debug "${LINKLIB}${CMAKE_DEBUG_POSTFIX}") # TARGET_LINK_LIBRARIES(${TARGET_TARGETNAME} optimized ${LINKLIB} debug "${LINKLIB}${CMAKE_DEBUG_POSTFIX}")
# ENDFOREACH(LINKLIB) # ENDFOREACH(LINKLIB)
LINK_INTERNAL(${TARGET_TARGETNAME} ${TARGET_LIBRARIES}) LINK_INTERNAL(${TARGET_TARGETNAME} ${TARGET_LIBRARIES})
FOREACH(LINKLIB ${TARGET_EXTERNAL_LIBRARIES}) # FOREACH(LINKLIB ${TARGET_EXTERNAL_LIBRARIES})
TARGET_LINK_LIBRARIES(${TARGET_TARGETNAME} ${LINKLIB}) # TARGET_LINK_LIBRARIES(${TARGET_TARGETNAME} ${LINKLIB})
ENDFOREACH(LINKLIB) # ENDFOREACH(LINKLIB)
TARGET_LINK_LIBRARIES(${TARGET_TARGETNAME} ${TARGET_EXTERNAL_LIBRARIES})
IF(TARGET_LIBRARIES_VARS) IF(TARGET_LIBRARIES_VARS)
LINK_WITH_VARIABLES(${TARGET_TARGETNAME} ${TARGET_LIBRARIES_VARS}) LINK_WITH_VARIABLES(${TARGET_TARGETNAME} ${TARGET_LIBRARIES_VARS})
ENDIF(TARGET_LIBRARIES_VARS) ENDIF(TARGET_LIBRARIES_VARS)

View File

@ -2,7 +2,7 @@ SET(TARGET_SRC
osgQtBrowser.cpp osgQtBrowser.cpp
) )
SET(TARGET_EXTERNAL_LIBRARIES ${QT_QTCORE_LIBRARY_RELEASE} ${QT_QTGUI_LIBRARY_RELEASE} ${QT_QTOPENGL_LIBRARY_RELEASE} ${QT_QTWEBKIT_LIBRARY_RELEASE}) SET(TARGET_EXTERNAL_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${QT_QTWEBKIT_LIBRARY})
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR})
SET(TARGET_ADDED_LIBRARIES osgWidget osgQt) SET(TARGET_ADDED_LIBRARIES osgWidget osgQt)

View File

@ -5,7 +5,7 @@ SET(TARGET_SRC
) )
IF (QT4_FOUND) IF (QT4_FOUND)
SET(TARGET_EXTERNAL_LIBRARIES ${QT_QTCORE_LIBRARY_RELEASE} ${QT_QTGUI_LIBRARY_RELEASE} ${QT_QTOPENGL_LIBRARY_RELEASE} ) SET(TARGET_EXTERNAL_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} )
ADD_DEFINITIONS(-DUSE_QT4) ADD_DEFINITIONS(-DUSE_QT4)
ELSE(QT4_FOUND) ELSE(QT4_FOUND)
SET(TARGET_EXTERNAL_LIBRARIES ${QT_LIBRARIES} ) SET(TARGET_EXTERNAL_LIBRARIES ${QT_LIBRARIES} )

View File

@ -29,7 +29,7 @@ SET(TARGET_SRC
) )
IF (QT4_FOUND) IF (QT4_FOUND)
SET(TARGET_EXTERNAL_LIBRARIES ${QT_QTCORE_LIBRARY_RELEASE} ${QT_QTGUI_LIBRARY_RELEASE} ${QT_QTOPENGL_LIBRARY_RELEASE} ) SET(TARGET_EXTERNAL_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} )
ADD_DEFINITIONS(-DUSE_QT4) ADD_DEFINITIONS(-DUSE_QT4)
ELSE(QT4_FOUND) ELSE(QT4_FOUND)
SET(TARGET_EXTERNAL_LIBRARIES ${QT_LIBRARIES} ) SET(TARGET_EXTERNAL_LIBRARIES ${QT_LIBRARIES} )

View File

@ -41,7 +41,7 @@ LINK_INTERNAL(${LIB_NAME}
OpenThreads OpenThreads
) )
SET(TARGET_EXTERNAL_LIBRARIES ${QT_QTCORE_LIBRARY_RELEASE} ${QT_QTGUI_LIBRARY_RELEASE} ${QT_QTOPENGL_LIBRARY_RELEASE} ${QT_QTWEBKIT_LIBRARY_RELEASE}) TARGET_LINK_LIBRARIES(${LIB_NAME} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${QT_QTWEBKIT_LIBRARY})
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR})
LINK_CORELIB_DEFAULT(${LIB_NAME}) LINK_CORELIB_DEFAULT(${LIB_NAME})