From 5832c7df37de90f5bc736e0e936cd38b4217e6b1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Thu, 12 May 2011 21:18:05 +0100 Subject: [PATCH] Don't link with unnecessary X11 libraries. --- CMakeLists.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e9b2ca5..7dbd307 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,11 +30,6 @@ if (NOT WIN32) find_package (PNG) find_package (X11 REQUIRED) - # We use GLX on MacOSX, which is in a separate library - if (APPLE) - find_library (X11_GL_LIB GL ${X11_LIB_SEARCH_PATH}) - set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_GL_LIB}) - endif (APPLE) else (NOT WIN32) find_package (DirectX) endif (NOT WIN32) @@ -325,7 +320,13 @@ target_link_libraries (glretrace ) if (NOT WIN32) - target_link_libraries (glretrace ${X11_LIBRARIES}) + target_link_libraries (glretrace ${X11_X11_LIB}) + + # We use GLX on MacOSX, which is in a separate library + if (APPLE) + find_library (X11_GL_LIB GL ${X11_LIB_SEARCH_PATH}) + target_link_libraries (glretrace ${X11_GL_LIB}) + endif (APPLE) endif (NOT WIN32) install (TARGETS glretrace RUNTIME DESTINATION bin) -- 2.45.2