From ebe4df478baa82f82c89d518bb1aa0ec57f9635a Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Fri, 27 Jan 2012 23:24:58 +0100 Subject: [PATCH 1/5] Formatting. --- CMakeLists.txt | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ad266f8..da63dc0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,18 +43,21 @@ if (UNIX AND NOT APPLE) set(_GLFW_X11_GLX 1) # Set up library and include paths - set(CMAKE_REQUIRED_LIBRARIES ${X11_X11_LIB} ${OPENGL_gl_LIBRARY}) - list(APPEND GLFW_INCLUDE_DIR ${X11_X11_INCLUDE_PATH}) - list(APPEND GLFW_LIBRARIES ${X11_X11_LIB}) - list(APPEND GLFW_INCLUDE_DIR ${OPENGL_INCLUDE_DIR}) - list(APPEND GLFW_LIBRARIES ${OPENGL_gl_LIBRARY}) + list(APPEND GLFW_INCLUDE_DIR ${X11_X11_INCLUDE_PATH} ${OPENGL_INCLUDE_DIR}) + list(APPEND GLFW_LIBRARIES ${X11_X11_LIB} ${OPENGL_gl_LIBRARY}) find_library(MATH_LIBRARY m) if (MATH_LIBRARY) - list(APPEND GLFW_LIBRARIES ${MATH_LIBRARY}) + list(APPEND GLFW_LIBRARIES ${MATH_LIBRARY}) endif(MATH_LIBRARY) - include(${CMAKE_CURRENT_SOURCE_DIR}/CMake/CheckX11Extensions.cmake) + find_library(RT_LIBRARY rt) + if (RT_LIBRARY) + list(APPEND GLFW_LIBRARIES ${RT_LIBRARY}) + endif(RT_LIBRARY) + + include(${GLFW_SOURCE_DIR}/CMake/CheckX11Extensions.cmake) + set(CMAKE_REQUIRED_LIBRARIES ${X11_X11_LIB} ${OPENGL_gl_LIBRARY}) # Check for XRandR (modern resolution switching extension) check_x11_xrandr() @@ -94,11 +97,6 @@ if (UNIX AND NOT APPLE) NOT _GLFW_HAS_GLXGETPROCADDRESSARB AND NOT _GLFW_HAS_GLXGETPROCADDRESSEXT) - find_library(LIBRT rt) - if (LIBRT) - list(APPEND GLFW_LIBRARIES ${LIBRT}) - endif(LIBRT) - if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") set(_GLFW_USE_LINUX_JOYSTICKS 1) endif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") @@ -165,11 +163,11 @@ install(FILES COPYING.txt readme.html #-------------------------------------------------------------------- # -- Documentation generation #-------------------------------------------------------------------- -#include("${CMAKE_CURRENT_SOURCE_DIR}/documentation.cmake") -#configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in" -# "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile" +#include("${GLFW_SOURCE_DIR}/documentation.cmake") +#configure_file("${GLFW_SOURCE_DIR}/Doxyfile.in" +# "${GLFW_BINARY_DIR}/Doxyfile" # IMMEDIATE @ONLY) -#add_doxygen_target("${CMAKE_CURRENT_BINARY_DIR}/Doxyfile") +#add_doxygen_target("${GLFW_BINARY_DIR}/Doxyfile") #add_subdirectory(docs) #-------------------------------------------------------------------- From 9433ba94a508424c06b24fc0dc1b3c6a704075f7 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Fri, 27 Jan 2012 23:39:31 +0100 Subject: [PATCH 2/5] Removed unused macro variable. --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index da63dc0c..da53aed5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,6 @@ if (WIN32) set(_GLFW_WIN32_WGL 1) # Set up library and include paths - set(CMAKE_REQUIRED_LIBRARIES ${OPENGL_gl_LIBRARY}) list(APPEND GLFW_INCLUDE_DIR ${OPENGL_INCLUDE_DIR}) list(APPEND GLFW_LIBRARIES ${OPENGL_gl_LIBRARY}) endif (WIN32) From 0dac7131c85972f445bda0710a75d60fcaa397f5 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Fri, 27 Jan 2012 23:41:07 +0100 Subject: [PATCH 3/5] Removed extra warning flags for Universal build. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index da53aed5..09191191 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,12 +112,12 @@ if (UNIX AND APPLE) option(GLFW_BUILD_UNIVERSAL "Build the GLFW library and examples as Universal Binaries" FALSE) - # Universal build, decent set of warning flags... + # Universal build if (GLFW_BUILD_UNIVERSAL) message(STATUS "Building GLFW as Universal Binaries") set(CMAKE_OSX_ARCHITECTURES ppc;i386;ppc64;x86_64) set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk) - set(CMAKE_C_FLAGS "-mmacosx-version-min=10.5 -Wall -Wextra -Wno-unused-parameter -Werror") + set(CMAKE_C_FLAGS "-mmacosx-version-min=10.5") else(GLFW_BUILD_UNIVERSAL) message(STATUS "Building GLFW only for the native architecture") endif(GLFW_BUILD_UNIVERSAL) From a6981b7f835bdc54642c72f58064e52c83b9714e Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Sat, 28 Jan 2012 00:01:05 +0100 Subject: [PATCH 4/5] Function and symbol checks are only performed on X11/GLX. --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09191191..4d8f5ebd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,9 +13,6 @@ set(GLFW_VERSION_FULL "${GLFW_VERSION}.${GLFW_VERSION_PATCH}${GLFW_VERSION_EXTRA option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" ON) option(GLFW_BUILD_TESTS "Build the GLFW test programs" ON) -include(CheckFunctionExists) -include(CheckSymbolExists) - find_package(OpenGL REQUIRED) #-------------------------------------------------------------------- @@ -55,6 +52,9 @@ if (UNIX AND NOT APPLE) list(APPEND GLFW_LIBRARIES ${RT_LIBRARY}) endif(RT_LIBRARY) + include(CheckFunctionExists) + include(CheckSymbolExists) + include(${GLFW_SOURCE_DIR}/CMake/CheckX11Extensions.cmake) set(CMAKE_REQUIRED_LIBRARIES ${X11_X11_LIB} ${OPENGL_gl_LIBRARY}) From 24dc846ac219e99189a34f42e86581dade760f56 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Sat, 28 Jan 2012 00:12:06 +0100 Subject: [PATCH 5/5] Re-used library list. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d8f5ebd..a6091750 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,7 +56,7 @@ if (UNIX AND NOT APPLE) include(CheckSymbolExists) include(${GLFW_SOURCE_DIR}/CMake/CheckX11Extensions.cmake) - set(CMAKE_REQUIRED_LIBRARIES ${X11_X11_LIB} ${OPENGL_gl_LIBRARY}) + set(CMAKE_REQUIRED_LIBRARIES ${GLFW_LIBRARIES}) # Check for XRandR (modern resolution switching extension) check_x11_xrandr()