@ -25,12 +25,12 @@ foreach(example_dir ${example_dirs})
endforeach ( )
include ( CheckIncludeFiles )
list ( REMOVE_ITEM example_sources ${ CMAKE_CURRENT_SOURCE_DIR } /others/standard_lighting.c )
list ( REMOVE_ITEM example_sources ${ CMAKE_CURRENT_SOURCE_DIR } /others/rlgl_standalone.c ) # s e e # 5 8 8
set ( OUTPUT_EXT )
list ( REMOVE_ITEM example_sources ${ CMAKE_CURRENT_SOURCE_DIR } /others/rlgl_standalone.c )
if ( ${ PLATFORM } MATCHES "Android" )
list ( REMOVE_ITEM example_sources ${ CMAKE_CURRENT_SOURCE_DIR } /others/rlgl_standalone.c )
list ( REMOVE_ITEM example_sources ${ CMAKE_CURRENT_SOURCE_DIR } /others/standard_lighting.c )
list ( REMOVE_ITEM example_sources ${ CMAKE_CURRENT_SOURCE_DIR } /core/core_3d_picking.c )
list ( REMOVE_ITEM example_sources ${ CMAKE_CURRENT_SOURCE_DIR } /core/core_vr_simulator.c )
list ( REMOVE_ITEM example_sources ${ CMAKE_CURRENT_SOURCE_DIR } /core/core_3d_camera_free.c )
@ -49,12 +49,16 @@ if(${PLATFORM} MATCHES "Android")
list ( REMOVE_ITEM example_sources ${ CMAKE_CURRENT_SOURCE_DIR } /shaders/shaders_custom_uniform.c )
list ( REMOVE_ITEM example_sources ${ CMAKE_CURRENT_SOURCE_DIR } /shaders/shaders_model_shader.c )
list ( REMOVE_ITEM example_sources ${ CMAKE_CURRENT_SOURCE_DIR } /shaders/shaders_postprocessing.c )
elseif ( ${ PLATFORM } MATCHES "Web" )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1" )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --shell-file ${CMAKE_SOURCE_DIR}/templates/web_shell/shell.html" )
set ( OUTPUT_EXT ".html" )
endif ( )
include_directories ( BEFORE SYSTEM others/external/include )
if ( NOT TARGET raylib )
find_package ( raylib 2.0 REQUIRED )
endif ( )
@ -68,9 +72,22 @@ foreach(example_source ${example_sources})
# S e t u p t h e e x a m p l e
add_executable ( ${ example_name } ${ example_source } )
# L i n k t h e l i b r a r i e s
target_link_libraries ( ${ example_name } raylib )
endforeach ( )
if ( ${ PLATFORM } MATCHES "Desktop" )
# r l g l _ s t a n d a l o n e c a n ' t b e l i n k e d w i t h r a y l i b b e c a u s e o f d u p l i c a t e r l g l s y m b o l s
foreach ( example_source "others/rlgl_standalone.c" )
# 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
get_filename_component ( example_name ${ example_source } NAME )
string ( REPLACE ".c" "${OUTPUT_EXT}" example_name ${ example_name } )
add_executable ( ${ example_name } ${ example_source } )
add_dependencies ( ${ example_name } raylib )
target_link_libraries ( ${ example_name } ${ raylib_LDFLAGS } )
target_include_directories ( ${ example_name } PRIVATE ${ raylib_INCLUDE_DIRS } )
endforeach ( )
endif ( )
# C o p y a l l o f t h e r e s o u r c e f i l e s t o t h e d e s t i n a t i o n
file ( COPY ${ example_resources } DESTINATION "resources/" )