-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
47 lines (39 loc) · 1.26 KB
/
CMakeLists.txt
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
44
45
46
47
# Minimum required version of CMake
cmake_minimum_required(VERSION 3.18)
# Set CMake project name
project(OSMESA)
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-O2 O2_COMPILER_FLAG)
find_package(Threads REQUIRED)
if (CMAKE_USE_PTHREADS_INIT)
add_definitions(-DPTHREADS)
endif (CMAKE_USE_PTHREADS_INIT)
include(CheckLibraryExists)
check_library_exists(m cos "" HAVE_M_LIBRARY)
if (HAVE_M_LIBRARY)
set(M_LIBRARY m)
endif (HAVE_M_LIBRARY)
# The point is to be separate from system OpenGL,
# so define the mangling headers to produce mgl_
# prefixing
add_definitions(-DUSE_MGL_NAMESPACE)
# The primary libosmesa library
add_subdirectory(src)
add_subdirectory(include)
# For testing purposes, the build defines a number
# of (relatively) self-contained OpenGL examples.
# These are very much optional - in case a distribution
# does not wish to include them, allow for the examples
# directory to have been removed
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/examples)
option(OSMESA_BUILD_EXAMPLES "Build example programs" ON)
if (OSMESA_BUILD_EXAMPLES)
add_subdirectory(examples)
endif (OSMESA_BUILD_EXAMPLES)
endif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/examples)
# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8