Quoted all CMake paths with substitution.

Fixes #258.
This commit is contained in:
Camilla Berglund 2014-08-11 20:24:16 +02:00
parent 87490316c8
commit 6e0ea02f17
4 changed files with 84 additions and 84 deletions

View File

@ -61,7 +61,7 @@ if (GLFW_USE_EGL)
message(FATAL_ERROR "Unsupported client library") message(FATAL_ERROR "Unsupported client library")
endif() endif()
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake/modules) set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMake/modules")
find_package(EGL REQUIRED) find_package(EGL REQUIRED)
if (NOT _GLFW_USE_OPENGL) if (NOT _GLFW_USE_OPENGL)
@ -200,8 +200,8 @@ if (_GLFW_WGL)
set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -lopengl32") set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -lopengl32")
list(APPEND glfw_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR}) list(APPEND glfw_INCLUDE_DIRS "${OPENGL_INCLUDE_DIR}")
list(APPEND glfw_LIBRARIES ${OPENGL_gl_LIBRARY}) list(APPEND glfw_LIBRARIES "${OPENGL_gl_LIBRARY}")
endif() endif()
#-------------------------------------------------------------------- #--------------------------------------------------------------------
@ -214,10 +214,10 @@ if (_GLFW_X11)
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} x11") set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} x11")
# Set up library and include paths # Set up library and include paths
list(APPEND glfw_INCLUDE_DIRS ${X11_X11_INCLUDE_PATH}) list(APPEND glfw_INCLUDE_DIRS "${X11_X11_INCLUDE_PATH}")
list(APPEND glfw_LIBRARIES ${X11_X11_LIB} ${CMAKE_THREAD_LIBS_INIT}) list(APPEND glfw_LIBRARIES "${X11_X11_LIB}" "${CMAKE_THREAD_LIBS_INIT}")
if (UNIX AND NOT APPLE) if (UNIX AND NOT APPLE)
list(APPEND glfw_LIBRARIES ${RT_LIBRARY}) list(APPEND glfw_LIBRARIES "${RT_LIBRARY}")
endif() endif()
# Check for XRandR (modern resolution switching and gamma control) # Check for XRandR (modern resolution switching and gamma control)
@ -225,8 +225,8 @@ if (_GLFW_X11)
message(FATAL_ERROR "The RandR library and headers were not found") message(FATAL_ERROR "The RandR library and headers were not found")
endif() endif()
list(APPEND glfw_INCLUDE_DIRS ${X11_Xrandr_INCLUDE_PATH}) list(APPEND glfw_INCLUDE_DIRS "${X11_Xrandr_INCLUDE_PATH}")
list(APPEND glfw_LIBRARIES ${X11_Xrandr_LIB}) list(APPEND glfw_LIBRARIES "${X11_Xrandr_LIB}")
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} xrandr") set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} xrandr")
# Check for XInput (high-resolution cursor motion) # Check for XInput (high-resolution cursor motion)
@ -234,10 +234,10 @@ if (_GLFW_X11)
message(FATAL_ERROR "The XInput library and headers were not found") message(FATAL_ERROR "The XInput library and headers were not found")
endif() endif()
list(APPEND glfw_INCLUDE_DIRS ${X11_Xinput_INCLUDE_PATH}) list(APPEND glfw_INCLUDE_DIRS "${X11_Xinput_INCLUDE_PATH}")
if (X11_Xinput_LIB) if (X11_Xinput_LIB)
list(APPEND glfw_LIBRARIES ${X11_Xinput_LIB}) list(APPEND glfw_LIBRARIES "${X11_Xinput_LIB}")
else() else()
# Backwards compatibility (bug in CMake 2.8.7) # Backwards compatibility (bug in CMake 2.8.7)
list(APPEND glfw_LIBRARIES Xi) list(APPEND glfw_LIBRARIES Xi)
@ -249,11 +249,11 @@ if (_GLFW_X11)
message(FATAL_ERROR "The Xf86VidMode library and headers were not found") message(FATAL_ERROR "The Xf86VidMode library and headers were not found")
endif() endif()
list(APPEND glfw_INCLUDE_DIRS ${X11_xf86vmode_INCLUDE_PATH}) list(APPEND glfw_INCLUDE_DIRS "${X11_xf86vmode_INCLUDE_PATH}")
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} xxf86vm") set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} xxf86vm")
if (X11_Xxf86vm_LIB) if (X11_Xxf86vm_LIB)
list(APPEND glfw_LIBRARIES ${X11_Xxf86vm_LIB}) list(APPEND glfw_LIBRARIES "${X11_Xxf86vm_LIB}")
else() else()
# Backwards compatibility (see CMake bug 0006976) # Backwards compatibility (see CMake bug 0006976)
list(APPEND glfw_LIBRARIES Xxf86vm) list(APPEND glfw_LIBRARIES Xxf86vm)
@ -264,19 +264,19 @@ if (_GLFW_X11)
message(FATAL_ERROR "The X keyboard extension headers were not found") message(FATAL_ERROR "The X keyboard extension headers were not found")
endif() endif()
list(APPEND glfw_INCLUDE_DIR ${X11_Xkb_INCLUDE_PATH}) list(APPEND glfw_INCLUDE_DIR "${X11_Xkb_INCLUDE_PATH}")
find_library(RT_LIBRARY rt) find_library(RT_LIBRARY rt)
mark_as_advanced(RT_LIBRARY) mark_as_advanced(RT_LIBRARY)
if (RT_LIBRARY) if (RT_LIBRARY)
list(APPEND glfw_LIBRARIES ${RT_LIBRARY}) list(APPEND glfw_LIBRARIES "${RT_LIBRARY}")
set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -lrt") set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -lrt")
endif() endif()
find_library(MATH_LIBRARY m) find_library(MATH_LIBRARY m)
mark_as_advanced(MATH_LIBRARY) mark_as_advanced(MATH_LIBRARY)
if (MATH_LIBRARY) if (MATH_LIBRARY)
list(APPEND glfw_LIBRARIES ${MATH_LIBRARY}) list(APPEND glfw_LIBRARIES "${MATH_LIBRARY}")
set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -lm") set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -lm")
endif() endif()
@ -285,8 +285,8 @@ if (_GLFW_X11)
message(FATAL_ERROR "The Xcursor libraries and headers were not found") message(FATAL_ERROR "The Xcursor libraries and headers were not found")
endif() endif()
list(APPEND glfw_INCLUDE_DIR ${X11_Xcursor_INCLUDE_PATH}) list(APPEND glfw_INCLUDE_DIR "${X11_Xcursor_INCLUDE_PATH}")
list(APPEND glfw_LIBRARIES ${X11_Xcursor_LIB}) list(APPEND glfw_LIBRARIES "${X11_Xcursor_LIB}")
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} xcursor") set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} xcursor")
endif() endif()
@ -298,18 +298,18 @@ if (_GLFW_WAYLAND)
find_package(Wayland REQUIRED) find_package(Wayland REQUIRED)
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} wayland-egl") set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} wayland-egl")
list(APPEND glfw_INCLUDE_DIRS ${WAYLAND_INCLUDE_DIR}) list(APPEND glfw_INCLUDE_DIRS "${WAYLAND_INCLUDE_DIR}")
list(APPEND glfw_LIBRARIES ${WAYLAND_LIBRARIES} -pthread) list(APPEND glfw_LIBRARIES "${WAYLAND_LIBRARIES}" -pthread)
find_package(XKBCommon REQUIRED) find_package(XKBCommon REQUIRED)
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} xkbcommon") set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} xkbcommon")
list(APPEND glfw_INCLUDE_DIRS ${XKBCOMMON_INCLUDE_DIRS}) list(APPEND glfw_INCLUDE_DIRS "${XKBCOMMON_INCLUDE_DIRS}")
list(APPEND glfw_LIBRARIES ${XKBCOMMON_LIBRARY}) list(APPEND glfw_LIBRARIES "${XKBCOMMON_LIBRARY}")
find_library(MATH_LIBRARY m) find_library(MATH_LIBRARY m)
mark_as_advanced(MATH_LIBRARY) mark_as_advanced(MATH_LIBRARY)
if (MATH_LIBRARY) if (MATH_LIBRARY)
list(APPEND glfw_LIBRARIES ${MATH_LIBRARY}) list(APPEND glfw_LIBRARIES "${MATH_LIBRARY}")
set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -lm") set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -lm")
endif() endif()
endif() endif()
@ -319,14 +319,14 @@ endif()
#-------------------------------------------------------------------- #--------------------------------------------------------------------
if (_GLFW_GLX) if (_GLFW_GLX)
list(APPEND glfw_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR}) list(APPEND glfw_INCLUDE_DIRS "${OPENGL_INCLUDE_DIR}")
list(APPEND glfw_LIBRARIES ${OPENGL_gl_LIBRARY}) list(APPEND glfw_LIBRARIES "${OPENGL_gl_LIBRARY}")
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} gl") set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} gl")
include(CheckFunctionExists) include(CheckFunctionExists)
set(CMAKE_REQUIRED_LIBRARIES ${OPENGL_gl_LIBRARY}) set(CMAKE_REQUIRED_LIBRARIES "${OPENGL_gl_LIBRARY}")
check_function_exists(glXGetProcAddress _GLFW_HAS_GLXGETPROCADDRESS) check_function_exists(glXGetProcAddress _GLFW_HAS_GLXGETPROCADDRESS)
check_function_exists(glXGetProcAddressARB _GLFW_HAS_GLXGETPROCADDRESSARB) check_function_exists(glXGetProcAddressARB _GLFW_HAS_GLXGETPROCADDRESSARB)
check_function_exists(glXGetProcAddressEXT _GLFW_HAS_GLXGETPROCADDRESSEXT) check_function_exists(glXGetProcAddressEXT _GLFW_HAS_GLXGETPROCADDRESSEXT)
@ -338,14 +338,14 @@ if (_GLFW_GLX)
# Check for dlopen support as a fallback # Check for dlopen support as a fallback
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS}) set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_DL_LIBS}")
check_function_exists(dlopen _GLFW_HAS_DLOPEN) check_function_exists(dlopen _GLFW_HAS_DLOPEN)
if (NOT _GLFW_HAS_DLOPEN) if (NOT _GLFW_HAS_DLOPEN)
message(FATAL_ERROR "No entry point retrieval mechanism found") message(FATAL_ERROR "No entry point retrieval mechanism found")
endif() endif()
if (CMAKE_DL_LIBS) if (CMAKE_DL_LIBS)
list(APPEND glfw_LIBRARIES ${CMAKE_DL_LIBS}) list(APPEND glfw_LIBRARIES "${CMAKE_DL_LIBS}")
set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -l${CMAKE_DL_LIBS}") set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} -l${CMAKE_DL_LIBS}")
endif() endif()
endif() endif()
@ -357,22 +357,22 @@ endif()
#-------------------------------------------------------------------- #--------------------------------------------------------------------
if (_GLFW_EGL) if (_GLFW_EGL)
list(APPEND glfw_INCLUDE_DIRS ${EGL_INCLUDE_DIR}) list(APPEND glfw_INCLUDE_DIRS "${EGL_INCLUDE_DIR}")
list(APPEND glfw_LIBRARIES ${EGL_LIBRARY}) list(APPEND glfw_LIBRARIES "${EGL_LIBRARY}")
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} egl") set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} egl")
if (_GLFW_USE_OPENGL) if (_GLFW_USE_OPENGL)
list(APPEND glfw_LIBRARIES ${OPENGL_gl_LIBRARY}) list(APPEND glfw_LIBRARIES "${OPENGL_gl_LIBRARY}")
list(APPEND glfw_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR}) list(APPEND glfw_INCLUDE_DIRS "${OPENGL_INCLUDE_DIR}")
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} gl") set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} gl")
elseif (_GLFW_USE_GLESV1) elseif (_GLFW_USE_GLESV1)
list(APPEND glfw_LIBRARIES ${GLESv1_LIBRARY}) list(APPEND glfw_LIBRARIES "${GLESv1_LIBRARY}")
list(APPEND glfw_INCLUDE_DIRS ${GLESv1_INCLUDE_DIR}) list(APPEND glfw_INCLUDE_DIRS "${GLESv1_INCLUDE_DIR}")
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} glesv1_cm") set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} glesv1_cm")
elseif (_GLFW_USE_GLESV2) elseif (_GLFW_USE_GLESV2)
list(APPEND glfw_LIBRARIES ${GLESv2_LIBRARY}) list(APPEND glfw_LIBRARIES "${GLESv2_LIBRARY}")
list(APPEND glfw_INCLUDE_DIRS ${GLESv2_INCLUDE_DIR}) list(APPEND glfw_INCLUDE_DIRS "${GLESv2_INCLUDE_DIR}")
set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} glesv2") set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} glesv2")
endif() endif()
@ -407,11 +407,11 @@ if (_GLFW_COCOA AND _GLFW_NSGL)
find_library(IOKIT_FRAMEWORK IOKit) find_library(IOKIT_FRAMEWORK IOKit)
find_library(CORE_FOUNDATION_FRAMEWORK CoreFoundation) find_library(CORE_FOUNDATION_FRAMEWORK CoreFoundation)
find_library(CORE_VIDEO_FRAMEWORK CoreVideo) find_library(CORE_VIDEO_FRAMEWORK CoreVideo)
list(APPEND glfw_LIBRARIES ${COCOA_FRAMEWORK} list(APPEND glfw_LIBRARIES "${COCOA_FRAMEWORK}"
${OPENGL_gl_LIBRARY} "${OPENGL_gl_LIBRARY}"
${IOKIT_FRAMEWORK} "${IOKIT_FRAMEWORK}"
${CORE_FOUNDATION_FRAMEWORK} "${CORE_FOUNDATION_FRAMEWORK}"
${CORE_VIDEO_FRAMEWORK}) "${CORE_VIDEO_FRAMEWORK}")
set(GLFW_PKG_DEPS "") set(GLFW_PKG_DEPS "")
set(GLFW_PKG_LIBS "-framework Cocoa -framework OpenGL -framework IOKit -framework CoreFoundation -framework CoreVideo") set(GLFW_PKG_LIBS "-framework Cocoa -framework OpenGL -framework IOKit -framework CoreFoundation -framework CoreVideo")
@ -436,21 +436,21 @@ endif()
# Create generated files # Create generated files
#-------------------------------------------------------------------- #--------------------------------------------------------------------
if (GLFW_BUILD_DOCS) if (GLFW_BUILD_DOCS)
configure_file(${GLFW_SOURCE_DIR}/docs/Doxyfile.in configure_file("${GLFW_SOURCE_DIR}/docs/Doxyfile.in"
${GLFW_BINARY_DIR}/docs/Doxyfile @ONLY) "${GLFW_BINARY_DIR}/docs/Doxyfile" @ONLY)
endif() endif()
configure_file(${GLFW_SOURCE_DIR}/src/glfw_config.h.in configure_file("${GLFW_SOURCE_DIR}/src/glfw_config.h.in"
${GLFW_BINARY_DIR}/src/glfw_config.h @ONLY) "${GLFW_BINARY_DIR}/src/glfw_config.h" @ONLY)
configure_file(${GLFW_SOURCE_DIR}/src/glfwConfig.cmake.in configure_file("${GLFW_SOURCE_DIR}/src/glfwConfig.cmake.in"
${GLFW_BINARY_DIR}/src/glfwConfig.cmake @ONLY) "${GLFW_BINARY_DIR}/src/glfwConfig.cmake" @ONLY)
configure_file(${GLFW_SOURCE_DIR}/src/glfwConfigVersion.cmake.in configure_file("${GLFW_SOURCE_DIR}/src/glfwConfigVersion.cmake.in"
${GLFW_BINARY_DIR}/src/glfwConfigVersion.cmake @ONLY) "${GLFW_BINARY_DIR}/src/glfwConfigVersion.cmake" @ONLY)
configure_file(${GLFW_SOURCE_DIR}/src/glfw3.pc.in configure_file("${GLFW_SOURCE_DIR}/src/glfw3.pc.in"
${GLFW_BINARY_DIR}/src/glfw3.pc @ONLY) "${GLFW_BINARY_DIR}/src/glfw3.pc" @ONLY)
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Add subdirectories # Add subdirectories
@ -477,22 +477,22 @@ if (GLFW_INSTALL)
install(DIRECTORY include/GLFW DESTINATION include install(DIRECTORY include/GLFW DESTINATION include
FILES_MATCHING PATTERN glfw3.h PATTERN glfw3native.h) FILES_MATCHING PATTERN glfw3.h PATTERN glfw3native.h)
install(FILES ${GLFW_BINARY_DIR}/src/glfwConfig.cmake install(FILES "${GLFW_BINARY_DIR}/src/glfwConfig.cmake"
${GLFW_BINARY_DIR}/src/glfwConfigVersion.cmake "${GLFW_BINARY_DIR}/src/glfwConfigVersion.cmake"
DESTINATION lib${LIB_SUFFIX}/cmake/glfw) DESTINATION lib${LIB_SUFFIX}/cmake/glfw)
install(EXPORT glfwTargets DESTINATION lib${LIB_SUFFIX}/cmake/glfw) install(EXPORT glfwTargets DESTINATION lib${LIB_SUFFIX}/cmake/glfw)
install(FILES ${GLFW_BINARY_DIR}/src/glfw3.pc install(FILES "${GLFW_BINARY_DIR}/src/glfw3.pc"
DESTINATION lib${LIB_SUFFIX}/pkgconfig) DESTINATION lib${LIB_SUFFIX}/pkgconfig)
# Only generate this target if no higher-level project already has # Only generate this target if no higher-level project already has
if (NOT TARGET uninstall) if (NOT TARGET uninstall)
configure_file(${GLFW_SOURCE_DIR}/cmake_uninstall.cmake.in configure_file("${GLFW_SOURCE_DIR}/cmake_uninstall.cmake.in"
${GLFW_BINARY_DIR}/cmake_uninstall.cmake IMMEDIATE @ONLY) "${GLFW_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY)
add_custom_target(uninstall add_custom_target(uninstall
${CMAKE_COMMAND} -P "${CMAKE_COMMAND}" -P
${GLFW_BINARY_DIR}/cmake_uninstall.cmake) "${GLFW_BINARY_DIR}/cmake_uninstall.cmake")
endif() endif()
endif() endif()

View File

@ -1,27 +1,27 @@
link_libraries(glfw ${OPENGL_glu_LIBRARY}) link_libraries(glfw "${OPENGL_glu_LIBRARY}")
if (BUILD_SHARED_LIBS) if (BUILD_SHARED_LIBS)
add_definitions(-DGLFW_DLL) add_definitions(-DGLFW_DLL)
link_libraries(${OPENGL_gl_LIBRARY} ${MATH_LIBRARY}) link_libraries("${OPENGL_gl_LIBRARY}" "${MATH_LIBRARY}")
else() else()
link_libraries(${glfw_LIBRARIES}) link_libraries(${glfw_LIBRARIES})
endif() endif()
include_directories(${GLFW_SOURCE_DIR}/include include_directories("${GLFW_SOURCE_DIR}/include"
${GLFW_SOURCE_DIR}/deps) "${GLFW_SOURCE_DIR}/deps")
if (NOT APPLE) if (NOT APPLE)
# HACK: This is NOTFOUND on OS X 10.8 # HACK: This is NOTFOUND on OS X 10.8
include_directories(${OPENGL_INCLUDE_DIR}) include_directories("${OPENGL_INCLUDE_DIR}")
endif() endif()
set(GLAD ${GLFW_SOURCE_DIR}/deps/glad/glad.h set(GLAD "${GLFW_SOURCE_DIR}/deps/glad/glad.h"
${GLFW_SOURCE_DIR}/deps/glad.c) "${GLFW_SOURCE_DIR}/deps/glad.c")
set(GETOPT ${GLFW_SOURCE_DIR}/deps/getopt.h set(GETOPT "${GLFW_SOURCE_DIR}/deps/getopt.h"
${GLFW_SOURCE_DIR}/deps/getopt.c) "${GLFW_SOURCE_DIR}/deps/getopt.c")
set(TINYCTHREAD ${GLFW_SOURCE_DIR}/deps/tinycthread.h set(TINYCTHREAD "${GLFW_SOURCE_DIR}/deps/tinycthread.h"
${GLFW_SOURCE_DIR}/deps/tinycthread.c) "${GLFW_SOURCE_DIR}/deps/tinycthread.c")
if (APPLE) if (APPLE)
# Set fancy names for bundles # Set fancy names for bundles
@ -50,9 +50,9 @@ else()
endif() endif()
if (APPLE) if (APPLE)
target_link_libraries(Particles ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries(Particles "${CMAKE_THREAD_LIBS_INIT}")
elseif (UNIX) elseif (UNIX)
target_link_libraries(particles ${CMAKE_THREAD_LIBS_INIT} ${RT_LIBRARY}) target_link_libraries(particles "${CMAKE_THREAD_LIBS_INIT}" "${RT_LIBRARY}")
endif() endif()
if (MSVC) if (MSVC)

View File

@ -1,13 +1,13 @@
include_directories(${GLFW_SOURCE_DIR}/src include_directories("${GLFW_SOURCE_DIR}/src"
${GLFW_BINARY_DIR}/src "${GLFW_BINARY_DIR}/src"
${glfw_INCLUDE_DIRS}) ${glfw_INCLUDE_DIRS})
add_definitions(-D_GLFW_USE_CONFIG_H) add_definitions(-D_GLFW_USE_CONFIG_H)
set(common_HEADERS ${GLFW_BINARY_DIR}/src/glfw_config.h internal.h set(common_HEADERS "${GLFW_BINARY_DIR}/src/glfw_config.h" internal.h
${GLFW_SOURCE_DIR}/include/GLFW/glfw3.h "${GLFW_SOURCE_DIR}/include/GLFW/glfw3.h"
${GLFW_SOURCE_DIR}/include/GLFW/glfw3native.h) "${GLFW_SOURCE_DIR}/include/GLFW/glfw3native.h")
set(common_SOURCES clipboard.c context.c gamma.c init.c input.c joystick.c set(common_SOURCES clipboard.c context.c gamma.c init.c input.c joystick.c
monitor.c time.c window.c) monitor.c time.c window.c)

View File

@ -1,5 +1,5 @@
link_libraries(glfw ${OPENGL_glu_LIBRARY}) link_libraries(glfw "${OPENGL_glu_LIBRARY}")
if (BUILD_SHARED_LIBS) if (BUILD_SHARED_LIBS)
add_definitions(-DGLFW_DLL) add_definitions(-DGLFW_DLL)
@ -8,18 +8,18 @@ else()
link_libraries(${glfw_LIBRARIES}) link_libraries(${glfw_LIBRARIES})
endif() endif()
include_directories(${GLFW_SOURCE_DIR}/include include_directories("${GLFW_SOURCE_DIR}/include"
${GLFW_SOURCE_DIR}/deps) "${GLFW_SOURCE_DIR}/deps")
if (NOT APPLE) if (NOT APPLE)
# HACK: This is NOTFOUND on OS X 10.8 # HACK: This is NOTFOUND on OS X 10.8
include_directories(${OPENGL_INCLUDE_DIR}) include_directories(${OPENGL_INCLUDE_DIR})
endif() endif()
set(GETOPT ${GLFW_SOURCE_DIR}/deps/getopt.h set(GETOPT "${GLFW_SOURCE_DIR}/deps/getopt.h"
${GLFW_SOURCE_DIR}/deps/getopt.c) "${GLFW_SOURCE_DIR}/deps/getopt.c")
set(TINYCTHREAD ${GLFW_SOURCE_DIR}/deps/tinycthread.h set(TINYCTHREAD "${GLFW_SOURCE_DIR}/deps/tinycthread.h"
${GLFW_SOURCE_DIR}/deps/tinycthread.c) "${GLFW_SOURCE_DIR}/deps/tinycthread.c")
add_executable(clipboard clipboard.c ${GETOPT}) add_executable(clipboard clipboard.c ${GETOPT})
add_executable(defaults defaults.c) add_executable(defaults defaults.c)
@ -58,8 +58,8 @@ set_target_properties(title PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Title")
add_executable(windows WIN32 MACOSX_BUNDLE windows.c) add_executable(windows WIN32 MACOSX_BUNDLE windows.c)
set_target_properties(windows PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Windows") set_target_properties(windows PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Windows")
target_link_libraries(empty ${CMAKE_THREAD_LIBS_INIT} ${RT_LIBRARY}) target_link_libraries(empty "${CMAKE_THREAD_LIBS_INIT}" "${RT_LIBRARY}")
target_link_libraries(threads ${CMAKE_THREAD_LIBS_INIT} ${RT_LIBRARY}) target_link_libraries(threads "${CMAKE_THREAD_LIBS_INIT}" "${RT_LIBRARY}")
set(WINDOWS_BINARIES accuracy empty sharing tearing threads title windows cursoranim) set(WINDOWS_BINARIES accuracy empty sharing tearing threads title windows cursoranim)
set(CONSOLE_BINARIES clipboard defaults events fsaa gamma glfwinfo set(CONSOLE_BINARIES clipboard defaults events fsaa gamma glfwinfo