X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=CMakeLists.txt;h=30689865888714ebf9c3af6f98f4bf1e6eceeee6;hb=a98dd465e59abd3d295aaab17363e5a5f8e5c6b4;hp=d3f083a45cdb613ed4166e3e23a868c60050f7b8;hpb=cb1e59cf5e6ac8034ae91abfd320874004a44c88;p=freeglut diff --git a/CMakeLists.txt b/CMakeLists.txt index d3f083a..3068986 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,7 @@ SET(FREEGLUT_SRCS 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 @@ -139,11 +140,12 @@ ELSE() src/x11/fg_window_x11.c src/x11/fg_xinput_x11.c ) - IF(!(FREEGLUT_GLES2 OR FREEGLUT_GLES1)) + 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 ) @@ -185,7 +187,10 @@ ENDIF() # lib m for math, not needed on windows IF (NOT WIN32) + # For compilation: LIST(APPEND LIBS m) + # For CHECK_FUNCTION_EXISTS: + LIST(APPEND CMAKE_REQUIRED_LIBRARIES m) ENDIF() IF(WIN32) @@ -194,14 +199,14 @@ IF(WIN32) 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) @@ -217,6 +222,11 @@ if(UNIX AND NOT ANDROID) 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) @@ -254,6 +264,10 @@ IF (NOT (HAVE_STDINT_H OR HAVE_INTTYPES_H)) ENDIF() ENDIF() +# Check for sinf/cosf/sqrtf +CHECK_FUNCTION_EXISTS(sinf HAVE_SINF) +CHECK_FUNCTION_EXISTS(cosf HAVE_COSF) +CHECK_FUNCTION_EXISTS(sqrtf 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. @@ -379,25 +393,6 @@ ADD_DEMO(spaceball progs/demos/spaceball/spaceball.c 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)