Added CMakeFile and version config

This commit is contained in:
JackCarterSmith 2021-01-09 22:26:46 +01:00
parent 543996cbfc
commit 647fc83973
Signed by: JackCarterSmith
GPG Key ID: DB362B740828F843
4 changed files with 2555 additions and 0 deletions

15
.gitignore vendored
View File

@ -15,6 +15,7 @@
# Precompiled Headers
*.gch
*.pch
src/config.h
# Libraries
*.lib
@ -53,3 +54,17 @@ modules.order
Module.symvers
Mkfile.old
dkms.conf
# CMake files
build/
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps

47
CMakeLists.txt Normal file
View File

@ -0,0 +1,47 @@
# CMakeLists.txt
# Written by JackCarterSmith, 2021
# This code is released under the AST license.
cmake_minimum_required(VERSION 3.1)
cmake_policy(VERSION 3.1)
# define project
project(ast VERSION 1.0.0 DESCRIPTION "Arena Survival Tournament" LANGUAGES C)
set(AST_NAME AST-${PROJECT_VERSION})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/config.h @ONLY)
include(CheckIncludeFile)
include(CheckCSourceCompiles)
# needed packages
find_package(SDL2 REQUIRED)
include_directories(${SDL2_INCLUDE_DIR})
# define src/headers files
FILE(GLOB AST_SCRS src/*.c)
FILE(GLOB AST_HRDS src/*.h)
SOURCE_GROUP("Source Files" FILES ${AST_SCRS})
SOURCE_GROUP("Header Files" FILES ${AST_HRDS})
# begin building ast
#set(CMAKE_BUILD_TYPE Debug)
#include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_executable(ast ${AST_SCRS} ${AST_HRDS})
#set_property(TARGET ast PROPERTY C_STANDARD 99)
set_target_properties(ast PROPERTIES OUTPUT_NAME ${AST_NAME})
if(MSVC)
# msvc does not append 'lib' - do it here to have consistent name
set_target_properties(ast PROPERTIES PREFIX "lib")
set_target_properties(ast PROPERTIES IMPORT_PREFIX "lib")
endif()
target_link_libraries(ast ${SDL2_LIBRARIES})
# install executable
install(TARGETS ast
RUNTIME DESTINATION bin
)

2492
Doxyfile Normal file

File diff suppressed because it is too large Load Diff

1
src/config.h.in Normal file
View File

@ -0,0 +1 @@
#define VERSION "@PROJECT_VERSION@"