Skip to content

Commit

Permalink
Dummy cmake project with google tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LuxoftAKutsan committed Dec 8, 2019
0 parents commit 914fe48
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build
CMakeLists.txt.user*

3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "cmake"]
path = cmake
url = https://github.com/CLIUtils/cmake
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cmake_minimum_required(VERSION 3.7)
project(dummy_cmake_project)

set(CMAKE_CXX_STANDARD 14)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

set(SOURCES project.cc)
add_library(ProjectLib ${SOURCES})

add_executable(project main.cc)
target_link_libraries(project ProjectLib)

enable_testing()
add_subdirectory(test)
1 change: 1 addition & 0 deletions cmake
Submodule cmake added at 7fe259
5 changes: 5 additions & 0 deletions main.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "project.h"

int main() {
return 0;
}
5 changes: 5 additions & 0 deletions project.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "project.h"

int sum(int x, int y) {
return x + y;
}
3 changes: 3 additions & 0 deletions project.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#pragma once

int sum();
7 changes: 7 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include_directories (${CMAKE_SOURCE_DIR})

include(AddGoogleTest)

add_executable (ProjectTest project_test.cc)
add_gtest(ProjectTest)
target_link_libraries(ProjectTest PUBLIC ProjectLib)
Empty file added test/project_test.cc
Empty file.

0 comments on commit 914fe48

Please sign in to comment.