mirror of
https://github.com/glfw/glfw.git
synced 2025-10-04 13:46:37 +00:00
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:
parent
6eeecb1b22
commit
168ad2a4b3
@ -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,
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user