From ebd42209620e613f0c6a7c197dafd83d612d63fe Mon Sep 17 00:00:00 2001 From: mattraykowski Date: Fri, 23 Jul 2010 10:51:02 -0600 Subject: [PATCH] Changed: #842 Added ability to toggle support for STLport builds - note untested! --- code/nel/CMakeLists.txt | 5 ++ code/nel/CMakeModules/FindSTLport.cmake | 87 +++++++++++++++++++++++++ code/nel/CMakeModules/nel.cmake | 6 +- 3 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 code/nel/CMakeModules/FindSTLport.cmake diff --git a/code/nel/CMakeLists.txt b/code/nel/CMakeLists.txt index ff075e315..289de6689 100644 --- a/code/nel/CMakeLists.txt +++ b/code/nel/CMakeLists.txt @@ -68,6 +68,11 @@ NL_SETUP_PREFIX_PATHS() #----------------------------------------------------------------------------- #Platform specifics +IF(WITH_STLPORT) + FIND_PACKAGE(STLport REQUIRED) + INCLUDE_DIRECTORIES(${STLPORT_INCLUDE_DIR}) +ENDIF(WITH_STLPORT) + FIND_PACKAGE(Threads REQUIRED) FIND_PACKAGE(LibXml2 REQUIRED) FIND_PACKAGE(PNG REQUIRED) diff --git a/code/nel/CMakeModules/FindSTLport.cmake b/code/nel/CMakeModules/FindSTLport.cmake new file mode 100644 index 000000000..f2b9be4e8 --- /dev/null +++ b/code/nel/CMakeModules/FindSTLport.cmake @@ -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) diff --git a/code/nel/CMakeModules/nel.cmake b/code/nel/CMakeModules/nel.cmake index 4a3720618..3c1ccdf9a 100644 --- a/code/nel/CMakeModules/nel.cmake +++ b/code/nel/CMakeModules/nel.cmake @@ -54,7 +54,7 @@ MACRO(NL_ADD_LIB_SUFFIX name) 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. ### 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_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}") ENDIF(WIN32) + IF(WITH_STLPORT) + TARGET_LINK_LIBRARIES(${name} ${STLPORT_LIBRARIES}) + ENDIF(WITH_STLPORT) ENDMACRO(NL_ADD_RUNTIME_FLAGS) ### @@ -133,6 +136,7 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS) OPTION(WITH_GTK "With GTK Support" OFF) OPTION(WITH_QT "With QT 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) ENDMACRO(NL_SETUP_DEFAULT_OPTIONS)