CMakeList cleanup and import fix

This commit is contained in:
Robin Rottstädt 2023-09-23 22:59:46 +02:00
parent 9b57ca68c6
commit 7cbc525dc6
No known key found for this signature in database
GPG key ID: 630B61F1D46CCE35
4 changed files with 9 additions and 7 deletions

View file

@ -1,9 +1,11 @@
file(GLOB_RECURSE flappy_bird_src "*.cpp")
file(GLOB_RECURSE flappy_bird_lib "lib/*.hpp" "lib/*.h")
file(GLOB_RECURSE flappy_bird_assets "assets/*")
add_executable(paradiso_flappy_bird flappy_bird.cpp image_loader.hpp image_loader.cpp lib/stb_image.h) add_executable(flappy_bird ${flappy_bird_src} ${flappy_bird_lib})
target_link_libraries(flappy_bird paradiso_core)
target_link_libraries(paradiso_flappy_bird paradiso_core) add_custom_command(TARGET flappy_bird POST_BUILD
add_custom_command(TARGET paradiso_flappy_bird POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_SOURCE_DIR}/assets/ $<TARGET_FILE_DIR:paradiso_flappy_bird>/assets) ${CMAKE_CURRENT_SOURCE_DIR}/assets/ $<TARGET_FILE_DIR:flappy_bird>/assets)

View file

@ -19,7 +19,7 @@
#include <iomanip> #include <iomanip>
#include <iostream> #include <iostream>
#include "image_loader.hpp" #include "lib/image_loader.hpp"
struct Background { struct Background {
paradiso::Sprite backgroundLeft; paradiso::Sprite backgroundLeft;

View file

@ -10,7 +10,7 @@
#define STB_IMAGE_IMPLEMENTATION #define STB_IMAGE_IMPLEMENTATION
#include "lib/stb_image.h" #include "lib/stb_image.h"
#include "image_loader.hpp" #include "lib/image_loader.hpp"
std::unordered_map<std::string, paradiso::Bitmap> image_loader::image_cache = std::unordered_map<std::string, paradiso::Bitmap> image_loader::image_cache =
std::unordered_map<std::string, paradiso::Bitmap>(); std::unordered_map<std::string, paradiso::Bitmap>();