From Philip Lowman, "Here's the promised cleanup of the OSG's CMakeLists.txt files for the src/ folder. I'll submit the others separately.

Also, there was also a small bug in osgDB's CMakeLists.txt that was causing an error when I tested with CMake 2.4.4.

IF(${OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX} STREQUAL "quicktime")
was changed to
IF(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX STREQUAL "quicktime")
"
This commit is contained in:
Robert Osfield 2009-03-23 16:01:02 +00:00
parent 51964a2b79
commit 39cecd2a72
23 changed files with 256 additions and 281 deletions

View File

@ -21,16 +21,16 @@ FOREACH( mylibfolder
ADD_SUBDIRECTORY(${mylibfolder})
ENDFOREACH( mylibfolder )
ENDFOREACH()
OPTION(BUILD_OSG_WRAPPERS "Enable to build Introspection and Wrappers" OFF)
IF (BUILD_OSG_WRAPPERS)
IF(BUILD_OSG_WRAPPERS)
ADD_SUBDIRECTORY(osgIntrospection)
ADD_SUBDIRECTORY(osgWrappers)
ENDIF(BUILD_OSG_WRAPPERS)
ENDIF()
IF(MSVC80)
OPTION(OSG_MSVC_GENERATE_PLUGINS_AND_WRAPPERS_MANIFESTS "Generate or not manifests files under VS8 for dynamically loaded dlls" ON)
ENDIF(MSVC80)
ENDIF()

View File

@ -13,12 +13,12 @@ INCLUDE(CheckAtomicOps)
# User Options
OPTION(DYNAMIC_OPENTHREADS "Set to ON to build OpenThreads for dynamic linking. Use OFF for static." ON)
IF (DYNAMIC_OPENTHREADS)
IF(DYNAMIC_OPENTHREADS)
SET(OPENTHREADS_USER_DEFINED_DYNAMIC_OR_STATIC "SHARED")
ELSE (DYNAMIC_OPENTHREADS)
ELSE()
SET(OPENTHREADS_USER_DEFINED_DYNAMIC_OR_STATIC "STATIC")
SET(OT_LIBRARY_STATIC 1)
ENDIF (DYNAMIC_OPENTHREADS)
ENDIF()
################################################################################
# Set Config file
@ -35,7 +35,7 @@ IF(MSVC)
SET(OPENTHREADS_VERSIONINFO_RC "${PROJECT_BINARY_DIR}/PlatformSpecifics/Windows/OpenThreadsVersionInfo.rc")
CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/PlatformSpecifics/Windows/OpenThreadsVersionInfo.rc.in"
"${OPENTHREADS_VERSIONINFO_RC}")
ENDIF(MSVC)
ENDIF()
# INSTALL_FILES(/include/OpenThreads/ FILES "${OPENTHREADS_CONFIG_HEADER}")
@ -66,11 +66,11 @@ IF(CMAKE_SYSTEM MATCHES IRIX)
IF(CMAKE_USE_SPROC_INIT)
# In this case, only Sproc exists, so no option.
SET(OPENTHREADS_USE_SPROC_INSTEAD_OF_PTHREADS 1)
ELSE(CMAKE_USE_SPROC_INIT)
ELSE()
IF(CMAKE_HAVE_SPROC_H)
OPTION(OPENTHREADS_USE_SPROC_INSTEAD_OF_PTHREADS "Set to ON to build OpenThreads against sproc instead of pthreads" OFF)
ENDIF(CMAKE_HAVE_SPROC_H)
ENDIF(CMAKE_USE_SPROC_INIT)
ENDIF()
ENDIF()
ENDIF(CMAKE_SYSTEM MATCHES IRIX)
# Maybe we should be using the FindThreads.cmake module?
@ -78,22 +78,22 @@ IF(WIN32)
# So I think Cygwin wants to use pthreads
IF(CYGWIN)
SUBDIRS(pthreads)
ELSE(CYGWIN)
ELSE()
# Everybody else including Msys should probably go here
SUBDIRS(win32)
# examples)
ENDIF(CYGWIN)
ELSE(WIN32)
ENDIF()
ELSE()
IF(UNIX)
IF(OPENTHREADS_USE_SPROC_INSTEAD_OF_PTHREADS)
SUBDIRS(sproc)
ELSE(OPENTHREADS_USE_SPROC_INSTEAD_OF_PTHREADS)
ELSE()
SUBDIRS(pthreads)
ENDIF(OPENTHREADS_USE_SPROC_INSTEAD_OF_PTHREADS)
ELSE(UNIX)
ENDIF()
ELSE()
MESSAGE("Sorry, OpenThreads may not support your platform")
ENDIF(UNIX)
ENDIF(WIN32)
ENDIF()
ENDIF()
# Make sure everyone can find Config
INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/include)

View File

@ -25,7 +25,7 @@ ADD_LIBRARY(${LIB_NAME}
IF(OPENTHREADS_SONAMES)
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES VERSION ${OPENTHREADS_VERSION} SOVERSION ${OPENTHREADS_SOVERSION})
ENDIF(OPENTHREADS_SONAMES)
ENDIF()
SET(CMAKE_REQUIRED_LIBRARIES_SAFE "${CMAKE_REQUIRED_LIBRARIES}")
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
@ -33,40 +33,40 @@ SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${CMAKE_THREAD_LIBS_INI
CHECK_FUNCTION_EXISTS(pthread_yield HAVE_PTHREAD_YIELD)
IF(HAVE_PTHREAD_YIELD)
ADD_DEFINITIONS(-DHAVE_PTHREAD_YIELD)
ELSE(HAVE_PTHREAD_YIELD)
ELSE()
# sched_yield appears not in libc, pthreads or whatever on some systems
CHECK_FUNCTION_EXISTS(sched_yield HAVE_SCHED_YIELD)
IF(NOT HAVE_SCHED_YIELD)
CHECK_LIBRARY_EXISTS(rt sched_yield "" HAVE_SCHED_YIELD)
IF(HAVE_SCHED_YIELD)
SET(CMAKE_THREAD_LIBS_INIT "${CMAKE_THREAD_LIBS_INIT} -lrt")
ENDIF(HAVE_SCHED_YIELD)
ENDIF(NOT HAVE_SCHED_YIELD)
ENDIF()
ENDIF()
IF(HAVE_SCHED_YIELD)
ADD_DEFINITIONS(-DHAVE_SCHED_YIELD)
ENDIF(HAVE_SCHED_YIELD)
ENDIF(HAVE_PTHREAD_YIELD)
ENDIF()
ENDIF()
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
# need to have that for pthread_setaffinity_np on linux
ADD_DEFINITIONS(-D_GNU_SOURCE)
SET(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_GNU_SOURCE")
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
ENDIF()
CHECK_FUNCTION_EXISTS(pthread_setconcurrency HAVE_PTHREAD_SETCONCURRENCY)
IF(HAVE_PTHREAD_SETCONCURRENCY)
ADD_DEFINITIONS(-DHAVE_PTHREAD_SETCONCURRENCY)
ENDIF(HAVE_PTHREAD_SETCONCURRENCY)
ENDIF()
CHECK_FUNCTION_EXISTS(pthread_getconcurrency HAVE_PTHREAD_GETCONCURRENCY)
IF(HAVE_PTHREAD_GETCONCURRENCY)
ADD_DEFINITIONS(-DHAVE_PTHREAD_GETCONCURRENCY)
ENDIF(HAVE_PTHREAD_GETCONCURRENCY)
ENDIF()
CHECK_FUNCTION_EXISTS(pthread_setaffinity_np HAVE_PTHREAD_SETAFFINITY_NP)
IF(HAVE_PTHREAD_SETAFFINITY_NP)
ADD_DEFINITIONS(-DHAVE_PTHREAD_SETAFFINITY_NP)
ELSE(HAVE_PTHREAD_SETAFFINITY_NP)
ELSE()
CHECK_CXX_SOURCE_COMPILES("
#include <sched.h>
int main() {
@ -76,7 +76,7 @@ int main() {
}" HAVE_THREE_PARAM_SCHED_SETAFFINITY)
IF(HAVE_THREE_PARAM_SCHED_SETAFFINITY)
ADD_DEFINITIONS(-DHAVE_THREE_PARAM_SCHED_SETAFFINITY)
ELSE(HAVE_THREE_PARAM_SCHED_SETAFFINITY)
ELSE()
CHECK_CXX_SOURCE_COMPILES("
#include <sched.h>
int main() {
@ -86,9 +86,9 @@ int main() {
}" HAVE_TWO_PARAM_SCHED_SETAFFINITY)
IF(HAVE_TWO_PARAM_SCHED_SETAFFINITY)
ADD_DEFINITIONS(-DHAVE_TWO_PARAM_SCHED_SETAFFINITY)
ENDIF(HAVE_TWO_PARAM_SCHED_SETAFFINITY)
ENDIF(HAVE_THREE_PARAM_SCHED_SETAFFINITY)
ENDIF(HAVE_PTHREAD_SETAFFINITY_NP)
ENDIF()
ENDIF()
ENDIF()
SET(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES_SAFE}")

View File

@ -23,7 +23,7 @@ ADD_LIBRARY(${LIB_NAME}
IF(OPENTHREADS_SONAMES)
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES VERSION ${OPENTHREADS_VERSION} SOVERSION ${OPENTHREADS_SOVERSION})
ENDIF(OPENTHREADS_SONAMES)
ENDIF()
# Do we need to link against anything for Sproc?
#TARGET_LINK_LIBRARIES(${LIB_NAME}

View File

@ -27,7 +27,7 @@ ADD_LIBRARY(${LIB_NAME}
IF(OPENTHREADS_SONAMES)
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES VERSION ${OPENTHREADS_VERSION} SOVERSION ${OPENTHREADS_SOVERSION})
ENDIF(OPENTHREADS_SONAMES)
ENDIF()
# Since we're building different platforms binaries in
# their respective directories, we need to set the
@ -38,7 +38,7 @@ LINK_DIRECTORIES(
IF(MSVC AND OSG_MSVC_VERSIONED_DLL)
HANDLE_MSVC_DLL(ot ${OPENTHREADS_SOVERSION})
ENDIF(MSVC AND OSG_MSVC_VERSIONED_DLL)
ENDIF()
INSTALL(
TARGETS OpenThreads

View File

@ -1,10 +1,10 @@
# FIXME: For OS X, need flag for Framework or dylib
IF (DYNAMIC_OPENSCENEGRAPH)
IF(DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSG_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH)
ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH)
ENDIF()
SET(LIB_NAME osg)
@ -15,7 +15,7 @@ SET(LIB_NAME osg)
OPTION(OSG_FORCE_QUERY_RESULT_AVAILABLE_BEFORE_RETRIEVAL "Set to ON to build OcclussionQueryNode with a workaround for multi-threaded OpenGL driver occlussion query crash. " OFF)
IF(OSG_FORCE_QUERY_RESULT_AVAILABLE_BEFORE_RETRIEVAL)
ADD_DEFINITIONS(-DFORCE_QUERY_RESULT_AVAILABLE_BEFORE_RETRIEVAL)
ENDIF(OSG_FORCE_QUERY_RESULT_AVAILABLE_BEFORE_RETRIEVAL)
ENDIF()
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME})

View File

@ -1,9 +1,9 @@
IF (DYNAMIC_OPENSCENEGRAPH)
IF(DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSGANIMATION_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH)
ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH)
ENDIF()
SET(LIB_NAME osgAnimation)

View File

@ -1,12 +1,12 @@
IF (DYNAMIC_OPENSCENEGRAPH)
IF(DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSGDB_LIBRARY)
# Add a default plugin search path component
ADD_DEFINITIONS(-DOSG_DEFAULT_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib${LIB_POSTFIX}/${OSG_PLUGINS})
ELSE (DYNAMIC_OPENSCENEGRAPH)
ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH)
ENDIF()
@ -79,30 +79,28 @@ IF(APPLE)
SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "quicktime" CACHE STRING "standard image plugin for os x, options are quicktime, imageio")
IF(${OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX} STREQUAL "quicktime")
IF(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX STREQUAL "quicktime")
ADD_DEFINITIONS(-DDARWIN_QUICKTIME)
ELSE(${OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX} STREQUAL "quicktime")
ELSE()
ADD_DEFINITIONS(-DDARWIN_IMAGEIO)
ENDIF(${OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX} STREQUAL "quicktime")
ENDIF(APPLE)
ENDIF()
ENDIF()
IF(QUICKTIME_FOUND)
ADD_DEFINITIONS(-DUSE_QUICKTIME)
ENDIF(QUICKTIME_FOUND)
ENDIF()
IF(XINE_FOUND)
ADD_DEFINITIONS(-DUSE_XINE)
ENDIF(XINE_FOUND)
ENDIF()
IF(INVENTOR_FOUND)
ADD_DEFINITIONS(-DUSE_INVENTOR)
ENDIF(INVENTOR_FOUND)
ENDIF()
IF(OPENVRML_FOUND)
ADD_DEFINITIONS(-DUSE_VRML)
ENDIF(OPENVRML_FOUND)
ENDIF()
ADD_DEFINITIONS(-DOSG_PLUGIN_EXTENSION=${CMAKE_SHARED_MODULE_SUFFIX})

View File

@ -1,9 +1,9 @@
IF (DYNAMIC_OPENSCENEGRAPH)
IF(DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSGFX_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH)
ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH)
ENDIF()
SET(LIB_NAME osgFX)
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME})

View File

@ -1,9 +1,9 @@
IF (DYNAMIC_OPENSCENEGRAPH)
IF(DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSGGA_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH)
ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH)
ENDIF()
SET(LIB_NAME osgGA)
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME})

View File

@ -1,9 +1,9 @@
IF (DYNAMIC_OPENSCENEGRAPH)
IF(DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSGINTROSPECTION_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH)
ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH)
ENDIF()
SET(LIB_NAME osgIntrospection)
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME})

View File

@ -1,9 +1,9 @@
IF (DYNAMIC_OPENSCENEGRAPH)
IF(DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSGMANIPULATOR_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH)
ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH)
ENDIF()
SET(LIB_NAME osgManipulator)
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME})

View File

@ -1,9 +1,9 @@
IF (DYNAMIC_OPENSCENEGRAPH)
IF(DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSGPARTICLE_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH)
ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH)
ENDIF()
SET(LIB_NAME osgParticle)
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME})

View File

@ -6,22 +6,22 @@
PROJECT(OSG_PLUGINS_MASTER)
IF (NOT DYNAMIC_OPENSCENEGRAPH)
IF(NOT DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(NOT DYNAMIC_OPENSCENEGRAPH)
ENDIF()
IF(NOT MSVC)
SET(LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH}/${OSG_PLUGINS}")
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${OSG_PLUGINS}")
ENDIF(NOT MSVC)
ENDIF()
SET(CMAKE_SHARED_MODULE_PREFIX ${OSG_PLUGIN_PREFIX})
IF(MSVC80)
IF(NOT OSG_MSVC_GENERATE_PLUGINS_AND_WRAPPERS_MANIFESTS)
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /MANIFEST:NO")
ENDIF(NOT OSG_MSVC_GENERATE_PLUGINS_AND_WRAPPERS_MANIFESTS)
ENDIF(MSVC80)
ENDIF()
ENDIF()
SET(TARGET_DEFAULT_PREFIX "osgdb_")
SET(TARGET_DEFAULT_LABEL_PREFIX "Plugins")
@ -86,32 +86,32 @@ ADD_SUBDIRECTORY(vtf)
IF(JPEG_FOUND)
ADD_SUBDIRECTORY(jpeg)
ENDIF(JPEG_FOUND)
ENDIF()
IF(JASPER_FOUND)
ADD_SUBDIRECTORY(jp2)
ENDIF(JASPER_FOUND)
ENDIF()
IF(OPENEXR_FOUND)
ADD_SUBDIRECTORY(exr)
ENDIF(OPENEXR_FOUND)
ENDIF()
IF(GIFLIB_FOUND)
ADD_SUBDIRECTORY(gif)
ENDIF(GIFLIB_FOUND)
ENDIF()
IF(PNG_FOUND)
ADD_SUBDIRECTORY(png)
ENDIF(PNG_FOUND)
ENDIF()
IF(TIFF_FOUND)
ADD_SUBDIRECTORY(tiff)
ENDIF(TIFF_FOUND)
ENDIF()
IF(GDAL_FOUND)
ADD_SUBDIRECTORY(gdal)
ADD_SUBDIRECTORY(ogr)
ENDIF(GDAL_FOUND)
ENDIF()
IF(XUL_FOUND)
IF (WIN32 OR APPLE OR GTK_FOUND)
IF(WIN32 OR APPLE OR GTK_FOUND)
ADD_SUBDIRECTORY(gecko)
ENDIF(WIN32 OR APPLE OR GTK_FOUND)
ENDIF(XUL_FOUND)
ENDIF()
ENDIF()
@ -119,18 +119,13 @@ ENDIF(XUL_FOUND)
#
# 3D Image plugins
#
IF (DCMTK_FOUND AND ZLIB_FOUND)
IF(DCMTK_FOUND AND ZLIB_FOUND)
ADD_SUBDIRECTORY(dicom)
ELSE (DCMTK_FOUND AND ZLIB_FOUND)
IF (ITK_FOUND)
ELSE()
IF(ITK_FOUND)
ADD_SUBDIRECTORY(dicom)
ENDIF(ITK_FOUND)
ENDIF(DCMTK_FOUND AND ZLIB_FOUND)
ENDIF()
ENDIF()
############################################################
#
@ -141,24 +136,23 @@ ADD_SUBDIRECTORY(3dc)
IF(CURL_FOUND)
ADD_SUBDIRECTORY(curl)
ENDIF(CURL_FOUND)
ENDIF()
IF(ZLIB_FOUND)
ADD_SUBDIRECTORY(gz)
ENDIF(ZLIB_FOUND)
ENDIF()
IF(INVENTOR_FOUND)
ADD_SUBDIRECTORY(Inventor)
ENDIF(INVENTOR_FOUND)
ENDIF()
IF(OPENVRML_FOUND)
ADD_SUBDIRECTORY(vrml)
ENDIF(OPENVRML_FOUND)
ENDIF()
IF(COLLADA_FOUND)
ADD_SUBDIRECTORY(dae)
ENDIF(COLLADA_FOUND)
ENDIF()
ADD_SUBDIRECTORY(lwo)
ADD_SUBDIRECTORY(bvh)
@ -172,7 +166,7 @@ ADD_SUBDIRECTORY(obj)
IF(PERFORMER_FOUND)
ADD_SUBDIRECTORY(pfb)
ENDIF(PERFORMER_FOUND)
ENDIF()
ADD_SUBDIRECTORY(pic)
ADD_SUBDIRECTORY(stl)
@ -194,43 +188,43 @@ ADD_SUBDIRECTORY(mdl)
IF(XINE_FOUND)
ADD_SUBDIRECTORY(xine)
ENDIF(XINE_FOUND)
ENDIF()
IF(FFMPEG_FOUND)
ADD_SUBDIRECTORY(ffmpeg)
ENDIF(FFMPEG_FOUND)
ENDIF()
# IF(OPENAL_FOUND)
# ADD_SUBDIRECTORY(OpenAL)
# ENDIF(OPENAL_FOUND)
# ENDIF()
IF(APPLE)
ADD_SUBDIRECTORY(imageio)
ENDIF(APPLE)
ENDIF()
IF(QUICKTIME_FOUND)
ADD_SUBDIRECTORY(quicktime)
ENDIF(QUICKTIME_FOUND)
ENDIF()
IF(FREETYPE_FOUND)
ADD_SUBDIRECTORY(freetype)
ENDIF(FREETYPE_FOUND)
ENDIF()
IF(ZLIB_FOUND)
ADD_SUBDIRECTORY(zip)
ENDIF(ZLIB_FOUND)
ENDIF()
IF(RSVG_FOUND AND CAIRO_FOUND)
ADD_SUBDIRECTORY(svg)
ENDIF(RSVG_FOUND AND CAIRO_FOUND)
ENDIF()
IF (POPPLER_FOUND AND CAIRO_FOUND)
IF(POPPLER_FOUND AND CAIRO_FOUND)
ADD_SUBDIRECTORY(pdf)
ENDIF(POPPLER_FOUND AND CAIRO_FOUND)
ENDIF()
IF (LIBVNCSERVER_FOUND)
IF(LIBVNCSERVER_FOUND)
ADD_SUBDIRECTORY(vnc)
ENDIF(LIBVNCSERVER_FOUND)
ENDIF()
##########to get all the variables of Cmake
#GET_CMAKE_PROPERTY(MYVARS VARIABLES)

View File

@ -1,9 +1,9 @@
IF (DYNAMIC_OPENSCENEGRAPH)
IF(DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSGSHADOW_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH)
ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH)
ENDIF()
SET(LIB_NAME osgShadow)
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME})

View File

@ -1,9 +1,9 @@
IF (DYNAMIC_OPENSCENEGRAPH)
IF(DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSGSIM_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH)
ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH)
ENDIF()
SET(LIB_NAME osgSim)
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME})

View File

@ -1,8 +1,8 @@
IF (DYNAMIC_OPENSCENEGRAPH)
IF(DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSGTERRAIN_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH)
ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH)
ENDIF()
SET(LIB_NAME osgTerrain)
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME})

View File

@ -1,9 +1,9 @@
IF (DYNAMIC_OPENSCENEGRAPH)
IF(DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSGTEXT_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH)
ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH)
ENDIF()
SET(LIB_NAME osgText)
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME})

View File

@ -1,10 +1,10 @@
# FIXME: For OS X, need flag for Framework or dylib
IF (DYNAMIC_OPENSCENEGRAPH)
IF(DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSGUTIL_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH)
ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH)
ENDIF()
SET(LIB_NAME osgUtil)
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME})

View File

@ -1,10 +1,10 @@
# FIXME: For OS X, need flag for Framework or dylib
IF (DYNAMIC_OPENSCENEGRAPH)
IF(DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSGVIEWER_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH)
ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH)
ENDIF()
SET(LIB_NAME osgViewer)
@ -40,7 +40,6 @@ SET(LIB_COMMON_FILES
SET(LIB_EXTRA_LIBS)
IF(WIN32)
#
# Enable workaround for OpenGL driver issues when used in multithreaded/multiscreen with NVidia drivers on Windows XP
# For example: osgviewer dumptruck.osg was showing total garbage (screen looked like shattered, splashed hedgehog)
@ -51,7 +50,7 @@ IF(WIN32)
MARK_AS_ADVANCED(OSG_MULTIMONITOR_MULTITHREAD_WIN32_NVIDIA_WORKAROUND)
IF(OSG_MULTIMONITOR_MULTITHREAD_WIN32_NVIDIA_WORKAROUND)
ADD_DEFINITIONS(-DOSG_MULTIMONITOR_MULTITHREAD_WIN32_NVIDIA_WORKAROUND)
ENDIF(OSG_MULTIMONITOR_MULTITHREAD_WIN32_NVIDIA_WORKAROUND)
ENDIF()
SET(LIB_PUBLIC_HEADERS ${LIB_PUBLIC_HEADERS}
${HEADER_PATH}/api/Win32/GraphicsWindowWin32
@ -62,14 +61,12 @@ IF(WIN32)
GraphicsWindowWin32.cpp
PixelBufferWin32.cpp
)
ELSE(WIN32)
ELSE()
IF(APPLE)
SET(OSG_WINDOWING_SYSTEM "Carbon" CACHE STRING "Windowing system type for graphics window creation, options Carbon, Cocoa or X11.")
ELSE(APPLE)
ELSE()
SET(OSG_WINDOWING_SYSTEM "X11" CACHE STRING "Windowing system type for graphics window creation. options only X11")
ENDIF(APPLE)
ENDIF()
IF(${OSG_WINDOWING_SYSTEM} STREQUAL "Cocoa")
ADD_DEFINITIONS(-DUSE_DARWIN_COCOA_IMPLEMENTATION)
@ -83,11 +80,8 @@ ELSE(WIN32)
DarwinUtils.mm
PixelBufferCocoa.mm
)
SET(LIB_EXTRA_LIBS ${COCOA_LIBRARY} ${LIB_EXTRA_LIBS})
ELSE(${OSG_WINDOWING_SYSTEM} STREQUAL "Cocoa")
IF(${OSG_WINDOWING_SYSTEM} STREQUAL "Carbon")
ELSEIF(${OSG_WINDOWING_SYSTEM} STREQUAL "Carbon")
ADD_DEFINITIONS(-DUSE_DARWIN_CARBON_IMPLEMENTATION)
SET(LIB_PUBLIC_HEADERS ${LIB_PUBLIC_HEADERS}
${HEADER_PATH}/api/Carbon/GraphicsWindowCarbon
@ -100,50 +94,40 @@ ELSE(WIN32)
PixelBufferCarbon.cpp
)
SET(LIB_EXTRA_LIBS ${COCOA_LIBRARY} ${LIB_EXTRA_LIBS})
ELSE(${OSG_WINDOWING_SYSTEM} STREQUAL "Carbon")
ELSE()
# X11 for everybody else
INCLUDE(FindPkgConfig OPTIONAL)
IF (PKG_CONFIG_FOUND)
IF(PKG_CONFIG_FOUND)
PKG_CHECK_MODULES(XRANDR xrandr)
IF (XRANDR_FOUND)
IF(XRANDR_FOUND)
OPTION(OSGVIEWER_USE_XRANDR "Set to ON to enable Xrandr support for GraphicsWindowX11." ON)
ELSE(XRANDR_FOUND)
ELSE()
SET(OSGVIEWER_USE_XRANDR OFF)
ENDIF (XRANDR_FOUND)
ELSE(PKG_CONFIG_FOUND)
ENDIF()
ELSE()
SET(OSGVIEWER_USE_XRANDR OFF)
ENDIF(PKG_CONFIG_FOUND)
ENDIF()
SET(LIB_PUBLIC_HEADERS ${LIB_PUBLIC_HEADERS}
${HEADER_PATH}/api/X11/GraphicsWindowX11
${HEADER_PATH}/api/X11/PixelBufferX11
)
SET(LIB_COMMON_FILES ${LIB_COMMON_FILES}
GraphicsWindowX11.cpp
PixelBufferX11.cpp
)
IF(OSGVIEWER_USE_XRANDR)
ADD_DEFINITIONS(-DOSGVIEWER_USE_XRANDR)
SET(LIB_PRIVATE_HEADERS ${LIB_PRIVATE_HEADERS} ${XRANDR_INCLUDE_DIRS} )
IF (X11_Xrandr_LIB)
IF(X11_Xrandr_LIB)
SET(LIB_EXTRA_LIBS ${X11_Xrandr_LIB} ${LIB_EXTRA_LIBS})
ELSE(X11_Xrandr_LIB)
ELSE()
SET(LIB_EXTRA_LIBS ${XRANDR_LIBRARIES} ${LIB_EXTRA_LIBS})
ENDIF(X11_Xrandr_LIB)
ENDIF(OSGVIEWER_USE_XRANDR)
ENDIF()
ENDIF()
# X11 on Apple requires X11 library plus OpenGL linking hack on Leopard
IF(APPLE)
@ -154,17 +138,14 @@ ELSE(WIN32)
ELSEIF(EXISTS ${CMAKE_OSX_SYSROOT}/usr/X11R6/include/GL/glx.h)
SET(OPENGL_INCLUDE_DIR /usr/X11R6/include)
SET(OPENGL_LIBRARIES /usr/X11R6/lib/libGL.dylib)
ENDIF(EXISTS ${CMAKE_OSX_SYSROOT}/usr/X11/include/GL/glx.h)
ENDIF()
INCLUDE_DIRECTORIES(BEFORE SYSTEM ${OPENGL_INCLUDE_DIR})
SET(LIB_EXTRA_LIBS ${X11_X11_LIB} ${OPENGL_LIBRARIES} ${LIB_EXTRA_LIBS})
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:${CMAKE_OSX_SYSROOT}/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
ENDIF(APPLE)
ENDIF(${OSG_WINDOWING_SYSTEM} STREQUAL "Carbon")
ENDIF(${OSG_WINDOWING_SYSTEM} STREQUAL "Cocoa")
ENDIF(WIN32)
ENDIF()
ENDIF()
ADD_LIBRARY(${LIB_NAME}
@ -189,11 +170,11 @@ LINK_CORELIB_DEFAULT(${LIB_NAME})
IF(MINGW OR CYGWIN)
LINK_EXTERNAL(${LIB_NAME} gdi32 )
ENDIF(MINGW OR CYGWIN)
ENDIF()
INCLUDE(ModuleInstall OPTIONAL)
FOREACH( INCLUDEFILE ${LIB_PUBLIC_HEADERS} )
FOREACH(INCLUDEFILE ${LIB_PUBLIC_HEADERS} )
FILE(RELATIVE_PATH REL_INCLUDEFILE ${HEADER_PATH} ${INCLUDEFILE})
GET_FILENAME_COMPONENT(REL_INCLUDE_PATH ${REL_INCLUDEFILE} PATH)
INSTALL(
@ -201,4 +182,4 @@ FOREACH( INCLUDEFILE ${LIB_PUBLIC_HEADERS} )
DESTINATION ${INSTALL_INCDIR}/${LIB_NAME}/${REL_INCLUDE_PATH}
COMPONENT libopenscenegraph-dev
)
ENDFOREACH( INCLUDEFILE)
ENDFOREACH()

View File

@ -1,9 +1,9 @@
IF (DYNAMIC_OPENSCENEGRAPH)
IF(DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSGVOLUME_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH)
ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH)
ENDIF()
SET(LIB_NAME osgVolume)
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME})

View File

@ -1,8 +1,8 @@
IF (DYNAMIC_OPENSCENEGRAPH)
IF(DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSGWIDGET_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH)
ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH)
ENDIF()
SET(LIB_NAME osgWidget)
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME})

View File

@ -1,8 +1,8 @@
PROJECT(OSG_WRAPPERS)
IF (NOT DYNAMIC_OPENSCENEGRAPH)
IF(NOT DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(NOT DYNAMIC_OPENSCENEGRAPH)
ENDIF()
SET(LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH}/${OSG_PLUGINS}")
@ -11,8 +11,8 @@ SET(CMAKE_SHARED_MODULE_PREFIX ${OSG_PLUGIN_PREFIX})
IF(MSVC80)
IF(NOT OSG_MSVC_GENERATE_PLUGINS_AND_WRAPPERS_MANIFESTS)
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /MANIFEST:NO")
ENDIF(NOT OSG_MSVC_GENERATE_PLUGINS_AND_WRAPPERS_MANIFESTS)
ENDIF(MSVC80)
ENDIF()
ENDIF()
MACRO(ADD_WRAPPER_LIB SUBDIR EXPORTDEF)
SET(TARGET_NAME "osgwrapper_${SUBDIR}")
@ -41,12 +41,10 @@ MACRO(ADD_WRAPPER_LIB SUBDIR EXPORTDEF)
# MESSAGE(STATUS "STORED LIST [${LISTNAME}] = (${CURRLIST})")
SET(LISTNAME ${ARG})
REMOVE(CURRLIST ${CURRLIST} )
ELSE(${EXPRESSION})
ELSE()
SET(CURRLIST ${CURRLIST} ${ARG})
ENDIF(${EXPRESSION})
ENDFOREACH(ARG)
ENDIF()
ENDFOREACH()
SET(${LISTNAME} ${CURRLIST})
#MESSAGE(STATUS "STORED LIST [${LISTNAME}] = (${CURRLIST})")
REMOVE(CURRLIST ${CURRLIST} )
@ -54,17 +52,17 @@ MACRO(ADD_WRAPPER_LIB SUBDIR EXPORTDEF)
#MESSAGE(STATUS "AFTER: EXC (${EXCLUDE}) DEF (${DEFINE}) LINK (${LINK})")
FOREACH(EXF ${EXCLUDE})
REMOVE(SRC_FILES ${OPENSCENEGRAPH_DIR}/src/${SUBDIR}/${EXF})
ENDFOREACH(EXF)
ENDFOREACH()
FOREACH(DEF ${DEFINE})
SET(DEFSTR "${DEFSTR} /D \"${DEF}\"")
#MESSAGE(STATUS "add symbol : " ${DEF})
ENDFOREACH(DEF)
ENDFOREACH()
IF(NOT DEFSTR STREQUAL "")
SET_SOURCE_FILES_PROPERTIES(${SRC_FILES} PROPERTIES COMPILE_FLAGS ${DEFSTR})
#MESSAGE(STATUS "********* ADD COMPILE FLAGS ${DEFSTR} **********")
ENDIF(NOT DEFSTR STREQUAL "")
ENDIF()
#ADD_LIBRARY(${TARGET_NAME} SHARED ${SRC_FILES} )
ADD_LIBRARY(${TARGET_NAME} MODULE ${SRC_FILES} )
@ -72,9 +70,8 @@ MACRO(ADD_WRAPPER_LIB SUBDIR EXPORTDEF)
#not sure if needed, but for plugins only msvc need the d suffix
IF(NOT MSVC)
SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES DEBUG_POSTFIX "")
ELSE(NOT MSVC)
ELSE()
IF(OSG_MSVC_VERSIONED_DLL)
#this is a hack... the build place is set to lib/<debug or release> by LIBARARY_OUTPUT_PATH equal to OUTPUT_LIBDIR
#the .lib will be crated in ../ so going straight in lib by the IMPORT_PREFIX property
#because we want dll placed in OUTPUT_BINDIR ie the bin folder sibling of lib, we can use ../../bin to go there,
@ -84,19 +81,16 @@ MACRO(ADD_WRAPPER_LIB SUBDIR EXPORTDEF)
IF(NOT MSVC_IDE)
SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES PREFIX "../bin/${OSG_PLUGINS}/")
ELSE(NOT MSVC_IDE)
ELSE()
SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES PREFIX "../../bin/${OSG_PLUGINS}/" IMPORT_PREFIX "../")
ENDIF(NOT MSVC_IDE)
ELSE(OSG_MSVC_VERSIONED_DLL)
ENDIF()
ELSE()
#in standard mode (unversioned) the .lib and .dll are placed in lib/<debug or release>/${OSG_PLUGINS}.
#here the PREFIX property has been used, the same result would be accomplidhe by prepending ${OSG_PLUGINS}/ to OUTPUT_NAME target property
SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES PREFIX "${OSG_PLUGINS}/")
ENDIF(OSG_MSVC_VERSIONED_DLL)
ENDIF(NOT MSVC)
ENDIF()
ENDIF()
SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES DEFINE_SYMBOL "${EXPORTDEF}" PROJECT_LABEL "Wrapper ${SUBDIR}")
IF(MSVC AND OSG_MSVC_VERSIONED_DLL)
@ -104,25 +98,31 @@ MACRO(ADD_WRAPPER_LIB SUBDIR EXPORTDEF)
#when using full path name to specify linkage, it seems that already linked libs must be specified
LINK_EXTERNAL(${TARGET_NAME} ${OPENGL_LIBRARIES})
ELSE(MSVC AND OSG_MSVC_VERSIONED_DLL)
ELSE()
TARGET_LINK_LIBRARIES(${TARGET_NAME} ${LINK})
ENDIF(MSVC AND OSG_MSVC_VERSIONED_DLL)
ENDIF()
#MESSAGE(STATUS "--TARGET_LINK_LIBRARIES-->${TARGET_NAME}<->${LINK}<-")
#FIXME: Deprecated
REMOVE(DEFINE ${DEFINE})
REMOVE(LINK ${LINK})
REMOVE(EXCLUDE ${EXCLUDE})
IF(WIN32)
INSTALL(TARGETS ${TARGET_NAME} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib/${OSG_PLUGINS} LIBRARY DESTINATION bin/${OSG_PLUGINS} COMPONENT libopenscenegraph-wrappers)
ELSE(WIN32)
INSTALL(TARGETS ${TARGET_NAME} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} LIBRARY DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} COMPONENT libopenscenegraph-wrappers)
ENDIF(WIN32)
INSTALL(TARGETS ${TARGET_NAME}
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib/${OSG_PLUGINS}
LIBRARY DESTINATION bin/${OSG_PLUGINS}
COMPONENT libopenscenegraph-wrappers)
ELSE()
INSTALL(TARGETS ${TARGET_NAME}
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS}
LIBRARY DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS}
COMPONENT libopenscenegraph-wrappers)
ENDIF()
ENDMACRO(ADD_WRAPPER_LIB)
SET(OSGWRAPPER_LIB_LIST
OpenThreads
osg
@ -144,9 +144,11 @@ SET(OSGWRAPPER_LIB_LIST
SET(OSGWRAPPER_DIR ${CMAKE_CURRENT_SOURCE_DIR})
IF(MSVC)
SET(LIBRARY_OUTPUT_PATH ${OUTPUT_LIBDIR})
ENDIF(MSVC)
FOREACH(LIB ${OSGWRAPPER_LIB_LIST} )
ENDIF()
FOREACH(LIB ${OSGWRAPPER_LIB_LIST})
ADD_WRAPPER_LIB(${LIB} OSGWRAPPERS_LIBRARY LINK OpenThreads osg osgGA ${LIB} osgIntrospection)
ENDFOREACH(LIB ${OSGWRAPPER_LIB_LIST} )
ENDFOREACH()