Skip to content

Commit

Permalink
project setup
Browse files Browse the repository at this point in the history
  • Loading branch information
inlife committed Jul 26, 2017
0 parents commit ee0db87
Show file tree
Hide file tree
Showing 6 changed files with 133 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# Set default charset
charset = utf-8

# 4 space indentation
indent_style = space
indent_size = 4
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# binaries
**/*.dll
**/*.exe

# directories
bin-*/*
distrib/build_*/*

# building stuff
build/*
build-mac/*
build-lin/*
build-win/*
*.dir/*
x64/*
x86/*
client.dir/*
server.dir/*
.vs/*

!build-mac/.keep
!build-lin/.keep
!build-win/.keep
!build-mac/resources
!build-lin/resources
!build-win/Debug/resources

# os stuff
.DS_Store
Thumbs.db

*.swp
68 changes: 68 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
###
# CMake entry point
###
cmake_minimum_required (VERSION 2.8)
project (urgmp)


###
# Predefines to block make at the root
###
if( CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR )
message( FATAL_ERROR "Please select another Build Directory ! (and give it a clever name, like bin_Visual2012_64bits/)" )
endif()
if( CMAKE_SOURCE_DIR MATCHES " " )
message( "Your Source Directory contains spaces. If you experience problems when compiling, this can be the cause." )
endif()
if( CMAKE_BINARY_DIR MATCHES " " )
message( "Your Build Directory contains spaces. If you experience problems when compiling, this can be the cause." )
endif()

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

set(SDL_SHARED_ENABLED_BY_DEFAULT OFF CACHE BOOL "Generate the DLL project if true.")

###
# Compile vendor dependencies
###
add_subdirectory(vendor/reguider)

###
# Includes for libs and remote sources
###
include_directories(
vendor/reguider/include
client/hooking/MinHook/include
server/
shared/
)

###
# Includes for current source executable
###
file(GLOB_RECURSE SERVER_FILES "${PROJECT_SOURCE_DIR}/server/*.cpp")

file(GLOB_RECURSE CLIENT_FILES
"${PROJECT_SOURCE_DIR}/client/*.cpp"
"${PROJECT_SOURCE_DIR}/client/*.c"
"${PROJECT_SOURCE_DIR}/client/*.h"
"${PROJECT_SOURCE_DIR}/client/*.hpp"
)

if(MSVC)
GroupSources(client)
GroupSources(server)
GroupSources(shared)
endif()

###
# Adding executables
###
add_executable(server ${SERVER_FILES})
add_library(client SHARED ${CLIENT_FILES})

###
# Linking libraries
###
target_link_libraries(server librg)
target_link_libraries(client librg d3d11 dxgi)
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
all:
@echo "You should go inside build directory, and use 'cmake ..' from inside to genearate make files for your system"
13 changes: 13 additions & 0 deletions clean-rebuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

BUILD_DIR="build"
BASEDIR=$(dirname "$0");
TARGET=$BASEDIR"/"$BUILD_DIR"/"

rm -rf $TARGET;
mkdir -p $TARGET;
cd $TARGET;

cmake ..
make all

2 changes: 2 additions & 0 deletions vs2017_cmake.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cd build
cmake .. -G"Visual Studio 15 2017 Win64"

0 comments on commit ee0db87

Please sign in to comment.