CMake project

This commit is contained in:
2024-04-13 13:05:24 +10:00
parent 496186d101
commit 9a1bfde5b4
2 changed files with 20 additions and 1 deletions

15
Endoomed/CMakeLists.txt Normal file
View File

@@ -0,0 +1,15 @@
cmake_minimum_required(VERSION "3.15" FATAL_ERROR)
project(endoomed LANGUAGES CXX)
find_package(SDL2 REQUIRED CONFIG)
find_package(SDL2_image REQUIRED CONFIG)
add_executable(endoomed src/main.cpp)
set_property(TARGET endoomed PROPERTY CXX_STANDARD 11)
target_link_libraries(endoomed SDL2::SDL2 SDL2_image::SDL2_image)
if (TARGET SDL2::SDL_main)
target_link_libraries(endoomed SDL2::SDL_main)
endif()
if (CMAKE_C_PLATFORM_ID STREQUAL "Darwin" AND SDL2_FRAMEWORK_PATH MATCHES "^/Library/Frameworks")
set_property(TARGET endoomed PROPERTY BUILD_RPATH "/Library/Frameworks")
endif()

View File

@@ -1,5 +1,9 @@
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#ifndef __APPLE__
# include <SDL2/SDL_image.h>
#else
# include <SDL2_image/SDL_image.h>
#endif
#include <cstdio>
#include <cmath>
#include <memory.h>