Need for our XParseGeometry implementation now detected by CMake
authorDiederick Niehorster <dcnieho@gmail.com>
Sun, 11 Mar 2012 15:26:01 +0000 (15:26 +0000)
committerDiederick Niehorster <dcnieho@gmail.com>
Sun, 11 Mar 2012 15:26:01 +0000 (15:26 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1113 7f0cb862-5218-0410-a997-914c9d46530a

CMakeLists.txt
config.h.in
src/fg_init.c

index 08ef46a..98559b4 100644 (file)
@@ -43,8 +43,6 @@ ENDIF()
 
 IF(WIN32)   # TODO: is this true for 64 bit as well? Chaneg to WINDOWS?
        LIST(APPEND FREEGLUT_SRCS
-               src/util/xparsegeometry_repl.c  # TODO: instead of this, detect if function is available and include if not
-               src/util/xparsegeometry_repl.h
                src/mswin/fg_cursor_mswin.c
                src/mswin/fg_display_mswin.c
                src/mswin/fg_ext_mswin.c
@@ -61,26 +59,24 @@ IF(WIN32)   # TODO: is this true for 64 bit as well? Chaneg to WINDOWS?
                src/mswin/fg_window_mswin.c
 )
 ELSEIF(ANDROID)
-       LIST(APPEND FREEGLUT_SRCS
-               src/util/xparsegeometry_repl.c
-               src/util/xparsegeometry_repl.h
-               src/egl/fg_internal_egl.h
-               src/egl/fg_display_egl.c
-               src/egl/fg_init_egl.c
-               src/egl/fg_structure_egl.c
-               src/egl/fg_window_egl.c
-               src/android/native_app_glue/android_native_app_glue.c
-               src/android/native_app_glue/android_native_app_glue.h
-               src/android/fg_runtime_android.c
-               src/android/fg_gamemode_android.c
-               src/android/fg_input_devices_android.c
-               src/android/fg_joystick_android.c
-               src/android/fg_main_android.c
-               src/android/fg_spaceball_android.c
-               src/android/fg_state_android.c
-               src/android/fg_window_android.c
-               src/android/opengles_stubs.c
-               src/android/fg_internal_android.h
+    LIST(APPEND FREEGLUT_SRCS
+        src/egl/fg_internal_egl.h
+        src/egl/fg_display_egl.c
+        src/egl/fg_init_egl.c
+        src/egl/fg_structure_egl.c
+        src/egl/fg_window_egl.c
+        src/android/native_app_glue/android_native_app_glue.c
+        src/android/native_app_glue/android_native_app_glue.h
+        src/android/fg_runtime_android.c
+        src/android/fg_gamemode_android.c
+        src/android/fg_input_devices_android.c
+        src/android/fg_joystick_android.c
+        src/android/fg_main_android.c
+        src/android/fg_spaceball_android.c
+        src/android/fg_state_android.c
+        src/android/fg_window_android.c
+        src/android/opengles_stubs.c
+        src/android/fg_internal_android.h
 )
 ELSE()
        LIST(APPEND FREEGLUT_SRCS
@@ -172,6 +168,13 @@ CHECK_INCLUDE_FILES(usbhid.h       HAVE_USBHID_H)
 CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
 CHECK_FUNCTION_EXISTS(vfprintf  HAVE_VFPRINTF)
 CHECK_FUNCTION_EXISTS(_doprnt   HAVE_DOPRNT)
+CHECK_FUNCTION_EXISTS(XParseGeometry   HAVE_XPARSEGEOMETRY)
+IF (NOT HAVE_XPARSEGEOMETRY)
+   LIST(APPEND FREEGLUT_SRCS
+               src/util/xparsegeometry_repl.c
+               src/util/xparsegeometry_repl.h)
+   SET(NEED_XPARSEGEOMETRY_IMPL TRUE)
+ENDIF()
 # decide on suitable type for internal time keeping, 64-bit if possible
 CHECK_INCLUDE_FILES(stdint.h    HAVE_STDINT_H)
 CHECK_INCLUDE_FILES(inttypes.h  HAVE_INTTYPES_H)
index 588f15a..0db8c4f 100644 (file)
@@ -12,6 +12,7 @@
 #cmakedefine HAVE_GETTIMEOFDAY
 #cmakedefine HAVE_VFPRINTF
 #cmakedefine HAVE_DOPRNT
+#cmakedefine NEED_XPARSEGEOMETRY_IMPL
 #cmakedefine HAVE_STDINT_H
 #cmakedefine HAVE_INTTYPES_H
 #define HAVE_ULONG_LONG ${HAVE_ULONG_LONG}
index 816fc66..e30eb0f 100644 (file)
@@ -315,7 +315,7 @@ void fgDeinitialize( void )
 
 
 /* -- INTERFACE FUNCTIONS -------------------------------------------------- */
-#if !TARGET_HOST_POSIX_X11
+#if defined(NEED_XPARSEGEOMETRY_IMPL)
 #   include "util/xparsegeometry_repl.h"
 #endif