@@ -8,13 +8,13 @@ endif()
8
8
project (SDL3 LANGUAGES C VERSION "3.1.9" )
9
9
10
10
if (CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR )
11
- set (SDL3_SUBPROJECT OFF )
11
+ set (SDL3_MAINPROJECT ON )
12
12
else ()
13
- set (SDL3_SUBPROJECT ON )
13
+ set (SDL3_MAINPROJECT OFF )
14
14
endif ()
15
15
16
16
# By default, configure SDL3 in RelWithDebInfo configuration
17
- if (NOT SDL3_SUBPROJECT )
17
+ if (SDL3_MAINPROJECT )
18
18
get_property (is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
19
19
if (is_multi_config)
20
20
# The first item in CMAKE_CONFIGURATION_TYPES is the default configuration
@@ -287,14 +287,14 @@ if(SOLARIS)
287
287
endif ()
288
288
289
289
# Allow some projects to be built conditionally.
290
- set_option(SDL_DISABLE_INSTALL "Disable installation of SDL3" ${SDL3_SUBPROJECT } )
291
- cmake_dependent_option(SDL_DISABLE_INSTALL_CPACK "Create binary SDL3 archive using CPack" ${SDL3_SUBPROJECT } "NOT SDL_DISABLE_INSTALL " ON )
292
- cmake_dependent_option(SDL_DISABLE_INSTALL_DOCS "Install docs for SDL3" ON "NOT SDL_DISABLE_INSTALL ;NOT SDL_FRAMEWORK" ON )
293
- set_option(SDL_DISABLE_UNINSTALL "Disable uninstallation of SDL3" OFF )
290
+ set_option(SDL_INSTALL "Enable installation of SDL3" ${SDL3_MAINPROJECT } )
291
+ cmake_dependent_option(SDL_INSTALL_CPACK "Create binary SDL3 archive using CPack" ${SDL3_MAINPROJECT } "SDL_INSTALL " ON )
292
+ cmake_dependent_option(SDL_INSTALL_DOCS "Install docs for SDL3" OFF "SDL_INSTALL ;NOT SDL_FRAMEWORK" ON )
293
+ set_option(SDL_UNINSTALL "Enable uninstallation of SDL3" ${SDL3_MAINPROJECT} )
294
294
cmake_dependent_option(SDL_PRESEED "Preseed CMake cache to speed up configuration" ON "${SDL_PRESEED_AVAILABLE} " OFF )
295
- cmake_dependent_option(SDL_RELOCATABLE "Create relocatable SDL package" ${SDL_RELOCATABLE_DEFAULT} "NOT SDL_DISABLE_INSTALL " OFF )
295
+ cmake_dependent_option(SDL_RELOCATABLE "Create relocatable SDL package" ${SDL_RELOCATABLE_DEFAULT} "SDL_INSTALL " OFF )
296
296
297
- cmake_dependent_option(SDL_DISABLE_ANDROID_JAR "Disable creation of SDL3.jar" ${SDL3_SUBPROJECT } "ANDROID" ON )
297
+ cmake_dependent_option(SDL_ANDROID_JAR "Enable creation of SDL3.jar" ${SDL3_MAINPROJECT } "ANDROID" ON )
298
298
299
299
option_string(SDL_ASSERTIONS "Enable internal sanity checks (auto/disabled/release/enabled/paranoid)" "auto" )
300
300
set_option(SDL_ASSEMBLY "Enable assembly routines" ${SDL_ASSEMBLY_DEFAULT} )
@@ -394,7 +394,7 @@ cmake_dependent_option(SDL_STATIC "Build a static version of the library" ${SDL_
394
394
option (SDL_TEST_LIBRARY "Build the SDL3_test library" ON )
395
395
396
396
dep_option(SDL_TESTS "Build the test directory" OFF SDL_TEST_LIBRARY OFF )
397
- dep_option(SDL_INSTALL_TESTS "Install test-cases" OFF "NOT SDL_DISABLE_INSTALL ;NOT SDL_FRAMEWORK" OFF )
397
+ dep_option(SDL_INSTALL_TESTS "Install test-cases" OFF "SDL_INSTALL ;NOT SDL_FRAMEWORK" OFF )
398
398
dep_option(SDL_TESTS_LINK_SHARED "link tests to shared SDL library" "${SDL_SHARED} " "SDL_SHARED;SDL_STATIC" "${SDL_SHARED} " )
399
399
set (SDL_TESTS_TIMEOUT_MULTIPLIER "1" CACHE STRING "Timeout multiplier to account for really slow machines" )
400
400
@@ -1419,7 +1419,7 @@ if(ANDROID)
1419
1419
set (HAVE_CLOCK_GETTIME 1)
1420
1420
endif ()
1421
1421
1422
- if (NOT SDL_DISABLE_ANDROID_JAR )
1422
+ if (SDL_ANDROID_JAR )
1423
1423
find_package (Java)
1424
1424
find_package (SdlAndroidPlatform MODULE)
1425
1425
@@ -1449,7 +1449,7 @@ if(ANDROID)
1449
1449
DEPENDS ${SDL_JAVA_SOURCES}
1450
1450
)
1451
1451
add_custom_target (SDL3-javasources ALL DEPENDS "${javasourcesjar} " )
1452
- if (NOT SDL_DISABLE_INSTALL_DOCS )
1452
+ if (SDL_INSTALL_DOCS )
1453
1453
set (javadocdir "${SDL3_BINARY_DIR} /docs/javadoc" )
1454
1454
set (javadocjar "${SDL3_BINARY_DIR} /SDL3-${SDL3_VERSION} -javadoc.jar" )
1455
1455
set (javadoc_index_html "${javadocdir} /index.html" )
@@ -3609,7 +3609,7 @@ if(sdl_cmake_modules)
3609
3609
execute_process (COMMAND ${CMAKE_COMMAND} -E copy_if_different ${sdl_cmake_modules} "${SDL3_BINARY_DIR} " )
3610
3610
endif ()
3611
3611
3612
- if (NOT SDL_DISABLE_INSTALL )
3612
+ if (SDL_INSTALL )
3613
3613
3614
3614
##### sdl3.pc #####
3615
3615
configure_sdl3_pc()
@@ -3709,7 +3709,7 @@ if(NOT SDL_DISABLE_INSTALL)
3709
3709
install (FILES "LICENSE.txt" DESTINATION "${SDL_INSTALL_LICENSEDIR} " )
3710
3710
endif ()
3711
3711
3712
- if (NOT SDL_DISABLE_INSTALL_CPACK )
3712
+ if (SDL_INSTALL_CPACK )
3713
3713
if (SDL_FRAMEWORK)
3714
3714
set (CPACK_GENERATOR "DragNDrop" )
3715
3715
elseif (MSVC )
@@ -3750,7 +3750,7 @@ if(NOT SDL_DISABLE_INSTALL)
3750
3750
endif ()
3751
3751
endif ()
3752
3752
3753
- if (NOT SDL_DISABLE_INSTALL_DOCS )
3753
+ if (SDL_INSTALL_DOCS )
3754
3754
SDL_generate_manpages(
3755
3755
HEADERS_DIR "${PROJECT_SOURCE_DIR} /include/SDL3"
3756
3756
SYMBOL "SDL_Init"
@@ -3767,7 +3767,7 @@ endif()
3767
3767
3768
3768
##### Uninstall target #####
3769
3769
3770
- if (NOT SDL_DISABLE_UNINSTALL )
3770
+ if (SDL_UNINSTALL )
3771
3771
if (NOT TARGET uninstall)
3772
3772
configure_file (cmake/cmake_uninstall.cmake.in cmake_uninstall.cmake IMMEDIATE @ONLY)
3773
3773
0 commit comments