From d2d57c70e2340d04b69f1db2e3e666ac87cabb85 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 30 Dec 2015 21:05:27 +0100 Subject: [PATCH] Fix pkg-config file generation regression Fixes regression cased by 37c93ba031e18527f8ca70b8c6e733c63a5e4a30. Fixes #664. Closes #679. --- CMakeLists.txt | 7 +++++++ src/CMakeLists.txt | 8 +------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 780917c1..024fbdca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,6 +50,13 @@ if (BUILD_SHARED_LIBS) set(_GLFW_BUILD_DLL 1) endif() +if (BUILD_SHARED_LIBS AND UNIX) + # On Unix-like systems, shared libraries can use the soname system. + set(GLFW_LIB_NAME glfw) +else() + set(GLFW_LIB_NAME glfw3) +endif() + if (GLFW_USE_WAYLAND) set(GLFW_USE_EGL ON) elseif (GLFW_USE_MIR) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0d94b4a2..590a10f8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -52,6 +52,7 @@ endif() add_library(glfw ${glfw_SOURCES} ${glfw_HEADERS}) set_target_properties(glfw PROPERTIES + OUTPUT_NAME ${GLFW_LIB_NAME} VERSION ${GLFW_VERSION} SOVERSION ${GLFW_VERSION_MAJOR} POSITION_INDEPENDENT_CODE ON @@ -105,13 +106,6 @@ if (MSVC) target_compile_definitions(glfw PRIVATE _CRT_SECURE_NO_WARNINGS) endif() -if (BUILD_SHARED_LIBS AND UNIX) - # On Unix-like systems, shared libraries can use the soname system. - set_target_properties(glfw PROPERTIES OUTPUT_NAME glfw) -else() - set_target_properties(glfw PROPERTIES OUTPUT_NAME glfw3) -endif() - if (GLFW_INSTALL) install(TARGETS glfw EXPORT glfwTargets DESTINATION lib${LIB_SUFFIX}) endif()