fixed: push transparency enforcement to state so the backend is aware of it
[opensg.git] / Examples / Simple / CMakeLists.standalone.txt
blob185c74a713b2f8796b1025230ad6ef6ef11db8a2
2 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
4 PROJECT(OpenSGSimpleExamples)
6 MESSAGE(STATUS "Building simple examples standalone")
8 IF(EXISTS "${${PROJECT_NAME}_SOURCE_DIR}/../../CMake")
9   SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${${PROJECT_NAME}_SOURCE_DIR}/../../CMake")
10 ENDIF()
12 IF(EXISTS "${${PROJECT_NAME}_SOURCE_DIR}/../../cmake")
13   SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${${PROJECT_NAME}_SOURCE_DIR}/../../cmake")
14 ENDIF()
16 # show build command lines
17 SET(CMAKE_VERBOSE_MAKEFILE ON)
19 OPTION(OSG_USE_OSGSUPPORT_LIBS "" OFF)
21 IF(NOT OSG_SUPPORT_ROOT)
22   SET(OSG_SUPPORT_ROOT "" CACHE PATH "")
23 ENDIF()
25 IF(NOT OpenSG_DIR)
26   SET(OpenSG_DIR "" CACHE PATH "")
27 ENDIF()
29 #############################################################################
30 # find sources
32 FILE(GLOB SRCFILES "*.cpp")
34 # stuff that is broken -- these examples need to be fixed
35 LIST(REMOVE_ITEM SRCFILES "${PROJECT_SOURCE_DIR}/clusterclientshader.cpp")
36 LIST(REMOVE_ITEM SRCFILES "${PROJECT_SOURCE_DIR}/geometryshader.cpp")
37 LIST(REMOVE_ITEM SRCFILES "${PROJECT_SOURCE_DIR}/phongshaderwithglmaterials.cpp")
38 LIST(REMOVE_ITEM SRCFILES "${PROJECT_SOURCE_DIR}/shader.cpp")
40 #############################################################################
41 # get dependencies
43 SET(OSG_COMPONENTS OSGBase 
44                    OSGCluster 
45                    OSGDrawable 
46                    OSGFileIO 
47                    OSGGroup 
48                    OSGImageFileIO
49                    OSGState 
50                    OSGSystem 
51                    OSGUtil 
52                    OSGWindow 
53                    OSGWindowGLUT)
55 IF(UNIX)
56     IF(APPLE)
57         LIST(APPEND OSG_COMPONENTS OSGWindowCarbon)
58     ELSE(APPLE)
59         LIST(APPEND OSG_COMPONENTS OSGWindowX)
60     ENDIF(APPLE)
61 ENDIF(UNIX)
63 IF(WIN32)
64     LIST(APPEND OSG_COMPONENTS OSGWindowWIN32)
65 ENDIF(WIN32)
67 SET(DEP_INCLUDE_DIRS)
68 SET(DEP_LIBRARY_DIRS)
69 SET(DEP_LIBRARIES)
71 #############
72 #### GLUT
74 FIND_PACKAGE(GLUT REQUIRED)
75 LIST(APPEND DEP_INCLUDE_DIRS ${GLUT_INCLUDE_DIR})
76 LIST(APPEND DEP_LIBRARIES ${GLUT_LIBRARIES})
78 #############
79 #### OpenGL
81 FIND_PACKAGE(OpenGL REQUIRED)
82 LIST(APPEND DEP_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR})
83 LIST(APPEND DEP_LIBRARIES ${OPENGL_LIBRARIES})
85 #############
86 #### X11 (optional)
88 FIND_PACKAGE(X11)
90 IF(X11_FOUND)
91     LIST(APPEND DEP_INCLUDE_DIRS ${X11_X11_INCLUDE_PATH})
92     LIST(APPEND DEP_LIBRARIES ${X11_X11_LIB})
93 ELSE(X11_FOUND)
94     LIST(REMOVE_ITEM SRCFILES "${PROJECT_SOURCE_DIR}/clusterserverx.cpp")
95 ENDIF(X11_FOUND)
97 #############
98 #### Collada (optional, depending on how OpenSG was built)
100 FIND_PACKAGE(Collada)
102 IF(COLLADA_FOUND)
103     LIST(APPEND DEP_INCLUDE_DIRS ${COLLADA_INCLUDE_DIRS})
104     LIST(APPEND DEP_LIBRARY_DIRS ${COLLADA_LIBRARY_DIRS})
105 ENDIF(COLLADA_FOUND)
107 #############
108 #### Boost
110 SET(Boost_USE_MULTITHREAD ON)
111 SET(Boost_STATIC_LIBS OFF)
113 SET(Boost_COMPONENTS system ${Boost_COMPONENTS})
115 IF(COLLADA_FOUND)
116     LIST(APPEND Boost_COMPONENTS filesystem)
117 ENDIF(COLLADA_FOUND)
119 FIND_PACKAGE(Boost COMPONENTS ${Boost_COMPONENTS} REQUIRED)
121 IF(Boost_FOUND)
122     LIST(APPEND DEP_INCLUDE_DIRS ${Boost_INCLUDE_DIRS})
123     LIST(APPEND DEP_LIBRARY_DIRS ${Boost_LIBRARY_DIRS})
124     LIST(APPEND DEP_LIBRARIES ${Boost_LIBRARIES})
125 ENDIF(Boost_FOUND)
127 #############
128 #### OpenSG
130 FIND_PACKAGE(OpenSG REQUIRED COMPONENTS ${OSG_COMPONENTS})
133 #############################################################################
134 # build executables
136 FOREACH(SRC ${SRCFILES})
138     GET_FILENAME_COMPONENT(EXE ${SRC} NAME_WE)
140     INCLUDE_DIRECTORIES(${OpenSG_INCLUDE_DIRS})
141     INCLUDE_DIRECTORIES(${DEP_INCLUDE_DIRS})
143     LINK_DIRECTORIES(${OpenSG_LIBRARY_DIRS})
144     LINK_DIRECTORIES(${DEP_LIBRARY_DIRS})
146     ADD_EXECUTABLE(${EXE} ${SRC})
148     TARGET_LINK_LIBRARIES(${EXE} ${OpenSG_LIBRARIES})
149     TARGET_LINK_LIBRARIES(${EXE} ${DEP_LIBRARIES})
150 ENDFOREACH(SRC)