This file is part of MXE. See index.html for further information. Contains ad hoc patches for cross building. From 7106d77856268c39b08de8cbe6f526fda8506389 Mon Sep 17 00:00:00 2001 From: MXE Date: Sun, 10 Nov 2013 16:23:03 +1100 Subject: [PATCH] add option to install pkg-config file diff --git a/CMakeLists.txt b/CMakeLists.txt index 7c9b2c2..cd0112c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,7 @@ option(BUILD_SHARED_LIBS "Build shared libraries" OFF) option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" ON) option(GLFW_BUILD_TESTS "Build the GLFW test programs" ON) option(GLFW_INSTALL "Generate installation target" ON) +option(GLFW_INSTALL_PKG_CONFIG "Install pkg-config file" OFF) option(GLFW_DOCUMENT_INTERNALS "Include internals in documentation" OFF) if (WIN32) @@ -117,7 +118,7 @@ endif() #-------------------------------------------------------------------- if (WIN32) set(_GLFW_WIN32 1) - message(STATUS "Using Win32 for window creation") + message(STATUS "Using Win32 for window creation") if (GLFW_USE_EGL) set(_GLFW_EGL 1) @@ -133,7 +134,7 @@ elseif (APPLE) message(STATUS "Using NSGL for context creation") elseif (UNIX) set(_GLFW_X11 1) - message(STATUS "Using X11 for window creation") + message(STATUS "Using X11 for window creation") if (GLFW_USE_EGL) set(_GLFW_EGL 1) @@ -238,7 +239,7 @@ if (_GLFW_X11) # Check for Xkb (X keyboard extension) if (NOT X11_Xkb_FOUND) message(FATAL_ERROR "The X keyboard extension headers were not found") - endif() + endif() list(APPEND glfw_INCLUDE_DIR ${X11_Xkb_INCLUDE_PATH}) @@ -336,7 +337,7 @@ endif() # Use Cocoa for window creation and NSOpenGL for context creation #-------------------------------------------------------------------- if (_GLFW_COCOA AND _GLFW_NSGL) - + if (GLFW_USE_MENUBAR) set(_GLFW_USE_MENUBAR 1) endif() @@ -351,7 +352,7 @@ if (_GLFW_COCOA AND _GLFW_NSGL) else() message(STATUS "Building GLFW only for the native architecture") endif() - + # Set up library and include paths find_library(COCOA_FRAMEWORK Cocoa) find_library(IOKIT_FRAMEWORK IOKit) @@ -386,7 +387,7 @@ endif() configure_file(${GLFW_SOURCE_DIR}/docs/Doxyfile.in ${GLFW_BINARY_DIR}/docs/Doxyfile @ONLY) -configure_file(${GLFW_SOURCE_DIR}/src/config.h.in +configure_file(${GLFW_SOURCE_DIR}/src/config.h.in ${GLFW_BINARY_DIR}/src/config.h @ONLY) configure_file(${GLFW_SOURCE_DIR}/src/glfwConfig.cmake.in @@ -395,7 +396,7 @@ configure_file(${GLFW_SOURCE_DIR}/src/glfwConfig.cmake.in configure_file(${GLFW_SOURCE_DIR}/src/glfwConfigVersion.cmake.in ${GLFW_BINARY_DIR}/src/glfwConfigVersion.cmake @ONLY) -if (UNIX) +if (UNIX OR GLFW_INSTALL_PKG_CONFIG) configure_file(${GLFW_SOURCE_DIR}/src/glfw3.pc.in ${GLFW_BINARY_DIR}/src/glfw3.pc @ONLY) endif() @@ -422,7 +423,7 @@ endif() # The library is installed by src/CMakeLists.txt #-------------------------------------------------------------------- if (GLFW_INSTALL) - install(DIRECTORY include/GLFW DESTINATION include + install(DIRECTORY include/GLFW DESTINATION include FILES_MATCHING PATTERN glfw3.h PATTERN glfw3native.h) install(FILES ${GLFW_BINARY_DIR}/src/glfwConfig.cmake @@ -431,6 +432,9 @@ if (GLFW_INSTALL) if (UNIX) install(EXPORT glfwTargets DESTINATION lib${LIB_SUFFIX}/cmake/glfw) + endif() + + if (UNIX OR GLFW_INSTALL_PKG_CONFIG) install(FILES ${GLFW_BINARY_DIR}/src/glfw3.pc DESTINATION lib${LIB_SUFFIX}/pkgconfig) endif() -- 1.8.4