@ -7,9 +7,20 @@ include("../utils.cmake")
# T O D O ` b u i l d ` d i r e c t o r y s h o u l d m a y b e b e s o m e t h i n g e l s e . . .
# T O D O p l a c e s o m e w h e r e e l s e ?
include_directories ( "../build/release" )
include_directories ( "../src/external" )
include_directories ( "../src/external/glfw/include" )
# G e t t h e s o u r c e s t o g e t h e r
set ( example_dirs audio core models others physac shaders text texutures )
set ( example_dirs audio core models others shaders text texutures )
set ( CMAKE_REQUIRED_DEFINITIONS -D_POSIX_C_SOURCE=199309L )
include ( CheckSymbolExists )
check_symbol_exists ( CLOCK_MONOTONIC time.h HAVE_CLOCK_MONOTONIC )
check_symbol_exists ( QueryPerformanceCounter windows.h HAVE_QPC )
set ( CMAKE_REQUIRED_DEFINITIONS )
if ( HAVE_QPC OR HAVE_CLOCK_MONOTONIC )
set ( example_dirs ${ example_dirs } physac )
endif ( )
set ( example_sources )
set ( example_resources )
foreach ( example_dir ${ example_dirs } )
@ -22,6 +33,14 @@ foreach(example_dir ${example_dirs})
list ( APPEND example_resources ${ resources } )
endforeach ( )
include ( CheckIncludeFiles )
check_include_files ( OVR_CAPI_GL.h HAVE_OCULUS_CAPI )
if ( NOT HAVE_OCULUS_CAPI )
list ( REMOVE_ITEM example_sources ${ CMAKE_CURRENT_SOURCE_DIR } /others/oculus_rift.c )
endif ( )
list ( REMOVE_ITEM example_sources ${ CMAKE_CURRENT_SOURCE_DIR } /others/standard_lighting.c )
# D o e a c h e x a m p l e
foreach ( example_source ${ example_sources } )
# C r e a t e t h e b a s e n a m e f o r t h e e x a m p l e