Skip to content

Commit

Permalink
Add an option to build against system-wide GLFW and GLEW
Browse files Browse the repository at this point in the history
  • Loading branch information
linkmauve committed Oct 6, 2018
1 parent bdfd99e commit b2b6542
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ option(BONZOMATIC_NDI "Enable NDI?" OFF)

option(BONZOMATIC_TOUCHBAR "Compile with macOS TouchBar support (Xcode 9 or newer required)?" ON)

option(BONZOMATIC_USE_SYSTEMWIDE_GLFW "Use the system-wide version of GLFW instead of the vendored one (this build option is not supported by upstream)?" OFF)
option(BONZOMATIC_USE_SYSTEMWIDE_GLEW "Use the system-wide version of GLEW instead of the vendored one (this build option is not supported by upstream)?" OFF)

set(BONZOMATIC_WINDOWS_FLAVOR "DX11" CACHE STRING "Windows renderer flavor selected at CMake configure time (DX11, DX9 or GLFW)")
set_property(CACHE BONZOMATIC_WINDOWS_FLAVOR PROPERTY STRINGS DX11 DX9 GLFW)

Expand Down Expand Up @@ -66,8 +69,10 @@ if (APPLE OR UNIX OR (WIN32 AND (${BONZOMATIC_WINDOWS_FLAVOR} MATCHES "GLFW")))
# GLFW
# GLFW settings and project inclusion
find_package(PkgConfig)
pkg_check_modules(GLFW glfw3>=3.3)
if (GLFW_FOUND)
if (PKG_CONFIG_FOUND AND BONZOMATIC_USE_SYSTEMWIDE_GLFW)
pkg_check_modules(GLFW glfw3>=3.3)
endif()
if (BONZOMATIC_USE_SYSTEMWIDE_GLFW AND GLFW_FOUND)
set(BZC_PROJECT_INCLUDES ${BZC_PROJECT_INCLUDES} ${GLFW_INCLUDES})
set(BZC_PROJECT_LIBS ${BZC_PROJECT_LIBS} ${GLFW_LIBRARIES})
else()
Expand All @@ -92,8 +97,10 @@ if (APPLE OR UNIX OR (WIN32 AND (${BONZOMATIC_WINDOWS_FLAVOR} MATCHES "GLFW")))

##############################################################################
# GLEW
pkg_check_modules(GLEW glew)
if (GLEW_FOUND)
if (PKG_CONFIG_FOUND AND BONZOMATIC_USE_SYSTEMWIDE_GLEW)
pkg_check_modules(GLFW glew)
endif()
if (BONZOMATIC_USE_SYSTEMWIDE_GLEW AND GLEW_FOUND)
set(BZC_PROJECT_INCLUDES ${BZC_PROJECT_INCLUDES} ${GLEW_INCLUDES})
set(BZC_PROJECT_LIBS ${BZC_PROJECT_LIBS} ${GLEW_LIBRARIES})
else ()
Expand Down

0 comments on commit b2b6542

Please sign in to comment.