mirror of
https://github.com/izzy2lost/libultraship.git
synced 2026-06-19 01:16:13 -07:00
cmake restructure (#516)
* restructure cmakelists and get tinyxml from package manager * why is 22.04 so old? * looks like that worked * don't do the tinyxml part * whoops
This commit is contained in:
+6
-13
@@ -15,19 +15,12 @@ endif()
|
||||
|
||||
include(cmake/Utils.cmake)
|
||||
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Windows" AND USE_AUTO_VCPKG)
|
||||
include(cmake/automate-vcpkg.cmake)
|
||||
|
||||
if ("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")
|
||||
set(VCPKG_TRIPLET x86-windows-static)
|
||||
set(VCPKG_TARGET_TRIPLET x86-windows-static)
|
||||
elseif ("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
|
||||
set(VCPKG_TRIPLET x64-windows-static)
|
||||
set(VCPKG_TARGET_TRIPLET x64-windows-static)
|
||||
endif()
|
||||
|
||||
vcpkg_bootstrap()
|
||||
vcpkg_install_packages(zlib bzip2 sdl2 glew libzip nlohmann-json)
|
||||
include(cmake/dependencies/common.cmake)
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Android")
|
||||
include(cmake/dependencies/android.cmake)
|
||||
endif()
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
include(cmake/dependencies/windows.cmake)
|
||||
endif()
|
||||
|
||||
add_subdirectory("extern")
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
find_package(SDL2 QUIET)
|
||||
if (NOT ${SDL2_FOUND})
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
SDL2
|
||||
GIT_REPOSITORY https://github.com/libsdl-org/SDL.git
|
||||
GIT_TAG release-2.28.1
|
||||
)
|
||||
message("SDL2 not found. Downloading now...")
|
||||
FetchContent_MakeAvailable(SDL2)
|
||||
message("SDL2 downloaded to " ${FETCHCONTENT_BASE_DIR}/sdl2-src)
|
||||
endif()
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
if (USE_AUTO_VCPKG)
|
||||
include(cmake/automate-vcpkg.cmake)
|
||||
|
||||
if ("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")
|
||||
set(VCPKG_TRIPLET x86-windows-static)
|
||||
set(VCPKG_TARGET_TRIPLET x86-windows-static)
|
||||
elseif ("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
|
||||
set(VCPKG_TRIPLET x64-windows-static)
|
||||
set(VCPKG_TARGET_TRIPLET x64-windows-static)
|
||||
endif()
|
||||
|
||||
vcpkg_bootstrap()
|
||||
vcpkg_install_packages(zlib bzip2 sdl2 glew libzip nlohmann-json tinyxml2)
|
||||
endif()
|
||||
Vendored
-18
@@ -6,24 +6,6 @@ elseif (NOT CMAKE_SYSTEM_NAME STREQUAL "Android")
|
||||
find_package(SDL2 REQUIRED)
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# Find/download SDL2 for Android
|
||||
################################################################################
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Android")
|
||||
find_package(SDL2 QUIET)
|
||||
if (NOT ${SDL2_FOUND})
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
SDL2
|
||||
GIT_REPOSITORY https://github.com/libsdl-org/SDL.git
|
||||
GIT_TAG release-2.28.1
|
||||
)
|
||||
message("SDL2 not found. Downloading now...")
|
||||
FetchContent_MakeAvailable(SDL2)
|
||||
message("SDL2 downloaded to " ${FETCHCONTENT_BASE_DIR}/sdl2-src)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#=================== DrLibs ===================
|
||||
|
||||
set(DRLIBS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/dr_libs)
|
||||
|
||||
Reference in New Issue
Block a user