summaryrefslogtreecommitdiff
path: root/next/platform/glfw/CMakeLists.txt
blob: b0263362a7506db9f26d5e0cef02378f3515b5c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
find_package(OpenGL REQUIRED)
find_package(PkgConfig REQUIRED)

pkg_search_module(GLFW glfw3 REQUIRED)

add_executable(
    mbgl-glfw
    ${MBGL_ROOT}/platform/glfw/main.cpp
    ${MBGL_ROOT}/platform/glfw/glfw_view.cpp
    ${MBGL_ROOT}/platform/glfw/glfw_gl_backend.cpp
    ${MBGL_ROOT}/platform/glfw/glfw_renderer_frontend.cpp
    ${MBGL_ROOT}/platform/glfw/settings_json.cpp
    ${MBGL_ROOT}/platform/glfw/test_writer.cpp
)

target_include_directories(
    mbgl-glfw
    PRIVATE ${GLFW_INCLUDE_DIRS}
)

include(${PROJECT_SOURCE_DIR}/vendor/cheap-ruler-cpp.cmake)

# Use target_link_directories when we move away from CMake 3.10.
target_link_libraries(
    mbgl-glfw
    PRIVATE $<$<BOOL:${GLFW_LIBRARY_DIRS}>:-L${GLFW_LIBRARY_DIRS}>
)

target_link_libraries(
    mbgl-glfw
    PRIVATE
        ${GLFW_LIBRARIES}
        Mapbox::Base::Extras::args
        Mapbox::Base::Extras::filesystem
        Mapbox::Base::Extras::rapidjson
        Mapbox::Map
        OpenGL::GL
        mbgl-vendor-cheap-ruler-cpp
)

set_property(TARGET mbgl-glfw PROPERTY FOLDER Executables)

install(TARGETS mbgl-glfw RUNTIME DESTINATION bin)