Changed: #842 Added ability to toggle support for STLport builds - note untested!

This commit is contained in:
mattraykowski 2010-07-23 10:51:02 -06:00
parent c19d153b25
commit ebd4220962
3 changed files with 97 additions and 1 deletions

View file

@ -68,6 +68,11 @@ NL_SETUP_PREFIX_PATHS()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
#Platform specifics #Platform specifics
IF(WITH_STLPORT)
FIND_PACKAGE(STLport REQUIRED)
INCLUDE_DIRECTORIES(${STLPORT_INCLUDE_DIR})
ENDIF(WITH_STLPORT)
FIND_PACKAGE(Threads REQUIRED) FIND_PACKAGE(Threads REQUIRED)
FIND_PACKAGE(LibXml2 REQUIRED) FIND_PACKAGE(LibXml2 REQUIRED)
FIND_PACKAGE(PNG REQUIRED) FIND_PACKAGE(PNG REQUIRED)

View file

@ -0,0 +1,87 @@
# Look for a directory containing STLport.
#
# The following values are defined
# STLPORT_INCLUDE_DIR - where to find vector, etc.
# STLPORT_LIBRARIES - link against these to use STLport
# STLPORT_FOUND - True if the STLport is available.
# also defined, but not for general use are
IF(STLPORT_LIBRARIES AND STLPORT_INCLUDE_DIR)
# in cache already
SET(STLPORT_FIND_QUIETLY TRUE)
ENDIF(STLPORT_LIBRARIES AND STLPORT_INCLUDE_DIR)
FIND_PATH(STLPORT_INCLUDE_DIR
iostream
PATHS
/usr/local/include
/usr/include
/sw/include
/opt/local/include
/opt/csw/include
/opt/include
PATH_SUFFIXES stlport
)
FIND_LIBRARY(STLPORT_LIBRARY_DEBUG
NAMES
stlport_cygwin_debug
stlport_cygwin_stldebug
stlport_gcc_debug
stlport_gcc_stldebug
stlportstld_x
stlportstld_x.5.2
stlportd
PATHS
/usr/local/lib
/usr/lib
/usr/local/X11R6/lib
/usr/X11R6/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
FIND_LIBRARY(STLPORT_LIBRARY_RELEASE
NAMES
stlport_cygwin
stlport_gcc
stlport
stlport_x
stlport_x.5.2
PATHS
/usr/local/lib
/usr/lib
/usr/local/X11R6/lib
/usr/X11R6/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
IF(STLPORT_INCLUDE_DIR)
IF(STLPORT_LIBRARY_RELEASE)
SET(STLPORT_FOUND "YES")
SET(STLPORT_LIBRARIES "optimized;${STLPORT_LIBRARY_RELEASE}")
IF(STLPORT_LIBRARY_DEBUG)
SET(STLPORT_LIBRARIES ";debug;${STLPORT_LIBRARY_DEBUG}")
ENDIF(STLPORT_LIBRARY_DEBUG)
ENDIF(STLPORT_LIBRARY_RELEASE)
ENDIF(STLPORT_INCLUDE_DIR)
IF(STLPORT_FOUND)
IF(NOT STLPORT_FIND_QUIETLY)
MESSAGE(STATUS "Found STLport: ${STLPORT_LIBRARIES}")
ENDIF(NOT STLPORT_FIND_QUIETLY)
ELSE(STLPORT_FOUND)
IF(NOT STLPORT_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find STLport!")
ENDIF(NOT STLPORT_FIND_QUIETLY)
ENDIF(STLPORT_FOUND)
MARK_AS_ADVANCED(STLPORT_LIBRARY_RELEASE STLPORT_LIBRARY_DEBUG)

View file

@ -54,7 +54,7 @@ MACRO(NL_ADD_LIB_SUFFIX name)
ENDMACRO(NL_ADD_LIB_SUFFIX) ENDMACRO(NL_ADD_LIB_SUFFIX)
### ###
# Adds the runtime link flags for Win32 binaries. # Adds the runtime link flags for Win32 binaries and links STLport.
# Argument: name - the target to add the link flags to. # Argument: name - the target to add the link flags to.
### ###
MACRO(NL_ADD_RUNTIME_FLAGS name) MACRO(NL_ADD_RUNTIME_FLAGS name)
@ -63,6 +63,9 @@ MACRO(NL_ADD_RUNTIME_FLAGS name)
LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}" LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}"
LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}") LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}")
ENDIF(WIN32) ENDIF(WIN32)
IF(WITH_STLPORT)
TARGET_LINK_LIBRARIES(${name} ${STLPORT_LIBRARIES})
ENDIF(WITH_STLPORT)
ENDMACRO(NL_ADD_RUNTIME_FLAGS) ENDMACRO(NL_ADD_RUNTIME_FLAGS)
### ###
@ -133,6 +136,7 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS)
OPTION(WITH_GTK "With GTK Support" OFF) OPTION(WITH_GTK "With GTK Support" OFF)
OPTION(WITH_QT "With QT Support" OFF) OPTION(WITH_QT "With QT Support" OFF)
OPTION(WITH_COCOA "Build with native Mac OS X Cocoa support" OFF) OPTION(WITH_COCOA "Build with native Mac OS X Cocoa support" OFF)
OPTION(WITH_STLPORT "With STLport support." OFF)
OPTION(BUILD_DASHBOARD "Build to the CDash dashboard" OFF) OPTION(BUILD_DASHBOARD "Build to the CDash dashboard" OFF)
ENDMACRO(NL_SETUP_DEFAULT_OPTIONS) ENDMACRO(NL_SETUP_DEFAULT_OPTIONS)