src/fg_gl2.c
src/fg_gl2.h
src/fg_init.c
+ src/fg_init.h
src/fg_internal.h
src/fg_input_devices.c
src/fg_joystick.c
src/fg_main.c
+ src/fg_main.h
src/fg_misc.c
src/fg_overlay.c
src/fg_spaceball.c
ELSEIF(ANDROID)
LIST(APPEND FREEGLUT_SRCS
- src/egl/fg_internal_egl.h
- src/egl/fg_display_egl.c
- src/egl/fg_ext_egl.c
- src/egl/fg_init_egl.c
- src/egl/fg_state_egl.c
- src/egl/fg_structure_egl.c
- src/egl/fg_structure_egl.h
- src/egl/fg_window_egl.c
- src/egl/fg_window_egl.h
src/android/native_app_glue/android_native_app_glue.c
src/android/native_app_glue/android_native_app_glue.h
src/android/fg_internal_android.h
src/android/fg_input_devices_android.c
src/android/fg_joystick_android.c
src/android/fg_main_android.c
+ src/android/fg_main_android.h
src/android/fg_runtime_android.c
src/android/fg_spaceball_android.c
src/android/fg_state_android.c
src/x11/fg_window_x11.c
src/x11/fg_xinput_x11.c
)
- IF(FREEGLUT_GLES2 OR FREEGLUT_GLES1)
- LIST(APPEND FREEGLUT_SRCS
- src/egl/fg_internal_egl.h
- src/egl/fg_display_egl.c
- src/egl/fg_ext_egl.c
- src/egl/fg_init_egl.c
- src/egl/fg_state_egl.c
- src/egl/fg_structure_egl.c
- src/egl/fg_window_egl.c
- )
- ELSE()
+ IF(NOT(FREEGLUT_GLES2 OR FREEGLUT_GLES1))
LIST(APPEND FREEGLUT_SRCS
src/x11/fg_internal_x11_glx.h
src/x11/fg_display_x11_glx.c
src/x11/fg_state_x11_glx.c
+ src/x11/fg_state_x11_glx.h
src/x11/fg_window_x11_glx.c
src/x11/fg_window_x11_glx.h
)
ENDIF()
ENDIF()
+IF(FREEGLUT_GLES2 OR FREEGLUT_GLES1)
+ LIST(APPEND FREEGLUT_SRCS
+ src/egl/fg_internal_egl.h
+ src/egl/fg_display_egl.c
+ src/egl/fg_ext_egl.c
+ src/egl/fg_init_egl.c
+ src/egl/fg_init_egl.h
+ src/egl/fg_state_egl.c
+ src/egl/fg_state_egl.h
+ src/egl/fg_structure_egl.c
+ src/egl/fg_structure_egl.h
+ src/egl/fg_window_egl.c
+ src/egl/fg_window_egl.h
+ )
+ENDIF()
# For OpenGL ES (GLES):
# - compile with -DFREEGLUT_GLES1 and -DFREEGLUT_GLES2 to cleanly
ENDIF()
IF(CMAKE_COMPILER_IS_GNUCC)
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic")
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
IF(!ANDROID)
# not setting -ansi as EGL/KHR headers doesn't support it
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ansi")
ENDIF()
ENDIF(CMAKE_COMPILER_IS_GNUCC)
-if(UNIX AND NOT ANDROID)
+IF(UNIX AND NOT ANDROID)
FIND_PACKAGE(X11 REQUIRED)
LIST(APPEND LIBS ${X11_LIBRARIES})
IF(X11_Xrandr_FOUND)
LIST(APPEND LIBS ${X11_Xxf86vm_LIB})
ENDIF()
ENDIF()
+IF(ANDROID)
+ # -landroid for ANativeWindow
+ # -llog for native Android logging
+ LIST(APPEND LIBS android log)
+ENDIF()
INCLUDE(CheckIncludeFiles)
INCLUDE(CheckFunctionExists)
ENDIF()
ENDIF()
+# Check for sinf/cosf/sqrtf
+# CHECK_FUNCTION_EXISTS doesn't work because check requires <math.h>
+#CHECK_FUNCTION_EXISTS(sinf HAVE_SINF)
+#CHECK_FUNCTION_EXISTS(cosf HAVE_COSF)
+#CHECK_FUNCTION_EXISTS(sqrtf HAVE_SQRTF)
+INCLUDE(CheckCSourceCompiles)
+CHECK_C_SOURCE_COMPILES("
+ #include <math.h>
+ int main(){sinf(0); return 0;}
+ " HAVE_SINF
+)
+CHECK_C_SOURCE_COMPILES("
+ #include <math.h>
+ int main(){cosf(0); return 0;}
+ " HAVE_COSF
+)
+CHECK_C_SOURCE_COMPILES("
+ #include <math.h>
+ int main(){sqrtf(0); return 0;}
+ " HAVE_SQRTF
+)
# The generated config.h is placed in the project's build directory, just to
# ensure that all CMake-generated files are kept away from the main source tree.
ADD_DEMO(subwin progs/demos/subwin/subwin.c)
ADD_DEMO(timer progs/demos/timer/timer.c)
-# finally, if any demos are built, copy needed files to output directory
-# (currently, thats just the input file for the Fractals demo)
-IF(FREEGLUT_BUILD_DEMOS)
- # 1) copy fractals.dat from freeglut/progs/demos/Fractals
- IF(BUILD_SHARED_LIBS)
- SET(Frac_target Fractals)
- ELSE()
- SET(Frac_target Fractals_static)
- ENDIF()
- GET_TARGET_PROPERTY(DEMO_OUTPUT_DIRECTORY ${Frac_target} RUNTIME_OUTPUT_DIRECTORY)
- ADD_CUSTOM_COMMAND(
- TARGET ${Frac_target}
- POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy
- ${PROJECT_SOURCE_DIR}/progs/demos/Fractals/fractals.dat
- ${DEMO_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}
- )
-ENDIF()
-
# pkg-config support, to install at $(libdir)/pkgconfig
# Define static build dependencies
IF(WIN32)