diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3b7513f --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.json +out/ +.vs/ \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..5e8028f --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.8) + +project(sdlu) + +if(NOT ENABLE_EXAMPLE) + set(ENABLE_EXAMPLE CACHE BOOL OFF) +endif() + +add_subdirectory(3rdparty/SDL) +add_subdirectory(SDLU) +if(ENABLE_EXAMPLE) + add_subdirectory(SDLU_Example) +endif() \ No newline at end of file diff --git a/SDLU/CMakeLists.txt b/SDLU/CMakeLists.txt new file mode 100644 index 0000000..9013469 --- /dev/null +++ b/SDLU/CMakeLists.txt @@ -0,0 +1,13 @@ +set(PNAME SDLU) + +add_library(${PNAME} + alibi.cpp SDLU.hpp +) + +target_include_directories(${PNAME} PRIVATE + ${PROJECT_SOURCE_DIR}/3rdparty/SDL/include +) + +target_link_libraries(${PNAME} PRIVATE + ${CMAKE_BINARY_DIR}/3rdparty/SDL/SDL2d.lib +) \ No newline at end of file diff --git a/SDLU/SDLU.hpp b/SDLU/SDLU.hpp new file mode 100644 index 0000000..443042f --- /dev/null +++ b/SDLU/SDLU.hpp @@ -0,0 +1,3 @@ +#pragma once + +#include "SDL.h" \ No newline at end of file diff --git a/SDLU/alibi.cpp b/SDLU/alibi.cpp new file mode 100644 index 0000000..7a35a5a --- /dev/null +++ b/SDLU/alibi.cpp @@ -0,0 +1 @@ +// CMake needs a .cpp file to build \ No newline at end of file diff --git a/SDLU_Example/CMakeLists.txt b/SDLU_Example/CMakeLists.txt new file mode 100644 index 0000000..464c62c --- /dev/null +++ b/SDLU_Example/CMakeLists.txt @@ -0,0 +1,21 @@ +set(PNAME sdlu_example) + +add_executable(${PNAME} + main.cpp header.hpp +) + +target_include_directories(${PNAME} PRIVATE + ${PROJECT_SOURCE_DIR}/SDLU + ${PROJECT_SOURCE_DIR}/3rdparty/SDL/include +) + +target_link_libraries(${PNAME} + ${CMAKE_BINARY_DIR}/3rdparty/SDL/SDL2d.lib + ${CMAKE_BINARY_DIR}/3rdparty/SDL/SDL2maind.lib + ${CMAKE_BINARY_DIR}/SDLU/SDLU.lib +) + +add_custom_command(TARGET ${PNAME} + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/3rdparty/SDL/SDL2d.dll ${CMAKE_BINARY_DIR}/SDLU_Example/ +) \ No newline at end of file diff --git a/SDLU_Example/header.hpp b/SDLU_Example/header.hpp new file mode 100644 index 0000000..5a1eea0 --- /dev/null +++ b/SDLU_Example/header.hpp @@ -0,0 +1,2 @@ +#pragma once +#include "SDLU.hpp" \ No newline at end of file diff --git a/SDLU_Example/main.cpp b/SDLU_Example/main.cpp new file mode 100644 index 0000000..65df789 --- /dev/null +++ b/SDLU_Example/main.cpp @@ -0,0 +1,6 @@ +#include "header.hpp" + +int main(int argc, char** argv) +{ + return 0; +} \ No newline at end of file