diff --git a/CMakeLists.txt b/CMakeLists.txt index 41a962cdd..fc45be03e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,7 @@ project(GLFW C) cmake_minimum_required(VERSION 2.8.12) +cmake_policy(SET CMP0022 NEW) if (NOT CMAKE_VERSION VERSION_LESS "3.0") # Until all major package systems have moved to CMake 3, diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 77a8501f6..91e6224ca 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -58,6 +58,7 @@ if (APPLE) endif() add_library(glfw ${glfw_SOURCES} ${glfw_HEADERS}) +target_link_libraries(glfw ${glfw_LIBRARIES}) set_target_properties(glfw PROPERTIES OUTPUT_NAME "${GLFW_LIB_NAME}" VERSION ${GLFW_VERSION} @@ -86,8 +87,6 @@ if (BUILD_SHARED_LIBS) COMPILE_FLAGS "${glfw_CFLAGS} -fno-common" INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}") endif() - - target_link_libraries(glfw ${glfw_LIBRARIES}) endif() if (GLFW_INSTALL)