First working project
This commit is contained in:
parent
525da74e4c
commit
44b415cbaa
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
*.json
|
||||
out/
|
||||
.vs/
|
13
CMakeLists.txt
Normal file
13
CMakeLists.txt
Normal file
|
@ -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()
|
13
SDLU/CMakeLists.txt
Normal file
13
SDLU/CMakeLists.txt
Normal file
|
@ -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
|
||||
)
|
3
SDLU/SDLU.hpp
Normal file
3
SDLU/SDLU.hpp
Normal file
|
@ -0,0 +1,3 @@
|
|||
#pragma once
|
||||
|
||||
#include "SDL.h"
|
1
SDLU/alibi.cpp
Normal file
1
SDLU/alibi.cpp
Normal file
|
@ -0,0 +1 @@
|
|||
// CMake needs a .cpp file to build
|
21
SDLU_Example/CMakeLists.txt
Normal file
21
SDLU_Example/CMakeLists.txt
Normal file
|
@ -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/
|
||||
)
|
2
SDLU_Example/header.hpp
Normal file
2
SDLU_Example/header.hpp
Normal file
|
@ -0,0 +1,2 @@
|
|||
#pragma once
|
||||
#include "SDLU.hpp"
|
6
SDLU_Example/main.cpp
Normal file
6
SDLU_Example/main.cpp
Normal file
|
@ -0,0 +1,6 @@
|
|||
#include "header.hpp"
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
return 0;
|
||||
}
|
Loading…
Reference in a new issue