cmake: Fixed indenting and some oldschool `endif(TEXT)` things.
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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 91636d2..644715a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2970,123 +2970,124 @@ endif()
##### Installation targets #####
if(NOT SDL2_DISABLE_INSTALL)
-if(SDL_SHARED)
- install(TARGETS SDL2 EXPORT SDL2Targets
- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
-endif()
-
-if(NOT WINDOWS_STORE AND NOT SDL2_DISABLE_SDL2MAIN)
- install(TARGETS SDL2main EXPORT SDL2mainTargets
- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
-endif()
+ if(SDL_SHARED)
+ install(TARGETS SDL2 EXPORT SDL2Targets
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
+ endif()
-if(SDL_STATIC)
- install(TARGETS SDL2-static EXPORT SDL2staticTargets
- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
-endif()
+ if(NOT WINDOWS_STORE AND NOT SDL2_DISABLE_SDL2MAIN)
+ install(TARGETS SDL2main EXPORT SDL2mainTargets
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
+ endif()
-##### Export files #####
-if (WINDOWS AND NOT MINGW)
- set(PKG_PREFIX "cmake")
-else ()
- set(PKG_PREFIX "${CMAKE_INSTALL_LIBDIR}/cmake/SDL2")
-endif ()
+ if(SDL_STATIC)
+ install(TARGETS SDL2-static EXPORT SDL2staticTargets
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
+ endif()
+
+ ##### Export files #####
+ if (WINDOWS AND NOT MINGW)
+ set(PKG_PREFIX "cmake")
+ else ()
+ set(PKG_PREFIX "${CMAKE_INSTALL_LIBDIR}/cmake/SDL2")
+ endif ()
+
+ include(CMakePackageConfigHelpers)
+ write_basic_package_version_file("${CMAKE_BINARY_DIR}/SDL2ConfigVersion.cmake"
+ VERSION ${SDL_VERSION}
+ COMPATIBILITY AnyNewerVersion
+ )
-include(CMakePackageConfigHelpers)
-write_basic_package_version_file("${CMAKE_BINARY_DIR}/SDL2ConfigVersion.cmake"
- VERSION ${SDL_VERSION}
- COMPATIBILITY AnyNewerVersion
-)
+ if(SDL_SHARED)
+ install(EXPORT SDL2Targets
+ FILE SDL2Targets.cmake
+ NAMESPACE SDL2::
+ DESTINATION ${PKG_PREFIX}
+ )
+ endif()
-if(SDL_SHARED)
- install(EXPORT SDL2Targets
- FILE SDL2Targets.cmake
- NAMESPACE SDL2::
- DESTINATION ${PKG_PREFIX}
- )
-endif()
+ if(NOT WINDOWS_STORE AND NOT SDL2_DISABLE_SDL2MAIN)
+ install(EXPORT SDL2mainTargets
+ FILE SDL2mainTargets.cmake
+ NAMESPACE SDL2::
+ DESTINATION ${PKG_PREFIX}
+ )
+ endif()
-if(NOT WINDOWS_STORE AND NOT SDL2_DISABLE_SDL2MAIN)
- install(EXPORT SDL2mainTargets
- FILE SDL2mainTargets.cmake
- NAMESPACE SDL2::
- DESTINATION ${PKG_PREFIX}
- )
-endif()
+ if(SDL_STATIC)
+ install(EXPORT SDL2staticTargets
+ FILE SDL2staticTargets.cmake
+ NAMESPACE SDL2::
+ DESTINATION ${PKG_PREFIX}
+ )
+ endif()
-if(SDL_STATIC)
- install(EXPORT SDL2staticTargets
- FILE SDL2staticTargets.cmake
- NAMESPACE SDL2::
+ install(
+ FILES
+ ${CMAKE_CURRENT_SOURCE_DIR}/SDL2Config.cmake
+ ${CMAKE_BINARY_DIR}/SDL2ConfigVersion.cmake
DESTINATION ${PKG_PREFIX}
+ COMPONENT Devel
)
-endif()
-
-install(
- FILES
- ${CMAKE_CURRENT_SOURCE_DIR}/SDL2Config.cmake
- ${CMAKE_BINARY_DIR}/SDL2ConfigVersion.cmake
- DESTINATION ${PKG_PREFIX}
- COMPONENT Devel
-)
-
-file(GLOB INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/*.h)
-file(GLOB BIN_INCLUDE_FILES ${SDL2_BINARY_DIR}/include/*.h)
-foreach(_FNAME ${BIN_INCLUDE_FILES})
- get_filename_component(_INCNAME ${_FNAME} NAME)
- list(REMOVE_ITEM INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/${_INCNAME})
-endforeach()
-list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES})
-install(FILES ${INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SDL2)
-string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_BUILD_TYPE)
-if (UPPER_BUILD_TYPE MATCHES DEBUG)
- set(SOPOSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}")
-else()
- set(SOPOSTFIX "")
-endif()
-
-if(NOT (WINDOWS OR CYGWIN) OR MINGW)
- if(SDL_SHARED)
- set(SOEXT ${CMAKE_SHARED_LIBRARY_SUFFIX}) # ".so", ".dylib", etc.
- get_target_property(SONAME SDL2 OUTPUT_NAME)
- if(NOT ANDROID AND NOT MINGW AND NOT OS2)
- install(CODE "
- execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
- \"lib${SONAME}${SOPOSTFIX}${SOEXT}\" \"libSDL2${SOPOSTFIX}${SOEXT}\"
- WORKING_DIRECTORY \"${SDL2_BINARY_DIR}\")")
- install(FILES ${SDL2_BINARY_DIR}/libSDL2${SOPOSTFIX}${SOEXT} DESTINATION "${CMAKE_INSTALL_LIBDIR}")
- endif()
- endif()
- if(FREEBSD)
- # FreeBSD uses ${PREFIX}/libdata/pkgconfig
- install(FILES ${SDL2_BINARY_DIR}/sdl2.pc DESTINATION "libdata/pkgconfig")
+ file(GLOB INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/*.h)
+ file(GLOB BIN_INCLUDE_FILES ${SDL2_BINARY_DIR}/include/*.h)
+ foreach(_FNAME ${BIN_INCLUDE_FILES})
+ get_filename_component(_INCNAME ${_FNAME} NAME)
+ list(REMOVE_ITEM INCLUDE_FILES ${SDL2_SOURCE_DIR}/include/${_INCNAME})
+ endforeach()
+ list(APPEND INCLUDE_FILES ${BIN_INCLUDE_FILES})
+ install(FILES ${INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SDL2)
+
+ string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_BUILD_TYPE)
+ if (UPPER_BUILD_TYPE MATCHES DEBUG)
+ set(SOPOSTFIX "${SDL_CMAKE_DEBUG_POSTFIX}")
else()
- install(FILES ${SDL2_BINARY_DIR}/sdl2.pc
- DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
+ set(SOPOSTFIX "")
+ endif()
+
+ if(NOT (WINDOWS OR CYGWIN) OR MINGW)
+ if(SDL_SHARED)
+ set(SOEXT ${CMAKE_SHARED_LIBRARY_SUFFIX}) # ".so", ".dylib", etc.
+ get_target_property(SONAME SDL2 OUTPUT_NAME)
+ if(NOT ANDROID AND NOT MINGW AND NOT OS2)
+ install(CODE "
+ execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
+ \"lib${SONAME}${SOPOSTFIX}${SOEXT}\" \"libSDL2${SOPOSTFIX}${SOEXT}\"
+ WORKING_DIRECTORY \"${SDL2_BINARY_DIR}\")")
+ install(FILES ${SDL2_BINARY_DIR}/libSDL2${SOPOSTFIX}${SOEXT} DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+ endif()
+ endif()
+ if(FREEBSD)
+ # FreeBSD uses ${PREFIX}/libdata/pkgconfig
+ install(FILES ${SDL2_BINARY_DIR}/sdl2.pc DESTINATION "libdata/pkgconfig")
+ else()
+ install(FILES ${SDL2_BINARY_DIR}/sdl2.pc
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
+ endif()
+ install(PROGRAMS ${SDL2_BINARY_DIR}/sdl2-config DESTINATION "${CMAKE_INSTALL_BINDIR}")
+ # TODO: what about the .spec file? Is it only needed for RPM creation?
+ install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/aclocal")
endif()
- install(PROGRAMS ${SDL2_BINARY_DIR}/sdl2-config DESTINATION "${CMAKE_INSTALL_BINDIR}")
- # TODO: what about the .spec file? Is it only needed for RPM creation?
- install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/aclocal")
endif()
-endif(NOT SDL2_DISABLE_INSTALL)
##### Uninstall target #####
if(NOT SDL2_DISABLE_UNINSTALL)
-if(NOT TARGET uninstall)
- configure_file(
- "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
- "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
- IMMEDIATE @ONLY)
+ if(NOT TARGET uninstall)
+ configure_file(
+ "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
+ IMMEDIATE @ONLY)
- add_custom_target(uninstall
- COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
+ add_custom_target(uninstall
+ COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
+ endif()
endif()
-endif(NOT SDL2_DISABLE_UNINSTALL)
+