From f1b5bb12fd5c627968108aba9266b1b346fc27cf Mon Sep 17 00:00:00 2001 From: Nicholas Yue Date: Tue, 25 Dec 2018 09:48:26 +1100 Subject: [PATCH] Add support for static GLFW3 library linking --- examples/glview/CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples/glview/CMakeLists.txt b/examples/glview/CMakeLists.txt index 91cb465..10851ae 100644 --- a/examples/glview/CMakeLists.txt +++ b/examples/glview/CMakeLists.txt @@ -11,6 +11,12 @@ if (apple) find_library(COCOA_LIBRARY Cocoa) find_library(COREVIDEO_LIBRARY CoreVideo) find_library(IOKIT_LIBRARY IOKit) +else () + if (NOT win32) + # This means it is Unices + set ( GLFW3_UNIX_LINK_LIBRARIES X11 Xxf86vm Xrandr Xi Xinerama Xcursor ) + find_package (Threads) + endif() endif (apple) set(CMAKE_CXX_STANDARD 11) @@ -29,6 +35,7 @@ add_executable(glview ) target_link_libraries ( glview + ${GLFW3_UNIX_LINK_LIBRARIES} ${GLEW_LIBRARY} ${GLFW3_glfw_LIBRARY} ${OPENGL_gl_LIBRARY} @@ -36,6 +43,8 @@ target_link_libraries ( glview ${COCOA_LIBRARY} ${COREVIDEO_LIBRARY} ${IOKIT_LIBRARY} + ${CMAKE_DL_LIBS} + ${CMAKE_THREAD_LIBS_INIT} ) install ( TARGETS