Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake Refactor #3093

Draft
wants to merge 56 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
94f8326
Move enscripten
Oct 29, 2024
d83f40c
Move to find_package directly in the CMakeLists.txt
Oct 30, 2024
c72db8b
Remove CMakeLists.txt.old (oops)
Oct 30, 2024
0476871
Remove supertux2_lib and supertux2_c
Oct 30, 2024
b249342
Fix warning from other cmakefiles
Oct 30, 2024
219b28d
Switch to PkgConfig for a few things (kind of a hack)
Oct 30, 2024
7d9a7ef
Remove my attribution from Copyright
Oct 30, 2024
ec7043e
Fix PIC linking issues
Oct 30, 2024
2d17b3f
Fix Emacs
Oct 30, 2024
8b9f20f
Use custom add_package to handle dependency checking in one line
Oct 31, 2024
67395f5
Fix install guide for Ubuntu and Arch
Oct 31, 2024
9866b82
Refactor add_package to a macro, do aliases, move to separate file
Oct 31, 2024
099690b
Fix incorrect terminology
Oct 31, 2024
1b58d75
Better ProvideDiscord warning
Oct 31, 2024
0063eec
Refactor tests a bit
Oct 31, 2024
2d9d3dd
MD5 unit test
Oct 31, 2024
4c29ca7
5am code
Nov 1, 2024
d4d8df9
make_unit_test; fix AATriangleTest
Nov 1, 2024
fd67dcd
Use SDL_rect.h instead of SDL.h for math/rect methods
Nov 1, 2024
6830c02
Custom assert function (broken)
Nov 1, 2024
5e6bc8d
GLM_ENABLE_EXPERIMENTAL
Nov 2, 2024
9fbf635
Make tests/assert more verbose
Nov 2, 2024
ca30f08
Merge branch 'cmake-refactor' of github.com:swagtoy/supertux into cma…
Nov 2, 2024
d13fd68
Add broken DynamicScopeTest for now
Nov 3, 2024
b86b57f
Fix title screen release check
Nov 3, 2024
a8237a4
Move SavePNG
Nov 3, 2024
7013c00
Fix SDL_SavePNG
Nov 3, 2024
d18ffea
Packages using provides code wot i dont think compiles anyway lole ju…
Nov 4, 2024
96ecc66
Merge branch 'cmake-refactor' of https://github.com/swagtoy/supertux …
Nov 4, 2024
84023d2
btich mingw
MatusGuy Nov 4, 2024
5f72189
Merge branch 'master' of https://github.com/swagtoy/supertux into cma…
Nov 5, 2024
9a92c2d
Fix indention
Nov 5, 2024
15733c9
Workaround tinygettext wanting iconv
Nov 5, 2024
9c48859
Add more external links
Nov 5, 2024
b64184e
remove gprof thingy and wip mingw fix error handler
MatusGuy Nov 5, 2024
edc7666
mingw works!!! Create dbghelp.a using a predefined dbghelp.def
MatusGuy Nov 5, 2024
af14dc4
Add ALL_TESTS target; add FileSystemTest just to remove it anyway
Nov 6, 2024
cb08b63
Would help if I actually committed the tests
Nov 6, 2024
e65617f
add this file that i forgot to add for mingw
MatusGuy Nov 6, 2024
244c8ea
Merge branch 'cmake-refactor' of https://github.com/swagtoy/supertux …
MatusGuy Nov 6, 2024
40899c6
fix msvc, add option to disable testing, use console when in debug build
MatusGuy Nov 6, 2024
99a050e
Allow for different package names when using pkg-config
MatusGuy Nov 19, 2024
4106352
Update sexp-cpp
MatusGuy Nov 29, 2024
03dbdb0
Better window title and git version detection
MatusGuy Nov 29, 2024
79a6309
Better window title and git version detection
MatusGuy Nov 29, 2024
13b42c6
Merge branch 'cmake-refactor' of https://github.com/swagtoy/supertux …
MatusGuy Nov 29, 2024
7431a90
Fix git message
Dec 1, 2024
87bac26
Git run improvements
Dec 1, 2024
e2591a2
Modules thing (complete me)
Dec 1, 2024
142b602
Correctly use pkg-config and add option to prefer it
MatusGuy Dec 10, 2024
dd18bf0
Fix git revision checking
MatusGuy Dec 10, 2024
b0d9546
Fix _FOUND if statement
MatusGuy Dec 13, 2024
1686dd6
Move Emscripten.cmake to correct path
MatusGuy Dec 14, 2024
efea468
Fix install target for portable package
MatusGuy Dec 16, 2024
8059e00
Exclude submodules from all target and better release checking
MatusGuy Dec 16, 2024
a711134
Improve git version checking
MatusGuy Dec 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
243 changes: 119 additions & 124 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,20 @@
# make
#

cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.19)

## Project name to use as command prefix.

project(SUPERTUX)


### CMake configuration

if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
cmake_policy(SET CMP0008 NEW)
cmake_policy(SET CMP0023 NEW)
endif()

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Stop CMake from whining about 3.5 or future versions that other FindXXXXX.cmake files (seen from vcpkg) use
set(CMAKE_WARN_DEPRECATED OFF CACHE BOOL "" FORCE)

# This should be set only with windows Visual Studio generator builds
string(TOLOWER "${CMAKE_GENERATOR_PLATFORM}" PLATFORM)
if(${PLATFORM} MATCHES "arm64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_ARM64_ /DMY_CPU_LE")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D_ARM64_ /DMY_CPU_LE")
Expand All @@ -69,20 +62,6 @@ set(APPDATADIR "${CMAKE_INSTALL_PREFIX}/share/games/supertux2")
set(BUILD_DATA_DIR "${CMAKE_CURRENT_SOURCE_DIR}/data")
set(BUILD_CONFIG_DATA_DIR "${CMAKE_BINARY_DIR}/data")

## Check endianess
if(NOT EMSCRIPTEN)
# FIXME: Any reason why we need this?
include(TestBigEndian)
test_big_endian(WORDS_BIGENDIAN)
endif()

## Add definitions
if(CMAKE_BUILD_TYPE MATCHES "Release|RelWithDebInfo")
add_definitions(-DRELEASE)
elseif(CMAKE_BUILD_TYPE MATCHES Debug)
add_definitions(-DDEBUG)
endif()

# Options for install
if(WIN32 AND NOT UNIX)
set(INSTALL_SUBDIR_BIN "bin" CACHE STRING "Installation subdir for binaries")
Expand All @@ -101,30 +80,23 @@ else()
endif()

if(EMSCRIPTEN)
set(CMAKE_EXECUTABLE_SUFFIX .html)
set(IS_EMSCRIPTEN_BUILD ON)

set(EM_USE_FLAGS "-sDISABLE_EXCEPTION_CATCHING=0")
set(EM_LINK_FLAGS " -sINITIAL_MEMORY=134217728 -sALLOW_MEMORY_GROWTH=1 -sMAXIMUM_MEMORY=536870912 -sERROR_ON_UNDEFINED_SYMBOLS=0 --preload-file ${BUILD_CONFIG_DATA_DIR} --use-preload-plugins -lidbfs.js")
if(CMAKE_BUILD_TYPE MATCHES Debug)
set(EM_USE_FLAGS "${EM_USE_FLAGS} -fsanitize=undefined")
set(EM_LINK_FLAGS "${EM_LINK_FLAGS} -fsanitize=undefined -sSAFE_HEAP=1 -sASSERTIONS=1 -sDEMANGLE_SUPPORT=1")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EM_USE_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EM_USE_FLAGS}")
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} ${EM_USE_FLAGS} ${EM_LINK_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} ${EM_USE_FLAGS} ${EM_LINK_FLAGS}")
include(SuperTux/Emscripten)
endif()

# TODO: Add " OR ANDROID OR IOS" to this
if(EMSCRIPTEN OR UBUNTU_TOUCH OR ANDROID)
option(REMOVE_QUIT_BUTTON "Remove the option to quit the game (useful on mobile devices)" ON)
else()
option(REMOVE_QUIT_BUTTON "Remove the option to quit the game (useful on mobile devices)" OFF)
endif()

if(CMAKE_BUILD_TYPE MATCHES "Rel")
set(SUPERTUX_RELEASE_DEFAULT TRUE)
else()
set(SUPERTUX_RELEASE_DEFAULT FALSE)
endif()
option(IS_SUPERTUX_RELEASE "Build as official SuperTux release" ${SUPERTUX_RELEASE_DEFAULT})

option(STEAM_BUILD "Prepare build for Steam" OFF)
option(IS_SUPERTUX_RELEASE "Build as official SuperTux release" OFF)

set(SUPERTUX_SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
set(VCPKG_BUILD OFF CACHE BOOL "Use dependencies installed via vcpkg (not dependency package)")
Expand All @@ -140,17 +112,6 @@ else()
option(HIDE_NONMOBILE_OPTIONS "Hide options that are impractical on mobile devices (e. g. changing screen resolution)" OFF)
endif()

# Configure main menu logo
if(("${SUPERTUX_VERSION_STRING}" MATCHES "^v[0-9]+\\.[0-9]+\\.[0-9]+$") OR IS_SUPERTUX_RELEASE OR STEAM_BUILD)
set(LOGO_FILE "logo.png")
else()
set(LOGO_FILE "logo_dev.png")
endif()

if(WIN32)
include(SuperTux/Win32)
endif()

## Check platform-dependent build options
include(ConfigureChecks)

Expand All @@ -162,25 +123,53 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing")
endif()

if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/local/lib")
endif()

## Add lots of dependencies to compiler switches
include(SuperTux/ProvideGlm)
include(SuperTux/ProvideFmt)
include(SuperTux/ProvideSDL2)
include(SuperTux/ProvideOpenAL)
include(SuperTux/ProvideOggVorbis)
include(SuperTux/ProvidePhysfs)
include(SuperTux/ProvideCurl)
include(SuperTux/ProvideSimpleSquirrel)
include(SuperTux/ProvideTinygettext)
include(SuperTux/ProvideSDL2_ttf)
include(SuperTux/ProvideDiscord)
include(SuperTux/ProvideSexpcpp)
include(SuperTux/ProvideSavePNG)
include(SuperTux/ProvidePartioZip)
include(SuperTux/AddPackage)

# Find dependencies
add_package(TARGET SDL2
PKG SDL2 PKG_USE SDL2::SDL2 CONFIG REQUIRED PKG_CONFIG sdl2 SDL2)
add_package(TARGET PNG
PKG PNG PKG_USE PNG::PNG PKG_CONFIG libpng REQUIRED) # lol
add_package(TARGET SDL2_image
PKG SDL2_image PKG_USE SDL2_image::SDL2_image CONFIG REQUIRED PKG_CONFIG SDL2_image sdl2_image)
add_package(TARGET SDL2_ttf
PKG SDL2_ttf PKG_USE SDL2_ttf::SDL2_ttf CONFIG REQUIRED PKG_CONFIG SDL2_ttf sdl2_ttf)
add_package(TARGET LibCURL
PKG CURL PKG_USE CURL::libcurl PKG_CONFIG libcurl)
add_package(TARGET OpenAL
PKG OpenAL PKG_USE OpenAL::OpenAL CONFIG REQUIRED PKG_CONFIG OpenAL openal)
add_package(TARGET Ogg
PKG Ogg PKG_USE Ogg::ogg CONFIG REQUIRED PKG_CONFIG ogg)
add_package(TARGET Vorbis
PKG Vorbis PKG_USE Vorbis::vorbis CONFIG REQUIRED PKG_CONFIG vorbis)
add_package(TARGET VorbisFile
PKG Vorbis PKG_USE Vorbis::vorbisfile CONFIG REQUIRED PKG_CONFIG vorbisfile)
add_package(TARGET glm
PKG glm PKG_USE glm::glm CONFIG REQUIRED PKG_CONFIG glm)
add_package(TARGET fmt
PKG fmt PKG_USE fmt::fmt CONFIG REQUIRED PKG_CONFIG fmt)
add_package(TARGET PhysFS
PKG PhysFS PKG_USE PhysFS::PhysFS CONFIG REQUIRED PKG_CONFIG physfs
PREFER_PKGCONFIG)
add_package(TARGET ZLIB
PKG ZLIB PKG_USE ZLIB::ZLIB PKG_CONFIG zlib REQUIRED)
# add_package(TARGET Iconv PKG Iconv PKG_USE Iconv::Iconv PKG_CONFIG libiconv) # probably wrong

add_subdirectory(external/SDL_SavePNG EXCLUDE_FROM_ALL)
add_subdirectory(external/simplesquirrel EXCLUDE_FROM_ALL)
add_subdirectory(external/discord-sdk EXCLUDE_FROM_ALL)
add_subdirectory(external/sexp-cpp EXCLUDE_FROM_ALL)
add_subdirectory(external/partio_zip EXCLUDE_FROM_ALL)
# Workaround tinygettext wanting Iconv
SET(HAVE_SDL TRUE CACHE BOOL "Use SDL_iconv instead of system iconv")
add_subdirectory(external/tinygettext EXCLUDE_FROM_ALL)
add_subdirectory(external/findlocale EXCLUDE_FROM_ALL)
add_subdirectory(external/obstack EXCLUDE_FROM_ALL)
include(SuperTux/ProvideOpenGL)

## Build stuff
Expand All @@ -189,7 +178,7 @@ include(SuperTux/BuildDocumentation)
include(SuperTux/BuildMessagePot)

## Build list of sources for supertux binary
file(GLOB SUPERTUX_SOURCES_C RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} external/obstack/*.c external/findlocale/findlocale.c)
set(SUPERTUX_SOURCES_C ${CMAKE_CURRENT_SOURCE_DIR})

file(GLOB SUPERTUX_SOURCES_CXX RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} src/*/*.cpp src/supertux/menu/*.cpp src/video/sdl/*.cpp src/video/null/*.cpp)
file(GLOB SUPERTUX_RESOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${PROJECT_BINARY_DIR}/tmp/*.rc")
Expand All @@ -204,99 +193,105 @@ list(SORT SUPERTUX_SOURCES_C)
list(SORT SUPERTUX_SOURCES_CXX)
list(SORT SUPERTUX_RESOURCES)

## On Windows, add an icon
if(WIN32)
if(MINGW)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/supertux_rc.o
COMMAND ${CMAKE_RC_COMPILER} -I${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons -i${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.rc -o ${CMAKE_CURRENT_BINARY_DIR}/supertux_rc.o)
set(SUPERTUX_SOURCES_C ${SUPERTUX_SOURCES_C} ${CMAKE_CURRENT_BINARY_DIR}/supertux_rc.o)
endif()
endif()

include(SuperTux/CompileAmalgation)

## Generate supertux executable in the right place

# Is this needed? - Swagtoy
#set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR})
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
#set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})

# Set windowed mode when building in release
# because the console is very useful for debugging on Windows.
set(SUPERTUX_WIN32_OPTION)
if(IS_SUPERTUX_RELEASE OR STEAM_BUILD)
set(SUPERTUX_WIN32_OPTION WIN32)
endif()

## Add target for supertux binary
add_executable(supertux2 ${SUPERTUX_WIN32_OPTION} ${CMAKE_BINARY_DIR}/version.h ${SUPERTUX_SOURCES_C} ${SUPERTUX_SOURCES_CXX} ${SUPERTUX_RESOURCES} src/main.cpp)

add_library(supertux2_c OBJECT ${SUPERTUX_SOURCES_C})
add_library(supertux2_lib STATIC ${CMAKE_BINARY_DIR}/version.h ${SUPERTUX_SOURCES_CXX} ${SUPERTUX_RESOURCES} $<TARGET_OBJECTS:supertux2_c>)
target_include_directories(supertux2_lib PUBLIC ${CMAKE_BINARY_DIR} src/)
if(IS_SUPERTUX_RELEASE OR STEAM_BUILD)
target_compile_definitions(supertux2 PUBLIC SUPERTUX_RELEASE)
endif()

# TODO Is this even needed?
# $<$<BOOL:WIN32>:{CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.rc>
target_include_directories(supertux2 PUBLIC ${CMAKE_BINARY_DIR} src/)

if(WIN32)
add_executable(supertux2 WIN32 src/main.cpp ${CMAKE_CURRENT_SOURCE_DIR}/data/images/engine/icons/supertux.rc)
target_link_libraries(supertux2 LibSDL2main)
else()
add_executable(supertux2 src/main.cpp)
include(SuperTux/Win32)
endif()
target_link_libraries(supertux2 supertux2_lib)

set_target_properties(supertux2_lib PROPERTIES OUTPUT_NAME supertux2_lib)
set_target_properties(supertux2_lib PROPERTIES COMPILE_FLAGS "${SUPERTUX2_EXTRA_WARNING_FLAGS}")
if(EMSCRIPTEN)
target_link_options(supertux2 PUBLIC -sEXPORTED_FUNCTIONS=['_main','_set_resolution','_save_config','_onDownloadProgress','_onDownloadFinished','_onDownloadError','_onDownloadAborted','_getExceptionMessage'] PUBLIC -sEXPORTED_RUNTIME_METHODS=['ccall','cwrap'])
endif()
set_target_properties(supertux2 PROPERTIES OUTPUT_NAME "supertux2")
set_target_properties(supertux2 PROPERTIES COMPILE_FLAGS "${SUPERTUX2_EXTRA_WARNING_FLAGS}")

if(WIN32 AND NOT VCPKG_BUILD)
if(NOT MINGW)
#if(WIN32 AND NOT VCPKG_BUILD)
#if(NOT MINGW)
## Copy dlls on windows
add_custom_command(TARGET supertux2_lib POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${DEPENDENCY_FOLDER}/dll"
$<TARGET_FILE_DIR:supertux2_lib>)
endif()
endif()

## Some additional include paths
target_include_directories(supertux2_lib SYSTEM PUBLIC
external/findlocale/
external/obstack/
)
# add_custom_command(TARGET supertux2_lib POST_BUILD
# COMMAND ${CMAKE_COMMAND} -E copy_directory
# "${DEPENDENCY_FOLDER}/dll"
# $<TARGET_FILE_DIR:supertux2_lib>)
#endif()
#endif()

# Include altivec wrapper on ppc
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc.*")
target_include_directories(supertux2_lib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/ppc)
target_include_directories(supertux2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/ppc)
endif()

## Link supertux binary with squirrel and other libraries

target_link_libraries(supertux2_lib PUBLIC LibSimpleSquirrel)
target_link_libraries(supertux2_lib PUBLIC LibTinygettext)
target_link_libraries(supertux2_lib PUBLIC LibSexp)
target_link_libraries(supertux2_lib PUBLIC LibSavePNG)
target_link_libraries(supertux2_lib PUBLIC LibPartioZip)
target_link_libraries(supertux2_lib PUBLIC LibOpenAL)
target_link_libraries(supertux2_lib PUBLIC LibGlm)
target_link_libraries(supertux2_lib PUBLIC LibFmt)
target_link_libraries(supertux2_lib PUBLIC LibPhysfs)
if(MSVC)
target_link_libraries(supertux2 PUBLIC simplesquirrel_static)
else()
target_link_libraries(supertux2 PUBLIC simplesquirrel)
endif()
target_link_libraries(supertux2 PUBLIC
tinygettext sexp SDL_SavePNG
PartioZip OpenAL FindLocale obstack glm fmt PhysFS)
target_compile_definitions(supertux2 PUBLIC GLM_ENABLE_EXPERIMENTAL)

if(NOT EMSCRIPTEN)
target_link_libraries(supertux2_lib PUBLIC LibSDL2_ttf)
target_link_libraries(supertux2_lib PUBLIC LibSDL2 LibSDL2_image)
target_link_libraries(supertux2_lib PUBLIC LibOggVorbis)
target_link_libraries(supertux2_lib PUBLIC LibCurl)
target_link_libraries(supertux2 PUBLIC
# SDL2_image
SDL2_image
# SDL2_ttf
SDL2_ttf
# SDL2 main (windows?)
$<TARGET_NAME_IF_EXISTS:SDL2::SDL2main>
# SDL2
SDL2
)
target_link_libraries(supertux2 PUBLIC
Ogg
Vorbis
VorbisFile
)
target_link_libraries(supertux2 PUBLIC LibCURL)
endif()

if(HAVE_OPENGL)
target_link_libraries(supertux2_lib PUBLIC LibOpenGL)
target_link_libraries(supertux2 PUBLIC LibOpenGL)
endif()

if(ENABLE_DISCORD)
target_link_libraries(supertux2_lib PUBLIC LibDiscord)
target_link_libraries(supertux2 PUBLIC DiscordRPC)
endif()

## Install stuff
include(SuperTux/BuildInstall)

## Create config.h now that INSTALL_SUBDIR_* have been set.
configure_file(config.h.cmake ${CMAKE_BINARY_DIR}/config.h )
configure_file(config.h.in ${CMAKE_BINARY_DIR}/config.h)

## Build tests
include(SuperTux/BuildTests)
if(BUILD_TESTING)
# TODO Move to CMake Tests
#include(SuperTux/BuildTests)
set(CMAKE_CTEST_ARGUMENTS "--output-on-failure")
enable_testing()
add_subdirectory(tests)
endif()

## CPack/Installation-specific stuff
include(SuperTux/BuildCPack)
Expand Down
4 changes: 2 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ For ease of use, here are some installation lines for some Linux distributions:

- Ubuntu 18.04/20.04:
```
sudo apt-get update && sudo apt-get install -y cmake build-essential libogg-dev libvorbis-dev libopenal-dev libsdl2-dev libsdl2-image-dev libfreetype6-dev libraqm-dev libcurl4-openssl-dev libglew-dev libharfbuzz-dev libfribidi-dev libglm-dev zlib1g-dev
sudo apt-get update && sudo apt-get install -y cmake build-essential libogg-dev libvorbis-dev libopenal-dev libsdl2-dev libsdl2-image-dev libfreetype6-dev libraqm-dev libcurl4-openssl-dev libglew-dev libharfbuzz-dev libfribidi-dev libglm-dev zlib1g-dev libfmt-dev libsdl2-ttf-dev libphysfs-dev
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember to include these packages in the vcpkg example!

```

- ArchLinux (using sudo, as of August 28th 2024)
```
sudo pacman -S cmake base-devel libogg libvorbis openal sdl2 sdl2_image freetype2 libraqm curl openssl glew harfbuzz fribidi glm zlib
sudo pacman -S cmake base-devel libogg libvorbis openal sdl2 sdl2_image sdl2_ttf freetype2 libraqm curl openssl glew harfbuzz fribidi glm zlib fmt physfs
```

### Linux/UNIX using CMake
Expand Down
File renamed without changes.
6 changes: 6 additions & 0 deletions external/SDL_SavePNG/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
project(SDL_SavePNG)

add_library(SDL_SavePNG OBJECT ${PROJECT_SOURCE_DIR}/savepng.c)
set_target_properties(SDL_SavePNG PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_link_libraries(SDL_SavePNG PUBLIC SDL2 PNG)
target_include_directories(SDL_SavePNG PUBLIC ${PROJECT_SOURCE_DIR})
5 changes: 5 additions & 0 deletions external/findlocale/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project(FindLocale)

add_library(FindLocale OBJECT ${PROJECT_SOURCE_DIR}/findlocale.c)
set_target_properties(FindLocale PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(FindLocale PUBLIC ${PROJECT_SOURCE_DIR})
5 changes: 5 additions & 0 deletions external/obstack/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project(obstack)

add_library(obstack OBJECT ${PROJECT_SOURCE_DIR}/obstack.c)
set_target_properties(obstack PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(obstack PUBLIC ${PROJECT_SOURCE_DIR})
5 changes: 5 additions & 0 deletions external/partio_zip/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project(PartioZip)

add_library(PartioZip OBJECT ${PROJECT_SOURCE_DIR}/zip_manager.cpp ${PROJECT_SOURCE_DIR}/zip_manager.hpp)
target_link_libraries(PartioZip PUBLIC ZLIB)
target_include_directories(PartioZip PUBLIC ${PROJECT_SOURCE_DIR})
2 changes: 1 addition & 1 deletion external/simplesquirrel
Loading