From 3a73d80be4f09cac1decfa93b19f3f63010a9711 Mon Sep 17 00:00:00 2001 From: omniavinco Date: Fri, 29 Aug 2014 22:45:52 +0900 Subject: [PATCH] Add PLATFORM_SPECIFIC_LIBRARIES to link platform specific libraries --- CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8bc9b20..8708cfc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,15 +39,18 @@ IF( WIN32 ) SET( GL_LIBRARY opengl32 ) ELSEIF( APPLE ) FIND_LIBRARY( GL_LIBRARY OpenGL ) + FIND_LIBRARY( AGL_LIBRARY AGL ) + SET( PLATFORM_SPECIFIC_LIBRARIES ${AGL_LIBRARY} ) ELSE( ) - SET( GL_LIBRARY GL X11 dl Xext ) + SET( GL_LIBRARY GL ) + SET( PLATFORM_SPECIFIC_LIBRARIES X11 dl Xext ) ENDIF( ) IF ( glew-cmake_BUILD_STATIC ) SET_PROPERTY( TARGET libglew_static PROPERTY ARCHIVE_OUTPUT_NAME "glew" ) SET_PROPERTY( TARGET libglew_static PROPERTY DEBUG_POSTFIX d ) INSTALL( TARGETS libglew_static DESTINATION lib ) - TARGET_LINK_LIBRARIES( libglew_static ${GL_LIBRARY} ) + TARGET_LINK_LIBRARIES( libglew_static ${GL_LIBRARY} ${PLATFORM_SPECIFIC_LIBRARIES} ) ENDIF ( ) IF ( glew-cmake_BUILD_SHARED ) @@ -58,7 +61,7 @@ IF ( glew-cmake_BUILD_SHARED ) ENDIF( ) SET_PROPERTY( TARGET libglew_shared PROPERTY DEBUG_POSTFIX d ) - TARGET_LINK_LIBRARIES( libglew_shared ${GL_LIBRARY} ) + TARGET_LINK_LIBRARIES( libglew_shared ${GL_LIBRARY} ${PLATFORM_SPECIFIC_LIBRARIES} ) INSTALL( TARGETS libglew_shared DESTINATION lib ) ENDIF ( )