Skip to content
Snippets Groups Projects
Select Git revision
  • 11e47f08b14436c9759dcfb87af213c0696667db
  • for-vairdraw default protected
  • multi-context-windows
3 results

CMakeLists.txt

Blame
  • CMakeLists.txt 13.57 KiB
    cmake_minimum_required(VERSION 2.8.12)
    
    project(GLFW C)
    
    set(CMAKE_LEGACY_CYGWIN_WIN32 OFF)
    
    if (NOT CMAKE_VERSION VERSION_LESS "3.0")
        # Until all major package systems have moved to CMake 3,
        # we stick with the older INSTALL_NAME_DIR mechanism
        cmake_policy(SET CMP0042 OLD)
    endif()
    
    if (NOT CMAKE_VERSION VERSION_LESS "3.1")
        cmake_policy(SET CMP0054 NEW)
    endif()
    
    set(GLFW_VERSION_MAJOR "3")
    set(GLFW_VERSION_MINOR "3")
    set(GLFW_VERSION_PATCH "0")
    set(GLFW_VERSION_EXTRA "")
    set(GLFW_VERSION "${GLFW_VERSION_MAJOR}.${GLFW_VERSION_MINOR}")
    set(GLFW_VERSION_FULL "${GLFW_VERSION}.${GLFW_VERSION_PATCH}${GLFW_VERSION_EXTRA}")
    set(LIB_SUFFIX "" CACHE STRING "Takes an empty string or 64. Directory where lib will be installed: lib or lib64")
    
    set_property(GLOBAL PROPERTY USE_FOLDERS ON)
    
    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_BUILD_DOCS "Build the GLFW documentation" ON)
    option(GLFW_INSTALL "Generate installation target" ON)
    option(GLFW_VULKAN_STATIC "Use the Vulkan loader statically linked into application" OFF)
    option(GLFW_DOCUMENT_INTERNALS "Include internals in documentation" OFF)
    
    if (UNIX)
        option(GLFW_USE_OSMESA "Use OSMesa for offscreen context creation" OFF)
    endif()
    
    if (WIN32)
        option(GLFW_USE_HYBRID_HPG "Force use of high-performance GPU on hybrid systems" OFF)
    endif()
    
    if (UNIX AND NOT APPLE)
        option(GLFW_USE_WAYLAND "Use Wayland for window creation" OFF)
        option(GLFW_USE_MIR     "Use Mir for window creation" OFF)
    endif()
    
    if (MSVC)
        option(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC runtime library DLL" ON)
    endif()
    
    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_VULKAN_STATIC)
        set(_GLFW_VULKAN_STATIC 1)
    endif()
    
    list(APPEND CMAKE_MODULE_PATH "${GLFW_SOURCE_DIR}/CMake/modules")
    
    find_package(Threads REQUIRED)
    find_package(Vulkan)