OPTION(ENABLE_DEBUG "Enable Debug" OFF)
OPTION(ENABLE_TRACE "Enable Trace" OFF)
OPTION(ENABLE_PKG_CONFIGURE "Use pkgconfig" ON)
-OPTION(ENABLE_VULKAN "Use Vulkan instead of GLES" OFF)
OPTION(INTERNATIONALIZATION "Internationalization demo string names" ON)
SET(ROOT_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../..)
IF( ANDROID )
SET( REQUIRED_LIBS ${REQUIRED_LIBS} -lGLESv3 )
- ELSE()
- PKG_CHECK_MODULES( GLESV2 REQUIRED glesv2 )
- SET( REQUIRED_LIBS ${REQUIRED_LIBS} ${GLESV2_LIBRARIES} )
ENDIF()
ENDIF()
SET(EXAMPLES_SRC_DIR ${ROOT_SRC_DIR}/examples)
MESSAGE(STATUS "Building examples.")
-MESSAGE(STATUS "ENABLE_VULKAN: ${ENABLE_VULKAN}")
MESSAGE(STATUS "ENABLE_PHYSICS_2D: ${ENABLE_PHYSICS_2D}")
MESSAGE(STATUS "ENABLE_PHYSICS_3D: ${ENABLE_PHYSICS_3D}")
MESSAGE(STATUS "ENABLE_SCENE3D: ${ENABLE_SCENE3D}")
ENDIF()
ENDIF()
-IF(ENABLE_VULKAN)
- # Don't build GL examples
- SET(GLES_EXAMPLES "direct-rendering")
- IF( ${GLES_EXAMPLES} IN_LIST SUBDIRS)
- LIST(REMOVE_ITEM SUBDIRS ${GLES_EXAMPLES})
- ENDIF()
-ENDIF()
-
FIND_PROGRAM( SHADER_GENERATOR "dali-shader-generator" )
IF( NOT SHADER_GENERATOR )
MESSAGE( FATAL_ERROR "dali-shader-generator not found!" )
ADD_DEPENDENCIES(${EXAMPLE}.example ${EXAMPLE}-generate-shaders)
ENDIF()
- TARGET_LINK_LIBRARIES(${EXAMPLE}.example ${REQUIRED_LIBS})
+ TARGET_LINK_LIBRARIES(${EXAMPLE}.example ${REQUIRED_LIBS} ${EXTRA_EXAMPLE_LDFLAGS})
INSTALL(TARGETS ${EXAMPLE}.example DESTINATION ${BINDIR})
ENDFUNCTION()
-IF(ENABLE_VULKAN)
- SET(EXAMPLE_DISABLED=1)
+IF(ANDROID)
+ SET(EXTRA_EXAMPLE_LDFLAGS -lGLESv3)
+ELSEIF(NOT WIN32 AND NOT APPLE)
+ PKG_CHECK_MODULES(GLESV2 REQUIRED glesv2)
+ SET(EXTRA_EXAMPLE_LDFLAGS ${GLESV2_LIBRARIES})
ENDIF()
--- /dev/null
+IF(ANDROID)
+ SET(EXTRA_EXAMPLE_LDFLAGS -lGLESv3)
+ELSEIF(NOT WIN32 AND NOT APPLE)
+ PKG_CHECK_MODULES(GLESV2 REQUIRED glesv2)
+ SET(EXTRA_EXAMPLE_LDFLAGS ${GLESV2_LIBRARIES})
+ENDIF()