summaryrefslogtreecommitdiffhomepage
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorAhmad Fatoum <[email protected]>2018-04-07 22:51:03 +0200
committerAhmad Fatoum <[email protected]>2018-04-07 23:39:53 +0200
commit1dbce352479f64748879fecb9df646654cd92229 (patch)
tree451901d0b4e5706b63d5a15ccd503ef3b975048c /src/CMakeLists.txt
parent1841afad11892bab16976b976d69b7757b617c8b (diff)
downloadraylib-1dbce352479f64748879fecb9df646654cd92229.tar.gz
raylib-1dbce352479f64748879fecb9df646654cd92229.zip
CMake: Generate config.h from CMakeOptions.txt
I would have liked config.h to be selected by include dir configuration, but this way is less intrusive.
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7bf8e3b0..632669ea 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,22 +1,26 @@
# Setup the project and settings
project(raylib)
-include("../utils.cmake")
include(GNUInstallDirs)
set(PROJECT_VERSION 1.9.4)
set(API_VERSION 1)
set(RAYLIB raylib) # Name of the generated library
+include("CMakeOptions.txt")
+configure_file(config.h.in ${CMAKE_BINARY_DIR}/cmake/config.h)
+include_directories(${CMAKE_BINARY_DIR})
+
+include("../utils.cmake")
+
# Get the sources together
file(GLOB raylib_sources *.c)
+
if(glfw3_FOUND)
list(REMOVE_ITEM raylib_sources ${CMAKE_CURRENT_SOURCE_DIR}/rglfw.c)
else()
include_directories(external/glfw/include)
endif()
-include("CMakeOptions.txt")
-
if(USE_AUDIO)
file(GLOB stb_vorbis external/stb_vorbis.c)
file(GLOB mini_al external/mini_al.c ${stb_vorbis})