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

@ -19,18 +19,18 @@ FOREACH( mylibfolder
osgPlugins osgPlugins
) )
ADD_SUBDIRECTORY(${mylibfolder}) ADD_SUBDIRECTORY(${mylibfolder})
ENDFOREACH( mylibfolder ) ENDFOREACH()
OPTION(BUILD_OSG_WRAPPERS "Enable to build Introspection and Wrappers" OFF) OPTION(BUILD_OSG_WRAPPERS "Enable to build Introspection and Wrappers" OFF)
IF (BUILD_OSG_WRAPPERS) IF(BUILD_OSG_WRAPPERS)
ADD_SUBDIRECTORY(osgIntrospection) ADD_SUBDIRECTORY(osgIntrospection)
ADD_SUBDIRECTORY(osgWrappers) ADD_SUBDIRECTORY(osgWrappers)
ENDIF(BUILD_OSG_WRAPPERS) ENDIF()
IF(MSVC80) IF(MSVC80)
OPTION(OSG_MSVC_GENERATE_PLUGINS_AND_WRAPPERS_MANIFESTS "Generate or not manifests files under VS8 for dynamically loaded dlls" ON) 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 # User Options
OPTION(DYNAMIC_OPENTHREADS "Set to ON to build OpenThreads for dynamic linking. Use OFF for static." ON) 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") SET(OPENTHREADS_USER_DEFINED_DYNAMIC_OR_STATIC "SHARED")
ELSE (DYNAMIC_OPENTHREADS) ELSE()
SET(OPENTHREADS_USER_DEFINED_DYNAMIC_OR_STATIC "STATIC") SET(OPENTHREADS_USER_DEFINED_DYNAMIC_OR_STATIC "STATIC")
SET(OT_LIBRARY_STATIC 1) SET(OT_LIBRARY_STATIC 1)
ENDIF (DYNAMIC_OPENTHREADS) ENDIF()
################################################################################ ################################################################################
# Set Config file # Set Config file
@ -35,7 +35,7 @@ IF(MSVC)
SET(OPENTHREADS_VERSIONINFO_RC "${PROJECT_BINARY_DIR}/PlatformSpecifics/Windows/OpenThreadsVersionInfo.rc") SET(OPENTHREADS_VERSIONINFO_RC "${PROJECT_BINARY_DIR}/PlatformSpecifics/Windows/OpenThreadsVersionInfo.rc")
CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/PlatformSpecifics/Windows/OpenThreadsVersionInfo.rc.in" CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/PlatformSpecifics/Windows/OpenThreadsVersionInfo.rc.in"
"${OPENTHREADS_VERSIONINFO_RC}") "${OPENTHREADS_VERSIONINFO_RC}")
ENDIF(MSVC) ENDIF()
# INSTALL_FILES(/include/OpenThreads/ FILES "${OPENTHREADS_CONFIG_HEADER}") # INSTALL_FILES(/include/OpenThreads/ FILES "${OPENTHREADS_CONFIG_HEADER}")
@ -66,11 +66,11 @@ IF(CMAKE_SYSTEM MATCHES IRIX)
IF(CMAKE_USE_SPROC_INIT) IF(CMAKE_USE_SPROC_INIT)
# In this case, only Sproc exists, so no option. # In this case, only Sproc exists, so no option.
SET(OPENTHREADS_USE_SPROC_INSTEAD_OF_PTHREADS 1) SET(OPENTHREADS_USE_SPROC_INSTEAD_OF_PTHREADS 1)
ELSE(CMAKE_USE_SPROC_INIT) ELSE()
IF(CMAKE_HAVE_SPROC_H) IF(CMAKE_HAVE_SPROC_H)
OPTION(OPENTHREADS_USE_SPROC_INSTEAD_OF_PTHREADS "Set to ON to build OpenThreads against sproc instead of pthreads" OFF) 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()
ENDIF(CMAKE_USE_SPROC_INIT) ENDIF()
ENDIF(CMAKE_SYSTEM MATCHES IRIX) ENDIF(CMAKE_SYSTEM MATCHES IRIX)
# Maybe we should be using the FindThreads.cmake module? # Maybe we should be using the FindThreads.cmake module?
@ -78,22 +78,22 @@ IF(WIN32)
# So I think Cygwin wants to use pthreads # So I think Cygwin wants to use pthreads
IF(CYGWIN) IF(CYGWIN)
SUBDIRS(pthreads) SUBDIRS(pthreads)
ELSE(CYGWIN) ELSE()
# Everybody else including Msys should probably go here # Everybody else including Msys should probably go here
SUBDIRS(win32) SUBDIRS(win32)
# examples) # examples)
ENDIF(CYGWIN) ENDIF()
ELSE(WIN32) ELSE()
IF(UNIX) IF(UNIX)
IF(OPENTHREADS_USE_SPROC_INSTEAD_OF_PTHREADS) IF(OPENTHREADS_USE_SPROC_INSTEAD_OF_PTHREADS)
SUBDIRS(sproc) SUBDIRS(sproc)
ELSE(OPENTHREADS_USE_SPROC_INSTEAD_OF_PTHREADS) ELSE()
SUBDIRS(pthreads) SUBDIRS(pthreads)
ENDIF(OPENTHREADS_USE_SPROC_INSTEAD_OF_PTHREADS) ENDIF()
ELSE(UNIX) ELSE()
MESSAGE("Sorry, OpenThreads may not support your platform") MESSAGE("Sorry, OpenThreads may not support your platform")
ENDIF(UNIX) ENDIF()
ENDIF(WIN32) ENDIF()
# Make sure everyone can find Config # Make sure everyone can find Config
INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/include) INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/include)

View File

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

View File

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

View File

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

View File

@ -1,10 +1,10 @@
# FIXME: For OS X, need flag for Framework or dylib # FIXME: For OS X, need flag for Framework or dylib
IF (DYNAMIC_OPENSCENEGRAPH) IF(DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSG_LIBRARY) ADD_DEFINITIONS(-DOSG_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH) ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH) ENDIF()
SET(LIB_NAME osg) 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) 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) IF(OSG_FORCE_QUERY_RESULT_AVAILABLE_BEFORE_RETRIEVAL)
ADD_DEFINITIONS(-DFORCE_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}) 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) ADD_DEFINITIONS(-DOSGANIMATION_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH) ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH) ENDIF()
SET(LIB_NAME osgAnimation) SET(LIB_NAME osgAnimation)

View File

@ -1,12 +1,12 @@
IF (DYNAMIC_OPENSCENEGRAPH) IF(DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSGDB_LIBRARY) ADD_DEFINITIONS(-DOSGDB_LIBRARY)
# Add a default plugin search path component # Add a default plugin search path component
ADD_DEFINITIONS(-DOSG_DEFAULT_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib${LIB_POSTFIX}/${OSG_PLUGINS}) ADD_DEFINITIONS(-DOSG_DEFAULT_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib${LIB_POSTFIX}/${OSG_PLUGINS})
ELSE (DYNAMIC_OPENSCENEGRAPH) ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) 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") 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) ADD_DEFINITIONS(-DDARWIN_QUICKTIME)
ELSE(${OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX} STREQUAL "quicktime") ELSE()
ADD_DEFINITIONS(-DDARWIN_IMAGEIO) ADD_DEFINITIONS(-DDARWIN_IMAGEIO)
ENDIF(${OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX} STREQUAL "quicktime") ENDIF()
ENDIF()
ENDIF(APPLE)
IF(QUICKTIME_FOUND) IF(QUICKTIME_FOUND)
ADD_DEFINITIONS(-DUSE_QUICKTIME) ADD_DEFINITIONS(-DUSE_QUICKTIME)
ENDIF(QUICKTIME_FOUND) ENDIF()
IF(XINE_FOUND) IF(XINE_FOUND)
ADD_DEFINITIONS(-DUSE_XINE) ADD_DEFINITIONS(-DUSE_XINE)
ENDIF(XINE_FOUND) ENDIF()
IF(INVENTOR_FOUND) IF(INVENTOR_FOUND)
ADD_DEFINITIONS(-DUSE_INVENTOR) ADD_DEFINITIONS(-DUSE_INVENTOR)
ENDIF(INVENTOR_FOUND) ENDIF()
IF(OPENVRML_FOUND) IF(OPENVRML_FOUND)
ADD_DEFINITIONS(-DUSE_VRML) ADD_DEFINITIONS(-DUSE_VRML)
ENDIF(OPENVRML_FOUND) ENDIF()
ADD_DEFINITIONS(-DOSG_PLUGIN_EXTENSION=${CMAKE_SHARED_MODULE_SUFFIX}) 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) ADD_DEFINITIONS(-DOSGFX_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH) ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH) ENDIF()
SET(LIB_NAME osgFX) SET(LIB_NAME osgFX)
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME}) 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) ADD_DEFINITIONS(-DOSGGA_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH) ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH) ENDIF()
SET(LIB_NAME osgGA) SET(LIB_NAME osgGA)
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME}) 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) ADD_DEFINITIONS(-DOSGINTROSPECTION_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH) ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH) ENDIF()
SET(LIB_NAME osgIntrospection) SET(LIB_NAME osgIntrospection)
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME}) 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) ADD_DEFINITIONS(-DOSGMANIPULATOR_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH) ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH) ENDIF()
SET(LIB_NAME osgManipulator) SET(LIB_NAME osgManipulator)
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME}) 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) ADD_DEFINITIONS(-DOSGPARTICLE_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH) ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH) ENDIF()
SET(LIB_NAME osgParticle) SET(LIB_NAME osgParticle)
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME}) SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME})

View File

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

View File

@ -1,9 +1,9 @@
IF (DYNAMIC_OPENSCENEGRAPH) IF(DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSGSHADOW_LIBRARY) ADD_DEFINITIONS(-DOSGSHADOW_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH) ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH) ENDIF()
SET(LIB_NAME osgShadow) SET(LIB_NAME osgShadow)
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME}) 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) ADD_DEFINITIONS(-DOSGSIM_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH) ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH) ENDIF()
SET(LIB_NAME osgSim) SET(LIB_NAME osgSim)
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME}) 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) ADD_DEFINITIONS(-DOSGTERRAIN_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH) ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH) ENDIF()
SET(LIB_NAME osgTerrain) SET(LIB_NAME osgTerrain)
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME}) 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) ADD_DEFINITIONS(-DOSGTEXT_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH) ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH) ENDIF()
SET(LIB_NAME osgText) SET(LIB_NAME osgText)
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME}) 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 # FIXME: For OS X, need flag for Framework or dylib
IF (DYNAMIC_OPENSCENEGRAPH) IF(DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSGUTIL_LIBRARY) ADD_DEFINITIONS(-DOSGUTIL_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH) ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH) ENDIF()
SET(LIB_NAME osgUtil) SET(LIB_NAME osgUtil)
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME}) 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 # FIXME: For OS X, need flag for Framework or dylib
IF (DYNAMIC_OPENSCENEGRAPH) IF(DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSGVIEWER_LIBRARY) ADD_DEFINITIONS(-DOSGVIEWER_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH) ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH) ENDIF()
SET(LIB_NAME osgViewer) SET(LIB_NAME osgViewer)
@ -40,7 +40,6 @@ SET(LIB_COMMON_FILES
SET(LIB_EXTRA_LIBS) SET(LIB_EXTRA_LIBS)
IF(WIN32) IF(WIN32)
# #
# Enable workaround for OpenGL driver issues when used in multithreaded/multiscreen with NVidia drivers on Windows XP # 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) # 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) MARK_AS_ADVANCED(OSG_MULTIMONITOR_MULTITHREAD_WIN32_NVIDIA_WORKAROUND)
IF(OSG_MULTIMONITOR_MULTITHREAD_WIN32_NVIDIA_WORKAROUND) IF(OSG_MULTIMONITOR_MULTITHREAD_WIN32_NVIDIA_WORKAROUND)
ADD_DEFINITIONS(-DOSG_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} SET(LIB_PUBLIC_HEADERS ${LIB_PUBLIC_HEADERS}
${HEADER_PATH}/api/Win32/GraphicsWindowWin32 ${HEADER_PATH}/api/Win32/GraphicsWindowWin32
@ -62,17 +61,15 @@ IF(WIN32)
GraphicsWindowWin32.cpp GraphicsWindowWin32.cpp
PixelBufferWin32.cpp PixelBufferWin32.cpp
) )
ELSE()
ELSE(WIN32)
IF(APPLE) IF(APPLE)
SET(OSG_WINDOWING_SYSTEM "Carbon" CACHE STRING "Windowing system type for graphics window creation, options Carbon, Cocoa or X11.") 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") 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") IF(${OSG_WINDOWING_SYSTEM} STREQUAL "Cocoa")
ADD_DEFINITIONS(-DUSE_DARWIN_COCOA_IMPLEMENTATION) ADD_DEFINITIONS(-DUSE_DARWIN_COCOA_IMPLEMENTATION)
SET(LIB_PUBLIC_HEADERS ${LIB_PUBLIC_HEADERS} SET(LIB_PUBLIC_HEADERS ${LIB_PUBLIC_HEADERS}
${HEADER_PATH}/api/Cocoa/GraphicsWindowCocoa ${HEADER_PATH}/api/Cocoa/GraphicsWindowCocoa
${HEADER_PATH}/api/Cocoa/PixelBufferCocoa ${HEADER_PATH}/api/Cocoa/PixelBufferCocoa
@ -83,88 +80,72 @@ ELSE(WIN32)
DarwinUtils.mm DarwinUtils.mm
PixelBufferCocoa.mm PixelBufferCocoa.mm
) )
SET(LIB_EXTRA_LIBS ${COCOA_LIBRARY} ${LIB_EXTRA_LIBS})
SET(LIB_EXTRA_LIBS ${COCOA_LIBRARY} ${LIB_EXTRA_LIBS}) ELSEIF(${OSG_WINDOWING_SYSTEM} STREQUAL "Carbon")
ADD_DEFINITIONS(-DUSE_DARWIN_CARBON_IMPLEMENTATION)
ELSE(${OSG_WINDOWING_SYSTEM} STREQUAL "Cocoa") SET(LIB_PUBLIC_HEADERS ${LIB_PUBLIC_HEADERS}
IF(${OSG_WINDOWING_SYSTEM} STREQUAL "Carbon") ${HEADER_PATH}/api/Carbon/GraphicsWindowCarbon
ADD_DEFINITIONS(-DUSE_DARWIN_CARBON_IMPLEMENTATION) ${HEADER_PATH}/api/Carbon/PixelBufferCarbon
SET(LIB_PUBLIC_HEADERS ${LIB_PUBLIC_HEADERS} )
${HEADER_PATH}/api/Carbon/GraphicsWindowCarbon SET(LIB_COMMON_FILES ${LIB_COMMON_FILES}
${HEADER_PATH}/api/Carbon/PixelBufferCarbon GraphicsWindowCarbon.cpp
) DarwinUtils.h
SET(LIB_COMMON_FILES ${LIB_COMMON_FILES} DarwinUtils.mm
GraphicsWindowCarbon.cpp PixelBufferCarbon.cpp
DarwinUtils.h )
DarwinUtils.mm SET(LIB_EXTRA_LIBS ${COCOA_LIBRARY} ${LIB_EXTRA_LIBS})
PixelBufferCarbon.cpp ELSE()
) # X11 for everybody else
SET(LIB_EXTRA_LIBS ${COCOA_LIBRARY} ${LIB_EXTRA_LIBS}) INCLUDE(FindPkgConfig OPTIONAL)
IF(PKG_CONFIG_FOUND)
ELSE(${OSG_WINDOWING_SYSTEM} STREQUAL "Carbon") PKG_CHECK_MODULES(XRANDR xrandr)
IF(XRANDR_FOUND)
# X11 for everybody else OPTION(OSGVIEWER_USE_XRANDR "Set to ON to enable Xrandr support for GraphicsWindowX11." ON)
ELSE()
INCLUDE(FindPkgConfig OPTIONAL)
IF (PKG_CONFIG_FOUND)
PKG_CHECK_MODULES(XRANDR xrandr)
IF (XRANDR_FOUND)
OPTION(OSGVIEWER_USE_XRANDR "Set to ON to enable Xrandr support for GraphicsWindowX11." ON)
ELSE(XRANDR_FOUND)
SET(OSGVIEWER_USE_XRANDR OFF)
ENDIF (XRANDR_FOUND)
ELSE(PKG_CONFIG_FOUND)
SET(OSGVIEWER_USE_XRANDR OFF) SET(OSGVIEWER_USE_XRANDR OFF)
ENDIF(PKG_CONFIG_FOUND) ENDIF()
ELSE()
SET(OSGVIEWER_USE_XRANDR OFF)
ENDIF()
SET(LIB_PUBLIC_HEADERS ${LIB_PUBLIC_HEADERS}
${HEADER_PATH}/api/X11/GraphicsWindowX11
${HEADER_PATH}/api/X11/PixelBufferX11
)
SET(LIB_PUBLIC_HEADERS ${LIB_PUBLIC_HEADERS} SET(LIB_COMMON_FILES ${LIB_COMMON_FILES}
${HEADER_PATH}/api/X11/GraphicsWindowX11 GraphicsWindowX11.cpp
${HEADER_PATH}/api/X11/PixelBufferX11 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)
SET(LIB_EXTRA_LIBS ${X11_Xrandr_LIB} ${LIB_EXTRA_LIBS})
ELSE()
SET(LIB_EXTRA_LIBS ${XRANDR_LIBRARIES} ${LIB_EXTRA_LIBS})
ENDIF()
ENDIF()
SET(LIB_COMMON_FILES ${LIB_COMMON_FILES} # X11 on Apple requires X11 library plus OpenGL linking hack on Leopard
GraphicsWindowX11.cpp IF(APPLE)
PixelBufferX11.cpp # Find GL/glx.h
) IF(EXISTS ${CMAKE_OSX_SYSROOT}/usr/X11/include/GL/glx.h)
SET(OPENGL_INCLUDE_DIR /usr/X11/include)
IF(OSGVIEWER_USE_XRANDR) SET(OPENGL_LIBRARIES /usr/X11/lib/libGL.dylib)
ELSEIF(EXISTS ${CMAKE_OSX_SYSROOT}/usr/X11R6/include/GL/glx.h)
ADD_DEFINITIONS(-DOSGVIEWER_USE_XRANDR) SET(OPENGL_INCLUDE_DIR /usr/X11R6/include)
SET(LIB_PRIVATE_HEADERS ${LIB_PRIVATE_HEADERS} ${XRANDR_INCLUDE_DIRS} ) SET(OPENGL_LIBRARIES /usr/X11R6/lib/libGL.dylib)
ENDIF()
INCLUDE_DIRECTORIES(BEFORE SYSTEM ${OPENGL_INCLUDE_DIR})
IF (X11_Xrandr_LIB) SET(LIB_EXTRA_LIBS ${X11_X11_LIB} ${OPENGL_LIBRARIES} ${LIB_EXTRA_LIBS})
SET(LIB_EXTRA_LIBS ${X11_Xrandr_LIB} ${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")
ELSE(X11_Xrandr_LIB) ENDIF(APPLE)
SET(LIB_EXTRA_LIBS ${XRANDR_LIBRARIES} ${LIB_EXTRA_LIBS}) ENDIF()
ENDIF(X11_Xrandr_LIB) ENDIF()
ENDIF(OSGVIEWER_USE_XRANDR)
# X11 on Apple requires X11 library plus OpenGL linking hack on Leopard
IF(APPLE)
# Find GL/glx.h
IF(EXISTS ${CMAKE_OSX_SYSROOT}/usr/X11/include/GL/glx.h)
SET(OPENGL_INCLUDE_DIR /usr/X11/include)
SET(OPENGL_LIBRARIES /usr/X11/lib/libGL.dylib)
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)
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)
ADD_LIBRARY(${LIB_NAME} ADD_LIBRARY(${LIB_NAME}
@ -189,11 +170,11 @@ LINK_CORELIB_DEFAULT(${LIB_NAME})
IF(MINGW OR CYGWIN) IF(MINGW OR CYGWIN)
LINK_EXTERNAL(${LIB_NAME} gdi32 ) LINK_EXTERNAL(${LIB_NAME} gdi32 )
ENDIF(MINGW OR CYGWIN) ENDIF()
INCLUDE(ModuleInstall OPTIONAL) INCLUDE(ModuleInstall OPTIONAL)
FOREACH( INCLUDEFILE ${LIB_PUBLIC_HEADERS} ) FOREACH(INCLUDEFILE ${LIB_PUBLIC_HEADERS} )
FILE(RELATIVE_PATH REL_INCLUDEFILE ${HEADER_PATH} ${INCLUDEFILE}) FILE(RELATIVE_PATH REL_INCLUDEFILE ${HEADER_PATH} ${INCLUDEFILE})
GET_FILENAME_COMPONENT(REL_INCLUDE_PATH ${REL_INCLUDEFILE} PATH) GET_FILENAME_COMPONENT(REL_INCLUDE_PATH ${REL_INCLUDEFILE} PATH)
INSTALL( INSTALL(
@ -201,4 +182,4 @@ FOREACH( INCLUDEFILE ${LIB_PUBLIC_HEADERS} )
DESTINATION ${INSTALL_INCDIR}/${LIB_NAME}/${REL_INCLUDE_PATH} DESTINATION ${INSTALL_INCDIR}/${LIB_NAME}/${REL_INCLUDE_PATH}
COMPONENT libopenscenegraph-dev COMPONENT libopenscenegraph-dev
) )
ENDFOREACH( INCLUDEFILE) ENDFOREACH()

View File

@ -1,9 +1,9 @@
IF (DYNAMIC_OPENSCENEGRAPH) IF(DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSGVOLUME_LIBRARY) ADD_DEFINITIONS(-DOSGVOLUME_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH) ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH) ENDIF()
SET(LIB_NAME osgVolume) SET(LIB_NAME osgVolume)
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME}) 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) ADD_DEFINITIONS(-DOSGWIDGET_LIBRARY)
ELSE (DYNAMIC_OPENSCENEGRAPH) ELSE()
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(DYNAMIC_OPENSCENEGRAPH) ENDIF()
SET(LIB_NAME osgWidget) SET(LIB_NAME osgWidget)
SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME}) SET(HEADER_PATH ${OpenSceneGraph_SOURCE_DIR}/include/${LIB_NAME})

View File

@ -1,18 +1,18 @@
PROJECT(OSG_WRAPPERS) PROJECT(OSG_WRAPPERS)
IF (NOT DYNAMIC_OPENSCENEGRAPH) IF(NOT DYNAMIC_OPENSCENEGRAPH)
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ENDIF(NOT DYNAMIC_OPENSCENEGRAPH) ENDIF()
SET(LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH}/${OSG_PLUGINS}") SET(LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH}/${OSG_PLUGINS}")
SET(CMAKE_SHARED_MODULE_PREFIX ${OSG_PLUGIN_PREFIX}) SET(CMAKE_SHARED_MODULE_PREFIX ${OSG_PLUGIN_PREFIX})
IF(MSVC80) IF(MSVC80)
IF(NOT OSG_MSVC_GENERATE_PLUGINS_AND_WRAPPERS_MANIFESTS) IF(NOT OSG_MSVC_GENERATE_PLUGINS_AND_WRAPPERS_MANIFESTS)
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /MANIFEST:NO") SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /MANIFEST:NO")
ENDIF(NOT OSG_MSVC_GENERATE_PLUGINS_AND_WRAPPERS_MANIFESTS) ENDIF()
ENDIF(MSVC80) ENDIF()
MACRO(ADD_WRAPPER_LIB SUBDIR EXPORTDEF) MACRO(ADD_WRAPPER_LIB SUBDIR EXPORTDEF)
SET(TARGET_NAME "osgwrapper_${SUBDIR}") SET(TARGET_NAME "osgwrapper_${SUBDIR}")
@ -41,12 +41,10 @@ MACRO(ADD_WRAPPER_LIB SUBDIR EXPORTDEF)
# MESSAGE(STATUS "STORED LIST [${LISTNAME}] = (${CURRLIST})") # MESSAGE(STATUS "STORED LIST [${LISTNAME}] = (${CURRLIST})")
SET(LISTNAME ${ARG}) SET(LISTNAME ${ARG})
REMOVE(CURRLIST ${CURRLIST} ) REMOVE(CURRLIST ${CURRLIST} )
ELSE()
ELSE(${EXPRESSION})
SET(CURRLIST ${CURRLIST} ${ARG}) SET(CURRLIST ${CURRLIST} ${ARG})
ENDIF()
ENDIF(${EXPRESSION}) ENDFOREACH()
ENDFOREACH(ARG)
SET(${LISTNAME} ${CURRLIST}) SET(${LISTNAME} ${CURRLIST})
#MESSAGE(STATUS "STORED LIST [${LISTNAME}] = (${CURRLIST})") #MESSAGE(STATUS "STORED LIST [${LISTNAME}] = (${CURRLIST})")
REMOVE(CURRLIST ${CURRLIST} ) REMOVE(CURRLIST ${CURRLIST} )
@ -54,49 +52,45 @@ MACRO(ADD_WRAPPER_LIB SUBDIR EXPORTDEF)
#MESSAGE(STATUS "AFTER: EXC (${EXCLUDE}) DEF (${DEFINE}) LINK (${LINK})") #MESSAGE(STATUS "AFTER: EXC (${EXCLUDE}) DEF (${DEFINE}) LINK (${LINK})")
FOREACH(EXF ${EXCLUDE}) FOREACH(EXF ${EXCLUDE})
REMOVE(SRC_FILES ${OPENSCENEGRAPH_DIR}/src/${SUBDIR}/${EXF}) REMOVE(SRC_FILES ${OPENSCENEGRAPH_DIR}/src/${SUBDIR}/${EXF})
ENDFOREACH(EXF) ENDFOREACH()
FOREACH(DEF ${DEFINE}) FOREACH(DEF ${DEFINE})
SET(DEFSTR "${DEFSTR} /D \"${DEF}\"") SET(DEFSTR "${DEFSTR} /D \"${DEF}\"")
#MESSAGE(STATUS "add symbol : " ${DEF}) #MESSAGE(STATUS "add symbol : " ${DEF})
ENDFOREACH(DEF) ENDFOREACH()
IF(NOT DEFSTR STREQUAL "") IF(NOT DEFSTR STREQUAL "")
SET_SOURCE_FILES_PROPERTIES(${SRC_FILES} PROPERTIES COMPILE_FLAGS ${DEFSTR}) SET_SOURCE_FILES_PROPERTIES(${SRC_FILES} PROPERTIES COMPILE_FLAGS ${DEFSTR})
#MESSAGE(STATUS "********* ADD 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} SHARED ${SRC_FILES} )
ADD_LIBRARY(${TARGET_NAME} MODULE ${SRC_FILES} ) ADD_LIBRARY(${TARGET_NAME} MODULE ${SRC_FILES} )
#not sure if needed, but for plugins only msvc need the d suffix #not sure if needed, but for plugins only msvc need the d suffix
IF(NOT MSVC) IF(NOT MSVC)
SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES DEBUG_POSTFIX "") SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES DEBUG_POSTFIX "")
ELSE(NOT MSVC) ELSE()
IF(OSG_MSVC_VERSIONED_DLL) 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
#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
#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,
#because we want dll placed in OUTPUT_BINDIR ie the bin folder sibling of lib, we can use ../../bin to go there, #it is hardcoded, we should compute OUTPUT_BINDIR position relative to OUTPUT_LIBDIR ... to be implemented
#it is hardcoded, we should compute OUTPUT_BINDIR position relative to OUTPUT_LIBDIR ... to be implemented #changing bin to something else breaks this hack
#changing bin to something else breaks this hack #the dll are placed in bin/${OSG_PLUGINS}
#the dll are placed in bin/${OSG_PLUGINS}
IF(NOT MSVC_IDE)
SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES PREFIX "../bin/${OSG_PLUGINS}/")
ELSE(NOT MSVC_IDE)
SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES PREFIX "../../bin/${OSG_PLUGINS}/" IMPORT_PREFIX "../")
ENDIF(NOT MSVC_IDE)
ELSE(OSG_MSVC_VERSIONED_DLL)
IF(NOT MSVC_IDE)
SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES PREFIX "../bin/${OSG_PLUGINS}/")
ELSE()
SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES PREFIX "../../bin/${OSG_PLUGINS}/" IMPORT_PREFIX "../")
ENDIF()
ELSE()
#in standard mode (unversioned) the .lib and .dll are placed in lib/<debug or release>/${OSG_PLUGINS}. #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 #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}/") SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES PREFIX "${OSG_PLUGINS}/")
ENDIF(OSG_MSVC_VERSIONED_DLL) ENDIF()
ENDIF(NOT MSVC) ENDIF()
SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES DEFINE_SYMBOL "${EXPORTDEF}" PROJECT_LABEL "Wrapper ${SUBDIR}") SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES DEFINE_SYMBOL "${EXPORTDEF}" PROJECT_LABEL "Wrapper ${SUBDIR}")
IF(MSVC AND OSG_MSVC_VERSIONED_DLL) 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 #when using full path name to specify linkage, it seems that already linked libs must be specified
LINK_EXTERNAL(${TARGET_NAME} ${OPENGL_LIBRARIES}) LINK_EXTERNAL(${TARGET_NAME} ${OPENGL_LIBRARIES})
ELSE(MSVC AND OSG_MSVC_VERSIONED_DLL) ELSE()
TARGET_LINK_LIBRARIES(${TARGET_NAME} ${LINK}) TARGET_LINK_LIBRARIES(${TARGET_NAME} ${LINK})
ENDIF(MSVC AND OSG_MSVC_VERSIONED_DLL) ENDIF()
#MESSAGE(STATUS "--TARGET_LINK_LIBRARIES-->${TARGET_NAME}<->${LINK}<-") #MESSAGE(STATUS "--TARGET_LINK_LIBRARIES-->${TARGET_NAME}<->${LINK}<-")
#FIXME: Deprecated
REMOVE(DEFINE ${DEFINE}) REMOVE(DEFINE ${DEFINE})
REMOVE(LINK ${LINK}) REMOVE(LINK ${LINK})
REMOVE(EXCLUDE ${EXCLUDE}) REMOVE(EXCLUDE ${EXCLUDE})
IF(WIN32) IF(WIN32)
INSTALL(TARGETS ${TARGET_NAME} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib/${OSG_PLUGINS} LIBRARY DESTINATION bin/${OSG_PLUGINS} COMPONENT libopenscenegraph-wrappers) INSTALL(TARGETS ${TARGET_NAME}
ELSE(WIN32) RUNTIME DESTINATION bin
INSTALL(TARGETS ${TARGET_NAME} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} LIBRARY DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} COMPONENT libopenscenegraph-wrappers) ARCHIVE DESTINATION lib/${OSG_PLUGINS}
ENDIF(WIN32) 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) ENDMACRO(ADD_WRAPPER_LIB)
SET(OSGWRAPPER_LIB_LIST SET(OSGWRAPPER_LIB_LIST
OpenThreads OpenThreads
osg osg
@ -144,9 +144,11 @@ SET(OSGWRAPPER_LIB_LIST
SET(OSGWRAPPER_DIR ${CMAKE_CURRENT_SOURCE_DIR}) SET(OSGWRAPPER_DIR ${CMAKE_CURRENT_SOURCE_DIR})
IF(MSVC) IF(MSVC)
SET(LIBRARY_OUTPUT_PATH ${OUTPUT_LIBDIR}) SET(LIBRARY_OUTPUT_PATH ${OUTPUT_LIBDIR})
ENDIF(MSVC) ENDIF()
FOREACH(LIB ${OSGWRAPPER_LIB_LIST} )
ADD_WRAPPER_LIB(${LIB} OSGWRAPPERS_LIBRARY LINK OpenThreads osg osgGA ${LIB} osgIntrospection) FOREACH(LIB ${OSGWRAPPER_LIB_LIST})
ENDFOREACH(LIB ${OSGWRAPPER_LIB_LIST} ) ADD_WRAPPER_LIB(${LIB} OSGWRAPPERS_LIBRARY LINK OpenThreads osg osgGA ${LIB} osgIntrospection)
ENDFOREACH()