2018-04-07 17:53:19 +03:00
### Config options ###
2018-04-07 23:51:03 +03:00
include(CMakeDependentOption)
2018-07-23 21:42:19 +03:00
include(EnumOption)
2018-04-07 17:53:19 +03:00
2018-07-23 21:42:19 +03:00
enum_option(PLATFORM "Desktop;Web;Android;Raspberry Pi" "Platform to build for.")
2018-04-12 20:31:53 +03:00
2018-07-23 21:42:19 +03:00
enum_option(OPENGL_VERSION "3.3;2.1;1.1;ES 2.0" "OpenGL Version to build raylib with")
2018-04-12 20:31:53 +03:00
2018-04-07 17:53:19 +03:00
# Shared library is always PIC. Static library should be PIC too if linked into a shared library
option(WITH_PIC "Compile static library as position-independent code" OFF)
option(SHARED "Build raylib as a dynamic library" OFF)
option(STATIC "Build raylib as a static library" ON)
option(MACOS_FATLIB "Build fat library for both i386 and x86_64 on macOS" ON)
2018-04-07 23:51:03 +03:00
option(USE_AUDIO "Build raylib with audio module" ON)
2018-04-12 20:31:53 +03:00
if(${PLATFORM} MATCHES "Web")
cmake_dependent_option(USE_OPENAL_BACKEND "Link raylib with openAL instead of mini-al" ON "USE_AUDIO" OFF)
else()
cmake_dependent_option(USE_OPENAL_BACKEND "Link raylib with openAL instead of mini-al" OFF "USE_AUDIO" OFF)
endif()
2018-07-23 21:42:19 +03:00
enum_option(USE_EXTERNAL_GLFW "OFF;IF_POSSIBLE;ON" "Link raylib against system GLFW instead of embedded one")
2018-04-07 23:51:03 +03:00
if(UNIX AND NOT APPLE)
2018-07-23 21:42:19 +03:00
option(USE_WAYLAND "Use Wayland for window creation" OFF)
2018-04-07 23:51:03 +03:00
endif()
2018-07-27 19:28:37 +03:00
option(INCLUDE_EVERYTHING "Include everything disabled by default (for CI usage" OFF)
set(OFF ${INCLUDE_EVERYTHING} CACHE INTERNAL "Replace any OFF by default with \${OFF} to have it covered by this option")
2018-04-07 17:53:19 +03:00
2018-04-07 23:51:03 +03:00
# core.c
option(SUPPORT_BUSY_WAIT_LOOP "Use busy wait loop for timing sync instead of a high-resolution timer" ON)
option(SUPPORT_CAMERA_SYSTEM "Provide camera module (camera.h) with multiple predefined cameras: free, 1st/3rd person, orbital" ON)
option(SUPPORT_DEFAULT_FONT "Default font is loaded on window initialization to be available for the user to render simple text. If enabled, uses external module functions to load default raylib font (module: text)" ON)
2018-04-29 13:53:32 +03:00
option(SUPPORT_SCREEN_CAPTURE "Allow automatic screen capture of current screen pressing F12, defined in KeyCallback()" ON)
2018-04-07 23:51:03 +03:00
option(SUPPORT_GIF_RECORDING "Allow automatic gif recording of current screen pressing CTRL+F12, defined in KeyCallback()" ON)
option(SUPPORT_GESTURES_SYSTEM "Gestures module is included (gestures.h) to support gestures detection: tap, hold, swipe, drag" ON)
option(SUPPORT_MOUSE_GESTURES "Mouse gestures are directly mapped like touches and processed by gestures system" ON)
2018-07-16 19:43:24 +03:00
# rlgl.h
2018-04-07 23:51:03 +03:00
option(SUPPORT_VR_SIMULATOR "Support VR simulation functionality (stereo rendering)" ON)
option(SUPPORT_DISTORTION_SHADER "Include stereo rendering distortion shader (shader_distortion.h)" ON)
2018-04-29 13:53:32 +03:00
# shapes.c
option(SUPPORT_FONT_TEXTURE "Draw rectangle shapes using font texture white character instead of default white texture. Allows drawing rectangles and text with a single draw call, very useful for GUI systems!" ON)
option(SUPPORT_QUADS_DRAW_MODE "Use QUADS instead of TRIANGLES for drawing when possible. Some lines-based shapes could still use lines" ON)
2018-04-07 23:51:03 +03:00
# textures.c
option(SUPPORT_IMAGE_GENERATION "Support proedural image generation functionality (gradient, spot, perlin-noise, cellular)" ON)
option(SUPPORT_FILEFORMAT_PNG "Support loading PNG as textures" ON)
option(SUPPORT_FILEFORMAT_DDS "Support loading DDS as textures" ON)
option(SUPPORT_FILEFORMAT_HDR "Support loading HDR as textures" ON)
option(SUPPORT_FILEFORMAT_KTX "Support loading KTX as textures" ON)
2018-07-23 21:42:19 +03:00
option(SUPPORT_FILEFORMAT_ASTC "Support loading ASTC as textures" ON)
2018-07-27 19:28:37 +03:00
option(SUPPORT_FILEFORMAT_BMP "Support loading BMP as textures" ${OFF})
option(SUPPORT_FILEFORMAT_TGA "Support loading TGA as textures" ${OFF})
option(SUPPORT_FILEFORMAT_JPG "Support loading JPG as textures" ${OFF})
option(SUPPORT_FILEFORMAT_GIF "Support loading GIF as textures" ${OFF})
option(SUPPORT_FILEFORMAT_PSD "Support loading PSD as textures" ${OFF})
option(SUPPORT_FILEFORMAT_PKM "Support loading PKM as textures" ${OFF})
option(SUPPORT_FILEFORMAT_PVR "Support loading PVR as textures" ${OFF})
2018-04-07 23:51:03 +03:00
2018-04-29 13:53:32 +03:00
# models.c
option(SUPPORT_FILEFORMAT_OBJ "Support loading OBJ file format" ON)
option(SUPPORT_FILEFORMAT_MTL "Support loading MTL file format" ON)
option(SUPPORT_MESH_GENERATION "Support procedural mesh generation functions, uses external par_shapes.h library. NOTE: Some generated meshes DO NOT include generated texture coordinates" ON)
2018-04-07 23:51:03 +03:00
# audio.c
option(SUPPORT_FILEFORMAT_WAV "Support loading WAV for sound" ON)
option(SUPPORT_FILEFORMAT_OGG "Support loading OGG for sound" ON)
option(SUPPORT_FILEFORMAT_XM "Support loading XM for sound" ON)
option(SUPPORT_FILEFORMAT_MOD "Support loading MOD for sound" ON)
2018-07-27 19:28:37 +03:00
option(SUPPORT_FILEFORMAT_FLAC "Support loading FLAC for sound" ${OFF})
2018-04-07 23:51:03 +03:00
# utils.c
option(SUPPORT_SAVE_PNG "Support saving image data in PNG file format" ON)
2018-07-27 19:28:37 +03:00
option(SUPPORT_SAVE_BMP "Support saving image data in BMP file format" ${OFF})
2018-04-07 23:51:03 +03:00
option(SUPPORT_TRACELOG "Show TraceLog() output messages. NOTE: By default LOG_DEBUG traces not shown" ON)
option(SUPPORT_FILEFORMAT_FNT "Support loading fonts in FNT format" ON)
option(SUPPORT_FILEFORMAT_TTF "Support loading font in TTF format" ON)
option(SUPPORT_IMAGE_MANIPULATION "Support multiple image editing functions to scale, adjust colors, flip, draw on images, crop... If not defined only three image editing functions supported: ImageFormat(), ImageAlphaMask(), ImageToPOT()" ON)
2018-04-07 17:53:19 +03:00
if(NOT (STATIC OR SHARED))
message(FATAL_ERROR "Nothing to do if both -DSHARED=OFF and -DSTATIC=OFF...")
endif()
if(DEFINED SHARED_RAYLIB)
set(SHARED ${SHARED_RAYLIB})
message(DEPRECATION "-DSHARED_RAYLIB is deprecated. Please use -DSHARED instead.")
endif()
if(DEFINED STATIC_RAYLIB)
set(STATIC ${STATIC_RAYLIB})
message(DEPRECATION "-DSTATIC_RAYLIB is deprecated. Please use -DSTATIC instead.")
endif()
2018-04-12 20:31:53 +03:00
if(${PLATFORM} MATCHES "Desktop" AND APPLE)
if(MACOS_FATLIB)
if (CMAKE_OSX_ARCHITECTURES)
message(FATAL_ERROR "User supplied -DCMAKE_OSX_ARCHITECTURES overrides -DMACOS_FATLIB=ON")
else()
set(CMAKE_OSX_ARCHITECTURES "x86_64;i386")
endif()
endif()
endif()
2018-04-07 17:53:19 +03:00
# vim: ft=cmake