From 3ca63a0cf3048babaf9a2136866f98878688fad0 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Fri, 17 Sep 2010 00:54:11 +0200 Subject: [PATCH] Replaced platform specific config headers with shared one, updated version strings to include CMake version. --- CMakeLists.txt | 5 +++++ src/cocoa/CMakeLists.txt | 4 ---- src/cocoa/cocoa_config.h.cmake | 4 ---- src/cocoa/cocoa_init.m | 1 - src/cocoa/platform.h | 1 - src/{x11/x11_config.h.cmake => config.h.cmake} | 0 src/internal.h | 1 + src/win32/win32_init.c | 3 +-- src/x11/CMakeLists.txt | 3 --- src/x11/platform.h | 1 - 10 files changed, 7 insertions(+), 16 deletions(-) delete mode 100644 src/cocoa/cocoa_config.h.cmake rename src/{x11/x11_config.h.cmake => config.h.cmake} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 897a6816..274ca811 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,6 +118,11 @@ add_subdirectory(tests) #add_subdirectory(docs/doxygen) #add_subdirectory(docs/manuals) +#-------------------------------------------------------------------- +# Create shared configuration header +#-------------------------------------------------------------------- +configure_file(${GLFW_SOURCE_DIR}/src/config.h.cmake + ${GLFW_BINARY_DIR}/src/config.h @ONLY) #-------------------------------------------------------------------- # -- Install standard files diff --git a/src/cocoa/CMakeLists.txt b/src/cocoa/CMakeLists.txt index cc9b2eaf..5c867591 100644 --- a/src/cocoa/CMakeLists.txt +++ b/src/cocoa/CMakeLists.txt @@ -1,8 +1,4 @@ -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/cocoa_config.h.cmake - ${CMAKE_CURRENT_BINARY_DIR}/cocoa_config.h @ONLY) - configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/libglfw.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/libglfw.pc @ONLY) diff --git a/src/cocoa/cocoa_config.h.cmake b/src/cocoa/cocoa_config.h.cmake deleted file mode 100644 index cd2e91e5..00000000 --- a/src/cocoa/cocoa_config.h.cmake +++ /dev/null @@ -1,4 +0,0 @@ -/* Configure build time options of GLFW */ - -#define _GLFW_VERSION_FULL "@GLFW_VERSION_FULL@" - diff --git a/src/cocoa/cocoa_init.m b/src/cocoa/cocoa_init.m index 89bebabc..3d6272f6 100644 --- a/src/cocoa/cocoa_init.m +++ b/src/cocoa/cocoa_init.m @@ -244,7 +244,6 @@ int _glfwPlatformTerminate(void) const char* _glfwPlatformGetVersionString(void) { - // TODO: Bring in CMake version const char* version = "GLFW " _GLFW_VERSION_FULL " Cocoa"; return version; diff --git a/src/cocoa/platform.h b/src/cocoa/platform.h index 3b52ff0c..e1cb9464 100644 --- a/src/cocoa/platform.h +++ b/src/cocoa/platform.h @@ -44,7 +44,6 @@ typedef void* id; #endif #include "../../include/GL/glfw3.h" -#include "cocoa_config.h" #ifndef GL_VERSION_3_0 diff --git a/src/x11/x11_config.h.cmake b/src/config.h.cmake similarity index 100% rename from src/x11/x11_config.h.cmake rename to src/config.h.cmake diff --git a/src/internal.h b/src/internal.h index 11f586bc..736c361e 100644 --- a/src/internal.h +++ b/src/internal.h @@ -56,6 +56,7 @@ // glfw.h) //------------------------------------------------------------------------ +#include "config.h" #include "platform.h" diff --git a/src/win32/win32_init.c b/src/win32/win32_init.c index cf545d1a..b344c48f 100644 --- a/src/win32/win32_init.c +++ b/src/win32/win32_init.c @@ -189,8 +189,7 @@ int _glfwPlatformTerminate(void) const char* _glfwPlatformGetVersionString(void) { - // TODO: Add GLFW version somehow - const char* version = "GLFW " + const char* version = "GLFW " _GLFW_VERSION_FULL #if defined(__MINGW32__) " MinGW" #elif defined(__CYGWIN__) diff --git a/src/x11/CMakeLists.txt b/src/x11/CMakeLists.txt index fde2d773..654f8463 100644 --- a/src/x11/CMakeLists.txt +++ b/src/x11/CMakeLists.txt @@ -1,6 +1,3 @@ -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/x11_config.h.cmake - ${CMAKE_CURRENT_BINARY_DIR}/x11_config.h @ONLY) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/libglfw.pc.cmake diff --git a/src/x11/platform.h b/src/x11/platform.h index 8cf160f9..ba4823bf 100644 --- a/src/x11/platform.h +++ b/src/x11/platform.h @@ -43,7 +43,6 @@ #include #include "../../include/GL/glfw3.h" -#include "x11_config.h" // We need declarations for GLX version 1.3 or above even if the server doesn't // support version 1.3