1
1
cmake_minimum_required (VERSION 3.16)
2
2
3
- if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR )
4
- message (FATAL_ERROR "Prevented in-tree build. Please create a build directory outside of the SDL source code and run \" cmake -S ${CMAKE_SOURCE_DIR} -B .\" from there" )
5
- endif ()
6
-
7
3
# See docs/release_checklist.md
8
4
project (SDL3 LANGUAGES C VERSION "3.1.5" )
9
5
@@ -456,7 +452,7 @@ sdl_compile_definitions(PRIVATE "USING_GENERATED_CONFIG_H")
456
452
sdl_include_directories(
457
453
PRIVATE
458
454
"${SDL3_BINARY_DIR} /include-config-$<LOWER_CASE:$<CONFIG>>/build_config"
459
- "${SDL3_BINARY_DIR} /include"
455
+ "${SDL3_BINARY_DIR} /include-revision "
460
456
"${SDL3_SOURCE_DIR} /include"
461
457
)
462
458
# Note: The clang toolset for Visual Studio does not support the '-idirafter' option.
@@ -3050,11 +3046,11 @@ endif()
3050
3046
# config variables may contain generator expression, so we need to generate SDL_build_config.h in 2 steps:
3051
3047
# 1. replace all `#cmakedefine`'s and `@abc@`
3052
3048
configure_file ("${SDL3_SOURCE_DIR} /include/build_config/SDL_build_config.h.cmake"
3053
- "${SDL3_BINARY_DIR} /SDL_build_config.h.intermediate" )
3049
+ "${SDL3_BINARY_DIR} /CMakeFiles/ SDL_build_config.h.intermediate" )
3054
3050
# 2. generate SDL_build_config.h in an build_type-dependent folder (which should be first in the include search path)
3055
3051
file (GENERATE
3056
3052
OUTPUT "${SDL3_BINARY_DIR} /include-config-$<LOWER_CASE:$<CONFIG>>/build_config/SDL_build_config.h"
3057
- INPUT "${SDL3_BINARY_DIR} /SDL_build_config.h.intermediate"
3053
+ INPUT "${SDL3_BINARY_DIR} /CMakeFiles/ SDL_build_config.h.intermediate"
3058
3054
)
3059
3055
3060
3056
file (GLOB SDL3_INCLUDE_FILES "${SDL3_SOURCE_DIR} /include/SDL3/*.h" )
@@ -3078,9 +3074,9 @@ if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/REVISION.txt")
3078
3074
set (SDL_REVISION "SDL3-${SDL_REVISION_CENTER} " )
3079
3075
endif ()
3080
3076
3081
- execute_process (COMMAND "${CMAKE_COMMAND} " -E make_directory "${SDL3_BINARY_DIR} /include/SDL3" )
3082
- configure_file (include /build_config/SDL_revision.h.cmake include /SDL3/SDL_revision.h @ONLY)
3083
- list (APPEND SDL3_INCLUDE_FILES "${SDL3_BINARY_DIR} /include/SDL3/SDL_revision.h" )
3077
+ execute_process (COMMAND "${CMAKE_COMMAND} " -E make_directory "${SDL3_BINARY_DIR} /include-revision /SDL3" )
3078
+ configure_file (include /build_config/SDL_revision.h.cmake include -revision /SDL3/SDL_revision.h @ONLY)
3079
+ list (APPEND SDL3_INCLUDE_FILES "${SDL3_BINARY_DIR} /include-revision /SDL3/SDL_revision.h" )
3084
3080
3085
3081
if (SDL_FRAMEWORK)
3086
3082
# With Apple frameworks, headers in the PUBLIC_HEADER property also need to be added as sources
@@ -3277,7 +3273,7 @@ add_library(SDL3::Headers ALIAS SDL3_Headers)
3277
3273
set_property (TARGET SDL3_Headers PROPERTY EXPORT_NAME "Headers" )
3278
3274
target_include_directories (SDL3_Headers
3279
3275
INTERFACE
3280
- "$<BUILD_INTERFACE:${SDL3_BINARY_DIR} /include>"
3276
+ "$<BUILD_INTERFACE:${SDL3_BINARY_DIR} /include-revision >"
3281
3277
"$<BUILD_INTERFACE:${SDL3_SOURCE_DIR} /include>"
3282
3278
)
3283
3279
if (SDL_FRAMEWORK)
0 commit comments