diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e3814ab --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +build +CMakeLists.txt.user* + diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..dd6cc15 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "cmake"] + path = cmake + url = https://github.com/CLIUtils/cmake diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..fa050f2 --- /dev/null +++ b/CMakeLists.txt @@ -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) diff --git a/cmake b/cmake new file mode 160000 index 0000000..7fe259a --- /dev/null +++ b/cmake @@ -0,0 +1 @@ +Subproject commit 7fe259ab9d833048971e8ef0cac99672950986db diff --git a/main.cc b/main.cc new file mode 100644 index 0000000..5b2357f --- /dev/null +++ b/main.cc @@ -0,0 +1,5 @@ +#include "project.h" + +int main() { + return 0; +} diff --git a/project.cc b/project.cc new file mode 100644 index 0000000..eb32d55 --- /dev/null +++ b/project.cc @@ -0,0 +1,5 @@ +#include "project.h" + +int sum(int x, int y) { + return x + y; +} diff --git a/project.h b/project.h new file mode 100644 index 0000000..f024477 --- /dev/null +++ b/project.h @@ -0,0 +1,3 @@ +#pragma once + +int sum(); diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100755 index 0000000..8d6190d --- /dev/null +++ b/test/CMakeLists.txt @@ -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) diff --git a/test/project_test.cc b/test/project_test.cc new file mode 100644 index 0000000..e69de29