Ran dos2unix

This commit is contained in:
Robert Osfield
2007-03-09 09:07:05 +00:00
parent 426afa3e70
commit 5df9754bfc

View File

@@ -1,185 +1,198 @@
PROJECT(OpenSceneGraph) CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6 FATAL_ERROR)
# We have some custom .cmake scripts not in the official distribution. PROJECT(OpenSceneGraph)
# Maybe this can be used override existing behavior if needed?
SET(CMAKE_MODULE_PATH "${OpenSceneGraph_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}") # We have some custom .cmake scripts not in the official distribution.
# Maybe this can be used override existing behavior if needed?
# Mainly for Windows as a convenience. This will find a directory in parallel with the SET(CMAKE_MODULE_PATH "${OpenSceneGraph_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
# OSG source that contains 3rd party headers and libraries.
# Use of relative paths in CMake is ill-advised, but don't know of any alternatives in this case # Mainly for Windows as a convenience. This will find a directory in parallel with the
SET(CMAKE_INCLUDE_PATH "${OpenSceneGraph_SOURCE_DIR}/../3rdParty/include;${CMAKE_INCLUDE_PATH}") # OSG source that contains 3rd party headers and libraries.
SET(CMAKE_LIBRARY_PATH "${OpenSceneGraph_SOURCE_DIR}/../3rdParty/lib;${CMAKE_LIBRARY_PATH}") # Use of relative paths in CMake is ill-advised, but don't know of any alternatives in this case
IF(USING_OSG_OP_OT_TRIPLE_SET) SET(CMAKE_INCLUDE_PATH "${OpenSceneGraph_SOURCE_DIR}/../3rdParty/include;${CMAKE_INCLUDE_PATH}")
SET(CMAKE_INCLUDE_PATH "${OpenSceneGraph_SOURCE_DIR}/../../3rdParty/include;${CMAKE_INCLUDE_PATH}") SET(CMAKE_LIBRARY_PATH "${OpenSceneGraph_SOURCE_DIR}/../3rdParty/lib;${CMAKE_LIBRARY_PATH}")
SET(CMAKE_LIBRARY_PATH "${OpenSceneGraph_SOURCE_DIR}/../../3rdParty/lib;${CMAKE_LIBRARY_PATH}") IF(USING_OSG_OP_OT_TRIPLE_SET)
ENDIF(USING_OSG_OP_OT_TRIPLE_SET) SET(CMAKE_INCLUDE_PATH "${OpenSceneGraph_SOURCE_DIR}/../../3rdParty/include;${CMAKE_INCLUDE_PATH}")
SET(CMAKE_LIBRARY_PATH "${OpenSceneGraph_SOURCE_DIR}/../../3rdParty/lib;${CMAKE_LIBRARY_PATH}")
ENDIF(USING_OSG_OP_OT_TRIPLE_SET)
# FIXME: The FindOpenThreads stuff below is not quite correct.
# The problem is that if we are building OpenSceneGraph by itself
# (not part of the triple-set OT/OP/OSG source), then we need to hunt # FIXME: The FindOpenThreads stuff below is not quite correct.
# down the OpenThreads library on the system. # The problem is that if we are building OpenSceneGraph by itself
# But if we are building as part of the triple-set, then we want to # (not part of the triple-set OT/OP/OSG source), then we need to hunt
# refer to the version in the triple set. But this gets harder because # down the OpenThreads library on the system.
# FIND_LIBRARY will fail to pick the triple set version in this case # But if we are building as part of the triple-set, then we want to
# because the library is not yet built when running this CMake script. # refer to the version in the triple set. But this gets harder because
# # FIND_LIBRARY will fail to pick the triple set version in this case
# Maybe we need a global flag (set in the root CMakeLists.txt) # because the library is not yet built when running this CMake script.
# that tells us which scenario we are doing. #
# And in the triple set case, we skip this check. # Maybe we need a global flag (set in the root CMakeLists.txt)
# that tells us which scenario we are doing.
IF(USING_OSG_OP_OT_TRIPLE_SET) # And in the triple set case, we skip this check.
# MESSAGE("OSG: Using TripleSet, ${OpenThreads_SOURCE_DIR}.")
# So I think the fall-out is that all the OpenThreads variables IF(USING_OSG_OP_OT_TRIPLE_SET)
# that have been set are still in play. So the include paths are still # MESSAGE("OSG: Using TripleSet, ${OpenThreads_SOURCE_DIR}.")
# visible, and the library is still set. # So I think the fall-out is that all the OpenThreads variables
# To keep the same code paths # that have been set are still in play. So the include paths are still
SET(OPENTHREADS_LIBRARY OpenThreads) # visible, and the library is still set.
SET(OPENTHREADS_INCLUDE_DIR ${OpenThreads_SOURCE_DIR}/include) # To keep the same code paths
SET(OPENTHREADS_LIBRARY OpenThreads)
# MESSAGE("Lib: ${OPENTHREADS_LIBRARY}") SET(OPENTHREADS_INCLUDE_DIR ${OpenThreads_SOURCE_DIR}/include)
# MESSAGE("Lib: ${OPENTHREADS_LIBRARY}")
ELSE(USING_OSG_OP_OT_TRIPLE_SET)
# MESSAGE("OSG: Not using Triple Set")
FIND_PACKAGE(OpenThreads REQUIRED) ELSE(USING_OSG_OP_OT_TRIPLE_SET)
# MESSAGE("OSG: Not using Triple Set")
ENDIF(USING_OSG_OP_OT_TRIPLE_SET)# Find OpenGL FIND_PACKAGE(OpenThreads REQUIRED)
FIND_PACKAGE(OpenGL)
ENDIF(USING_OSG_OP_OT_TRIPLE_SET)# Find OpenGL
IF(APPLE) FIND_PACKAGE(OpenGL)
FIND_LIBRARY(CARBON_LIBRARY Carbon)
FIND_LIBRARY(COCOA_LIBRARY Cocoa) IF(APPLE)
ENDIF(APPLE) FIND_LIBRARY(CARBON_LIBRARY Carbon)
FIND_LIBRARY(COCOA_LIBRARY Cocoa)
IF(UNIX) ENDIF(APPLE)
# Not sure what this will do on Cygwin and Msys
# Also, remember OS X X11 is a user installed option so it may not exist. IF(UNIX)
FIND_PACKAGE(X11) # Not sure what this will do on Cygwin and Msys
ENDIF(UNIX) # Also, remember OS X X11 is a user installed option so it may not exist.
FIND_PACKAGE(X11)
# Make the headers visible to everything ENDIF(UNIX)
INCLUDE_DIRECTORIES(
${OpenSceneGraph_SOURCE_DIR}/include # Make the headers visible to everything
${OPENTHREADS_INCLUDE_DIR} INCLUDE_DIRECTORIES(
${OPENGL_INCLUDE_DIR} ${OpenSceneGraph_SOURCE_DIR}/include
) ${OPENTHREADS_INCLUDE_DIR}
${OPENGL_INCLUDE_DIR}
# Common global definitions )
#ADD_DEFINITIONS(-D)
# Platform specific definitions # Common global definitions
#ADD_DEFINITIONS(-D)
IF(WIN32) # Platform specific definitions
# Both Cygwin and Msys need -DNOMINMAX ???
IF(UNIX) IF(WIN32)
ADD_DEFINITIONS(-DNOMINMAX) # Both Cygwin and Msys need -DNOMINMAX ???
ENDIF(UNIX) IF(UNIX)
ENDIF(WIN32) ADD_DEFINITIONS(-DNOMINMAX)
ENDIF(UNIX)
ENDIF(WIN32)
################################################################################
# 3rd Party Dependency Stuff
################################################################################
# Common to all platforms: # 3rd Party Dependency Stuff
FIND_PACKAGE(FreeType)
# Common to all platforms:
FIND_PACKAGE(FreeType)
# Platform specific:
# (We can approach this one of two ways. We can try to FIND everything
# and simply check if we found the packages before actually building # Platform specific:
# or we can hardcode the cases. The advantage of the former is that # (We can approach this one of two ways. We can try to FIND everything
# packages that are installed on platforms that don't require them # and simply check if we found the packages before actually building
# will still get built (presuming no compatibility issues). But this # or we can hardcode the cases. The advantage of the former is that
# also means modules that are redundant may get built. For example, # packages that are installed on platforms that don't require them
# OS X doesn't need GIF, JPEG, PNG, TIFF, etc because it uses QuickTime. # will still get built (presuming no compatibility issues). But this
# Also, it will clutter the CMake menu with "NOT_FOUND". # also means modules that are redundant may get built. For example,
# The downside to the latter is that it is harder to build those # OS X doesn't need GIF, JPEG, PNG, TIFF, etc because it uses QuickTime.
# potentially redundant modules.) # Also, it will clutter the CMake menu with "NOT_FOUND".
# The downside to the latter is that it is harder to build those
# Image readers/writers depend on 3rd party libraries except for OS X which # potentially redundant modules.)
# can use Quicktime.
IF(NOT APPLE) # Image readers/writers depend on 3rd party libraries except for OS X which
FIND_PACKAGE(GIFLIB) # can use Quicktime.
FIND_PACKAGE(JPEG) IF(NOT APPLE)
FIND_PACKAGE(PNG) FIND_PACKAGE(GIFLIB)
FIND_PACKAGE(TIFF) FIND_PACKAGE(JPEG)
FIND_PACKAGE(PNG)
# QuickTime is required for OS X, but optional for Windows. FIND_PACKAGE(TIFF)
IF(WIN32)
FIND_PACKAGE(QuickTime) # QuickTime is required for OS X, but optional for Windows.
ENDIF(WIN32) IF(WIN32)
FIND_PACKAGE(QuickTime)
ELSE(NOT APPLE) ENDIF(WIN32)
FIND_PACKAGE(QuickTime)
ENDIF(NOT APPLE) ELSE(NOT APPLE)
FIND_PACKAGE(QuickTime)
ENDIF(NOT APPLE)
################################################################################
# Installation stuff
################################################################################
SET(CMAKE_DEBUG_POSTFIX "d") # Installation stuff
#SET(INSTALL_BINDIR OpenSceneGraph/bin)
#SET(INSTALL_INCDIR OpenSceneGraph/include) SET(CMAKE_DEBUG_POSTFIX "d")
#SET(INSTALL_LIBDIR OpenSceneGraph/lib)
#SET(INSTALL_DOCDIR OpenSceneGraph/doc) SET(OUTPUT_BINDIR ${PROJECT_BINARY_DIR}/bin/${CMAKE_SYSTEM_NAME})
MAKE_DIRECTORY(${OUTPUT_BINDIR})
################################################################################ SET(EXECUTABLE_OUTPUT_PATH ${OUTPUT_BINDIR})
# User Options
SET(OUTPUT_LIBDIR ${PROJECT_BINARY_DIR}/lib/${CMAKE_SYSTEM_NAME})
# Dynamic vs Static Linking MAKE_DIRECTORY(${OUTPUT_LIBDIR})
OPTION(DYNAMIC_OPENSCENEGRAPH "Set to ON to build OpenSceneGraph for dynamic linking. Use OFF for static." ON) SET(LIBRARY_OUTPUT_PATH ${OUTPUT_LIBDIR})
IF (DYNAMIC_OPENSCENEGRAPH)
SET(OPENSCENEGRAPH_USER_DEFINED_DYNAMIC_OR_STATIC "SHARED")
ELSE (DYNAMIC_OPENSCENEGRAPH)
SET(OPENSCENEGRAPH_USER_DEFINED_DYNAMIC_OR_STATIC "STATIC") #SET(INSTALL_BINDIR OpenSceneGraph/bin)
ENDIF(DYNAMIC_OPENSCENEGRAPH) #SET(INSTALL_INCDIR OpenSceneGraph/include)
#SET(INSTALL_LIBDIR OpenSceneGraph/lib)
# OSG Core #SET(INSTALL_DOCDIR OpenSceneGraph/doc)
ADD_SUBDIRECTORY(src)
################################################################################
# OSG Applications # User Options
OPTION(BUILD_OSG_APPLICATIONS "Enable to build OSG Applications (e.g. osgviewer)" ON)
IF (BUILD_OSG_APPLICATIONS) # Dynamic vs Static Linking
ADD_SUBDIRECTORY(applications) OPTION(DYNAMIC_OPENSCENEGRAPH "Set to ON to build OpenSceneGraph for dynamic linking. Use OFF for static." ON)
ENDIF(BUILD_OSG_APPLICATIONS) IF (DYNAMIC_OPENSCENEGRAPH)
SET(OPENSCENEGRAPH_USER_DEFINED_DYNAMIC_OR_STATIC "SHARED")
# OSG Examples ELSE (DYNAMIC_OPENSCENEGRAPH)
OPTION(BUILD_OSG_EXAMPLES "Enable to build OSG Examples" OFF) SET(OPENSCENEGRAPH_USER_DEFINED_DYNAMIC_OR_STATIC "STATIC")
IF (BUILD_OSG_EXAMPLES) ENDIF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(examples)
ENDIF(BUILD_OSG_EXAMPLES) # OSG Core
ADD_SUBDIRECTORY(src)
# OSG Applications
# For Doxygen OPTION(BUILD_OSG_APPLICATIONS "Enable to build OSG Applications (e.g. osgviewer)" ON)
#FIXME: I haven't figured out what to do with OSG's multiple doxyfiles IF (BUILD_OSG_APPLICATIONS)
# and footer. ADD_SUBDIRECTORY(applications)
INCLUDE(${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL) ENDIF(BUILD_OSG_APPLICATIONS)
# To build the documention, you will have to enable it # OSG Examples
# and then do the equivalent of "make DoxygenDoc". OPTION(BUILD_OSG_EXAMPLES "Enable to build OSG Examples" OFF)
IF(BUILD_DOCUMENTATION) IF (BUILD_OSG_EXAMPLES)
IF(DOT) ADD_SUBDIRECTORY(examples)
SET(HAVE_DOT YES) ENDIF(BUILD_OSG_EXAMPLES)
ELSE(DOT)
SET(HAVE_DOT NO)
ENDIF(DOT)
# This processes our Doxyfile.in and substitutes paths to generate # For Doxygen
# a final Doxyfile #FIXME: I haven't figured out what to do with OSG's multiple doxyfiles
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/Doxyfiles/doxyfile.cmake # and footer.
${PROJECT_BINARY_DIR}/doc/doxyfile INCLUDE(${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL)
)
# This creates a new target to build documentation. # To build the documention, you will have to enable it
# It runs ${DOXYGEN} which is the full path and executable to # and then do the equivalent of "make DoxygenDoc".
# Doxygen on your system, set by the FindDoxygen.cmake module IF(BUILD_DOCUMENTATION)
# (called by FindDocumentation.cmake). IF(DOT)
# It runs the final generated Doxyfile against it. SET(HAVE_DOT YES)
# The DOT_PATH is substituted into the Doxyfile. ELSE(DOT)
ADD_CUSTOM_TARGET(DoxygenDoc ${DOXYGEN} SET(HAVE_DOT NO)
${PROJECT_BINARY_DIR}/docs/doxyfile ENDIF(DOT)
) # This processes our Doxyfile.in and substitutes paths to generate
ENDIF(BUILD_DOCUMENTATION) # a final Doxyfile
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/Doxyfiles/doxyfile.cmake
${PROJECT_BINARY_DIR}/doc/doxyfile
)
# This creates a new target to build documentation.
# It runs ${DOXYGEN} which is the full path and executable to
# Doxygen on your system, set by the FindDoxygen.cmake module
# (called by FindDocumentation.cmake).
# It runs the final generated Doxyfile against it.
# The DOT_PATH is substituted into the Doxyfile.
ADD_CUSTOM_TARGET(DoxygenDoc ${DOXYGEN}
${PROJECT_BINARY_DIR}/docs/doxyfile
)
ENDIF(BUILD_DOCUMENTATION)