Export transitive dependencies

Uses CMake 2.8.12 policy to export transitive interface libraries via
glfw3Targets.cmake. This means we now link to dependent libraries
(i.e. opengl32 on Win32) for free.
This commit is contained in:
Nicholas Vitovitch 2015-03-10 23:55:28 -04:00 committed by Zbigniew Mandziejewicz
parent 6eeecb1b22
commit 168ad2a4b3
2 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,7 @@
project(GLFW C) project(GLFW C)
cmake_minimum_required(VERSION 2.8.12) cmake_minimum_required(VERSION 2.8.12)
cmake_policy(SET CMP0022 NEW)
if (NOT CMAKE_VERSION VERSION_LESS "3.0") if (NOT CMAKE_VERSION VERSION_LESS "3.0")
# Until all major package systems have moved to CMake 3, # Until all major package systems have moved to CMake 3,

View File

@ -58,6 +58,7 @@ if (APPLE)
endif() endif()
add_library(glfw ${glfw_SOURCES} ${glfw_HEADERS}) add_library(glfw ${glfw_SOURCES} ${glfw_HEADERS})
target_link_libraries(glfw ${glfw_LIBRARIES})
set_target_properties(glfw PROPERTIES set_target_properties(glfw PROPERTIES
OUTPUT_NAME "${GLFW_LIB_NAME}" OUTPUT_NAME "${GLFW_LIB_NAME}"
VERSION ${GLFW_VERSION} VERSION ${GLFW_VERSION}
@ -86,8 +87,6 @@ if (BUILD_SHARED_LIBS)
COMPILE_FLAGS "${glfw_CFLAGS} -fno-common" COMPILE_FLAGS "${glfw_CFLAGS} -fno-common"
INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}") INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
endif() endif()
target_link_libraries(glfw ${glfw_LIBRARIES})
endif() endif()
if (GLFW_INSTALL) if (GLFW_INSTALL)