initial project setup

This commit is contained in:
Julian Hinxlage 2019-10-15 13:57:41 +02:00
commit 6be9e2af46
4 changed files with 43 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
cmake-build-*/
build/
.idea/
.vs/

20
CMakeLists.txt Normal file
View File

@ -0,0 +1,20 @@
cmake_minimum_required(VERSION 3.5)
project(library)
set(CMAKE_CXX_STANDARD 14)
file(GLOB_RECURSE SOURCES src/*.cpp)
file(GLOB_RECURSE HEADERS src/*.h)
include_directories(src)
add_library(library ${SOURCES} ${HEADERS})
file(COPY "${CMAKE_SOURCE_DIR}/src/"
DESTINATION "${CMAKE_SOURCE_DIR}/build/include"
FILES_MATCHING
PATTERN *.h
)
file(COPY "${CMAKE_BINARY_DIR}/"
DESTINATION "${CMAKE_SOURCE_DIR}/build/lib"
FILES_MATCHING
PATTERN *.a
)

9
src/add.cpp Normal file
View File

@ -0,0 +1,9 @@
//
// Copyright (c) 2019 Julian Hinxlage. All rights reserved.
//
#include "add.h"
int add(int a, int b){
return a + b;
}

10
src/add.h Normal file
View File

@ -0,0 +1,10 @@
//
// Copyright (c) 2019 Julian Hinxlage. All rights reserved.
//
#ifndef LIBRARY_ADD_H
#define LIBRARY_ADD_H
int add(int a, int b);
#endif //LIBRARY_ADD_H