Browse files

changed: example install, installed example build

  • Loading branch information...
1 parent cfe6993 commit 6d0c32cfddbee575ad5e300d7244c1f4e1eea3e6 @vossg committed May 17, 2012
View
26 CMake/FindCollada.cmake
@@ -69,6 +69,19 @@ IF(COLLADA_ROOT_DIR)
"${__COLLADA_LIBRARY_SEARCH_DIRS}")
ENDIF(COLLADA_ROOT_DIR)
+IF(OSG_SUPPORT_ROOT AND OSG_USE_OSGSUPPORT_LIBS)
+ FILE(TO_CMAKE_PATH ${OSG_SUPPORT_ROOT} _OSG_SUPPORT_ROOT)
+
+ SET(__COLLADA_INCLUDE_SEARCH_DIRS "${_OSG_SUPPORT_ROOT}/include"
+ "${_OSG_SUPPORT_ROOT}/include/colladadom"
+ "${_OSG_SUPPORT_ROOT}/include/collada-dom"
+ "${__COLLADA_INCLUDE_SEARCH_DIRS}")
+ SET(__COLLADA_LIBRARY_SEARCH_DIRS "${_OSG_SUPPORT_ROOT}/lib"
+ "${_OSG_SUPPORT_ROOT}/lib64"
+ "${__COLLADA_LIBRARY_SEARCH_DIRS}")
+ENDIF(OSG_SUPPORT_ROOT AND OSG_USE_OSGSUPPORT_LIBS)
+
+
# handle COLLADA_INCLUDE_DIR input variable
IF(COLLADA_INCLUDE_DIR)
FILE(TO_CMAKE_PATH ${COLLADA_INCLUDE_DIR} COLLADA_INCLUDE_DIR)
@@ -92,6 +105,17 @@ FIND_PATH(COLLADA_DOM_INCLUDE_DIR "dom/domNode.h"
PATHS ${__COLLADA_INCLUDE_SEARCH_DIRS}
PATH_SUFFIXES "1.4")
+IF(OSG_USE_OSGSUPPORT_LIBS)
+# locate libraries
+FIND_LIBRARY(COLLADA_LIBRARY_RELEASE
+ NAMES osgcollada14dom22 osgcollada14dom22lib collada_dom collada14dom libcollada14dom21
+ PATHS ${__COLLADA_LIBRARY_SEARCH_DIRS})
+
+FIND_LIBRARY(COLLADA_LIBRARY_DEBUG
+ NAMES osgcollada14dom22 osgcollada14dom22lib collada_dom-d collada14dom-d libcollada14dom21-d
+ PATH_SUFFIXES debug
+ PATHS ${__COLLADA_LIBRARY_SEARCH_DIRS})
+ELSE()
# locate libraries
FIND_LIBRARY(COLLADA_LIBRARY_RELEASE
NAMES collada_dom collada14dom libcollada14dom21
@@ -100,7 +124,7 @@ FIND_LIBRARY(COLLADA_LIBRARY_RELEASE
FIND_LIBRARY(COLLADA_LIBRARY_DEBUG
NAMES collada_dom-d collada14dom-d libcollada14dom21-d
PATHS ${__COLLADA_LIBRARY_SEARCH_DIRS})
-
+ENDIF()
# handle the QUIETLY and REQUIRED arguments and set COLLADA_FOUND to TRUE if
# all listed variables are TRUE
View
11 CMakeLists.txt
@@ -132,6 +132,7 @@ IF(WIN32)
ENDIF(WIN32)
OSG_OPTION(OSG_INSTALL_EXAMPLES "" OFF)
+OSG_OPTION(OSG_INSTALL_EXAMPLE_EXE "" OFF)
OSG_OPTION(OSG_INSTALL_APPS "" ON)
OSG_OPTION(OSGCOMPAT_ENABLE "" OFF)
@@ -1913,9 +1914,13 @@ ENDIF()
# Images/Icons
##################
-#INSTALL(DIRECTORY "${CMAKE_SOURCE_DIR}/Data/Images"
-# DESTINATION share/OpenSG
-# COMPONENT data_images)
+##################
+# CSM Example
+##################
+
+INSTALL(DIRECTORY "${CMAKE_SOURCE_DIR}/Examples/CSM"
+ DESTINATION share/OpenSG/Examples/
+ COMPONENT examples_basic)
##################
# Packaging
View
44 Examples/Advanced/Character/CMakeLists.fromosg.txt
@@ -96,20 +96,52 @@ FOREACH(SRC ${SRCFILES})
ENDFOREACH()
#Install
- IF(OSG_INSTALL_EXAMPLES)
+ IF(OSG_INSTALL_EXAMPLES_EXE)
INSTALL(TARGETS ${EXE}
- DESTINATION share/OpenSG/Examples/Advanced
+ DESTINATION share/OpenSG/Examples/Advanced/Character
COMPONENT examples_advanced)
+ ENDIF()
+ IF(OSG_INSTALL_EXAMPLES)
INSTALL(FILES "${SRC}"
- DESTINATION share/OpenSG/Examples/Advanced
+ DESTINATION share/OpenSG/Examples/Advanced/Character
COMPONENT examples_advanced)
ENDIF()
ENDFOREACH(SRC)
#GLSL files
IF(OSG_INSTALL_EXAMPLES)
- FILE(GLOB GLSLFILES "*.glsl")
- INSTALL(FILES ${GLSLFILES}
- DESTINATION share/OpenSG/Examples/Advanced
+ INSTALL(FILES CMakeLists.standalone.txt
+ DESTINATION share/OpenSG/Examples/Advanced/Character
+ RENAME CMakeLists.txt
+ COMPONENT examples_advanced)
+
+ FILE(GLOB GLOBFILES "*.glsl")
+ INSTALL(FILES ${GLOBFILES}
+ DESTINATION share/OpenSG/Examples/Advanced/Character
+ COMPONENT examples_advanced)
+
+ FILE(GLOB GLOBFILES "*.tga")
+ INSTALL(FILES ${GLOBFILES}
+ DESTINATION share/OpenSG/Examples/Advanced/Character
+ COMPONENT examples_advanced)
+
+ FILE(GLOB GLOBFILES "*.png")
+ INSTALL(FILES ${GLOBFILES}
+ DESTINATION share/OpenSG/Examples/Advanced/Character
+ COMPONENT examples_advanced)
+
+ FILE(GLOB GLOBFILES "*.jpg")
+ INSTALL(FILES ${GLOBFILES}
+ DESTINATION share/OpenSG/Examples/Advanced/Character
+ COMPONENT examples_advanced)
+
+ FILE(GLOB GLOBFILES "*.mesh")
+ INSTALL(FILES ${GLOBFILES}
+ DESTINATION share/OpenSG/Examples/Advanced/Character
+ COMPONENT examples_advanced)
+
+ FILE(GLOB GLOBFILES "*.skeleton")
+ INSTALL(FILES ${GLOBFILES}
+ DESTINATION share/OpenSG/Examples/Advanced/Character
COMPONENT examples_advanced)
ENDIF()
View
20 Examples/Advanced/Character/CMakeLists.standalone.txt
@@ -5,11 +5,27 @@ PROJECT(OpenSGExamplesAdvancedCharcter)
MESSAGE(STATUS "Building ${PROJECT_NAME} standalone")
-SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${$PROJECT_NAME}_SOURCE_DIR}/../../CMake")
+IF(EXISTS "${${PROJECT_NAME}_SOURCE_DIR}/../../CMake")
+ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${${PROJECT_NAME}_SOURCE_DIR}/../../CMake")
+ENDIF()
+
+IF(EXISTS "${${PROJECT_NAME}_SOURCE_DIR}/../../../cmake")
+ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${${PROJECT_NAME}_SOURCE_DIR}/../../../cmake")
+ENDIF()
# show build command lines
SET(CMAKE_VERBOSE_MAKEFILE ON)
+OPTION(OSG_USE_OSGSUPPORT_LIBS "" OFF)
+
+IF(NOT OSG_SUPPORT_ROOT)
+ SET(OSG_SUPPORT_ROOT "" CACHE PATH "")
+ENDIF()
+
+IF(NOT OpenSG_DIR)
+ SET(OpenSG_DIR "" CACHE PATH "")
+ENDIF()
+
#############################################################################
# find sources
@@ -20,7 +36,7 @@ FILE(GLOB SRCFILES "*.cpp")
SET(OSG_COMPONENTS OSGBase
OSGDrawable
- OSGDynamic
+ OSGDynamics
OSGFileIO
OSGGroup
OSGImageFileIO
View
15 Examples/Advanced/DeferredShading/CMakeLists.fromosg.txt
@@ -97,20 +97,27 @@ FOREACH(SRC ${SRCFILES})
ENDFOREACH()
#Install
- IF(OSG_INSTALL_EXAMPLES)
+ IF(OSG_INSTALL_EXAMPLES_EXE)
INSTALL(TARGETS ${EXE}
- DESTINATION share/OpenSG/Examples/Advanced
+ DESTINATION share/OpenSG/Examples/Advanced/DeferredShading
COMPONENT examples_advanced)
+ ENDIF()
+ IF(OSG_INSTALL_EXAMPLES)
INSTALL(FILES "${SRC}"
- DESTINATION share/OpenSG/Examples/Advanced
+ DESTINATION share/OpenSG/Examples/Advanced/DeferredShading
COMPONENT examples_advanced)
ENDIF()
ENDFOREACH(SRC)
#GLSL files
IF(OSG_INSTALL_EXAMPLES)
+ INSTALL(FILES CMakeLists.standalone.txt
+ DESTINATION share/OpenSG/Examples/Advanced/DeferredShading
+ RENAME CMakeLists.txt
+ COMPONENT examples_advanced)
+
FILE(GLOB GLSLFILES "*.glsl")
INSTALL(FILES ${GLSLFILES}
- DESTINATION share/OpenSG/Examples/Advanced
+ DESTINATION share/OpenSG/Examples/Advanced/DeferredShading
COMPONENT examples_advanced)
ENDIF()
View
18 Examples/Advanced/DeferredShading/CMakeLists.standalone.txt
@@ -5,11 +5,27 @@ PROJECT(OpenSGExamplesAdvancedDeferredShading)
MESSAGE(STATUS "Building ${PROJECT_NAME} standalone")
-SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${$PROJECT_NAME}_SOURCE_DIR}/../../CMake")
+IF(EXISTS "${${PROJECT_NAME}_SOURCE_DIR}/../../CMake")
+ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${${PROJECT_NAME}_SOURCE_DIR}/../../CMake")
+ENDIF()
+
+IF(EXISTS "${${PROJECT_NAME}_SOURCE_DIR}/../../../cmake")
+ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${${PROJECT_NAME}_SOURCE_DIR}/../../../cmake")
+ENDIF()
# show build command lines
SET(CMAKE_VERBOSE_MAKEFILE ON)
+OPTION(OSG_USE_OSGSUPPORT_LIBS "" OFF)
+
+IF(NOT OSG_SUPPORT_ROOT)
+ SET(OSG_SUPPORT_ROOT "" CACHE PATH "")
+ENDIF()
+
+IF(NOT OpenSG_DIR)
+ SET(OpenSG_DIR "" CACHE PATH "")
+ENDIF()
+
#############################################################################
# find sources
View
2 Examples/Advanced/DeferredShading/deferredshading.cpp
@@ -45,7 +45,7 @@
#include <OpenSG/OSGDeferredShadingStage.h>
#include <OpenSG/OSGDirectionalLight.h>
-#include <OpenSG/OSSPointLight.h>
+#include <OpenSG/OSGPointLight.h>
#include <OpenSG/OSGSpotLight.h>
#include <OpenSG/OSGShaderShadowMapEngine.h>
View
7 Examples/Simple/CMakeLists.fromosg.txt
@@ -116,10 +116,12 @@ FOREACH(SRC ${SRCFILES})
#Install
- IF(OSG_INSTALL_EXAMPLES)
+ IF(OSG_INSTALL_EXAMPLES_EXE)
INSTALL(TARGETS ${EXE}
DESTINATION share/OpenSG/Examples/Simple
COMPONENT examples_basic)
+ ENDIF()
+ IF(OSG_INSTALL_EXAMPLES)
INSTALL(FILES "${SRC}"
DESTINATION share/OpenSG/Examples/Simple
COMPONENT examples_basic)
@@ -128,8 +130,9 @@ ENDFOREACH(SRC)
IF(OSG_INSTALL_EXAMPLES)
- INSTALL(DIRECTORY "${CMAKE_SOURCE_DIR}/Examples/Tutorial/Data"
+ INSTALL(FILES CMakeLists.standalone.txt
DESTINATION share/OpenSG/Examples/Simple
+ RENAME CMakeLists.txt
COMPONENT examples_basic)
ENDIF()
View
40 Examples/Simple/CMakeLists.standalone.txt
@@ -1,13 +1,31 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+
PROJECT(OpenSGSimpleExamples)
MESSAGE(STATUS "Building simple examples standalone")
-SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${OpenSGSimpleExamples_SOURCE_DIR}/../../CMake")
+IF(EXISTS "${${PROJECT_NAME}_SOURCE_DIR}/../../CMake")
+ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${${PROJECT_NAME}_SOURCE_DIR}/../../CMake")
+ENDIF()
+
+IF(EXISTS "${${PROJECT_NAME}_SOURCE_DIR}/../../cmake")
+ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${${PROJECT_NAME}_SOURCE_DIR}/../../cmake")
+ENDIF()
# show build command lines
SET(CMAKE_VERBOSE_MAKEFILE ON)
+OPTION(OSG_USE_OSGSUPPORT_LIBS "" OFF)
+
+IF(NOT OSG_SUPPORT_ROOT)
+ SET(OSG_SUPPORT_ROOT "" CACHE PATH "")
+ENDIF()
+
+IF(NOT OpenSG_DIR)
+ SET(OpenSG_DIR "" CACHE PATH "")
+ENDIF()
+
#############################################################################
# find sources
@@ -58,6 +76,13 @@ LIST(APPEND DEP_INCLUDE_DIRS ${GLUT_INCLUDE_DIR})
LIST(APPEND DEP_LIBRARIES ${GLUT_LIBRARIES})
#############
+#### OpenGL
+
+FIND_PACKAGE(OpenGL REQUIRED)
+LIST(APPEND DEP_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR})
+LIST(APPEND DEP_LIBRARIES ${OPENGL_LIBRARIES})
+
+#############
#### X11 (optional)
FIND_PACKAGE(X11)
@@ -85,21 +110,14 @@ ENDIF(COLLADA_FOUND)
SET(Boost_USE_MULTITHREAD ON)
SET(Boost_STATIC_LIBS OFF)
+SET(Boost_COMPONENTS system ${Boost_COMPONENTS})
+
IF(COLLADA_FOUND)
- SET(Boost_COMPONENTS filesystem)
- FIND_PACKAGE(Boost COMPONENTS ${Boost_COMPONENTS} REQUIRED)
-ELSE(COLLADA_FOUND)
- FIND_PACKAGE(Boost REQUIRED)
+ LIST(APPEND Boost_COMPONENTS filesystem)
ENDIF(COLLADA_FOUND)
FIND_PACKAGE(Boost COMPONENTS ${Boost_COMPONENTS} REQUIRED)
-IF(Boost_FOUND AND Boost_MINOR_VERSION GREATER "34")
- SET(Boost_COMPONENTS system ${Boost_COMPONENTS})
-
- FIND_PACKAGE(Boost COMPONENTS ${Boost_COMPONENTS} REQUIRED)
-ENDIF(Boost_FOUND AND Boost_MINOR_VERSION GREATER "34")
-
IF(Boost_FOUND)
LIST(APPEND DEP_INCLUDE_DIRS ${Boost_INCLUDE_DIRS})
LIST(APPEND DEP_LIBRARY_DIRS ${Boost_LIBRARY_DIRS})
View
15 Examples/Tutorial/CMakeLists.fromosg.txt
@@ -113,20 +113,27 @@ FOREACH(SRC ${SRCFILES})
#Install
- IF(OSG_INSTALL_EXAMPLES)
+ IF(OSG_INSTALL_EXAMPLES_EXE)
INSTALL(TARGETS ${EXE}
- DESTINATION share/OpenSG/Examples/Simple
+ DESTINATION share/OpenSG/Examples/Tutorial
COMPONENT examples_basic)
+ ENDIF()
+ IF(OSG_INSTALL_EXAMPLES)
INSTALL(FILES "${SRC}"
- DESTINATION share/OpenSG/Examples/Simple
+ DESTINATION share/OpenSG/Examples/Tutorial
COMPONENT examples_basic)
ENDIF()
ENDFOREACH(SRC)
IF(OSG_INSTALL_EXAMPLES)
+ INSTALL(FILES CMakeLists.standalone.txt
+ DESTINATION share/OpenSG/Examples/Tutorial
+ RENAME CMakeLists.txt
+ COMPONENT examples_basic)
+
INSTALL(DIRECTORY "${CMAKE_SOURCE_DIR}/Examples/Tutorial/Data"
- DESTINATION share/OpenSG/Examples/Simple
+ DESTINATION share/OpenSG/Examples/Tutorial
COMPONENT examples_basic)
ENDIF()
View
33 Examples/Tutorial/CMakeLists.standalone.txt
@@ -3,11 +3,27 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(OpenSGExamplesTutorial)
-SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/../../CMake")
+IF(EXISTS "${${PROJECT_NAME}_SOURCE_DIR}/../../CMake")
+ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${${PROJECT_NAME}_SOURCE_DIR}/../../CMake")
+ENDIF()
+
+IF(EXISTS "${${PROJECT_NAME}_SOURCE_DIR}/../../cmake")
+ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${${PROJECT_NAME}_SOURCE_DIR}/../../cmake")
+ENDIF()
# show build command lines
SET(CMAKE_VERBOSE_MAKEFILE ON)
+OPTION(OSG_USE_OSGSUPPORT_LIBS "" OFF)
+
+IF(NOT OSG_SUPPORT_ROOT)
+ SET(OSG_SUPPORT_ROOT "" CACHE PATH "")
+ENDIF()
+
+IF(NOT OpenSG_DIR)
+ SET(OpenSG_DIR "" CACHE PATH "")
+ENDIF()
+
#############################################################################
# find sources
@@ -34,13 +50,11 @@ SET(DEP_LIBRARY_DIRS)
SET(DEP_LIBRARIES)
#############
-#### GL
+#### OpenGL
FIND_PACKAGE(OpenGL REQUIRED)
-FIND_PACKAGE(GLU REQUIRED)
LIST(APPEND DEP_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR})
-LIST(APPEND DEP_LIBRARIES ${OPENGL_gl_LIBRARY})
-LIST(APPEND DEP_LIBRARIES ${OPENGL_glu_LIBRARY})
+LIST(APPEND DEP_LIBRARIES ${OPENGL_LIBRARIES})
#############
#### GLUT
@@ -66,11 +80,18 @@ ENDIF(COLLADA_FOUND)
SET(Boost_USE_MULTITHREAD ON)
SET(Boost_STATIC_LIBS OFF)
-FIND_PACKAGE(Boost REQUIRED)
+SET(Boost_COMPONENTS system ${Boost_COMPONENTS})
+
+IF(COLLADA_FOUND)
+ LIST(APPEND Boost_COMPONENTS filesystem)
+ENDIF(COLLADA_FOUND)
+
+FIND_PACKAGE(Boost COMPONENTS ${Boost_COMPONENTS} REQUIRED)
IF(Boost_FOUND)
LIST(APPEND DEP_INCLUDE_DIRS ${Boost_INCLUDE_DIRS})
LIST(APPEND DEP_LIBRARY_DIRS ${Boost_LIBRARY_DIRS})
+ LIST(APPEND DEP_LIBRARIES ${Boost_LIBRARIES})
ENDIF(Boost_FOUND)
#############

0 comments on commit 6d0c32c

Please sign in to comment.