Skip to content

Commit d0bdeac

Browse files
committed
CAP: basic functionning template for cc project
1 parent ad6def9 commit d0bdeac

File tree

10 files changed

+92
-5
lines changed

10 files changed

+92
-5
lines changed

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,21 @@
3737
# add the build output folder
3838
build/
3939

40+
#######################################
41+
## CMake
42+
#######################################
43+
# general file for cmake
44+
CMakeLists.txt.user
45+
CMakeCache.txt
46+
CMakeFiles
47+
CMakeScripts
48+
Testing
49+
Makefile
50+
cmake_install.cmake
51+
install_manifest.txt
52+
compile_commands.json
53+
CTestTestfile.cmake
54+
_deps
4055

4156
#######################################
4257
## VSCode

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"files.associations": {
3+
"iostream": "cpp"
4+
}
5+
}

CMakeLists.txt

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
11
cmake_minimum_required(VERSION 3.16.)
2-
32
project(DiffCheck VERSION 1.0.0 LANGUAGES CXX C)
4-
53
set(CMAKE_CXX_STANDARD 17)
64

5+
include(CTest)
6+
enable_testing()
7+
8+
set(BUILD_SHARED_LIBS ON)
9+
10+
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
11+
12+
file(GLOB_RECURSE SOURCES src/*.cc src/*.hh)
13+
14+
add_executable(${PROJECT_NAME} ${SOURCES})
15+
16+
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
17+
18+
target_include_directories(${PROJECT_NAME}
19+
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src
20+
)
21+
722

23+
#--------------------------------------------------------------------------
24+
# Pre-compiled headers
25+
#--------------------------------------------------------------------------
26+
target_precompile_headers(${PROJECT_NAME} PRIVATE src/diffcheckpch.hh)

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ git commit -m "WIP-CAP:<description> <--- for cap moment in not finished wo
2929

3030
### Naming & synthax convention
3131
Here's the naming convention for this project:
32-
- `localVariable`: lowerCamelCase.
32+
- ` `: lowerCamelCase.
3333
- `type PrivateVariable`: public member of a class
3434
- `type m_PrivateVariable`: Hungarian notation with UpperCamelCase for private class members.
3535
- `static type s_StaticVariable`: Hungarian notation with UpperCamelCase for static members of class.

src/diffCheck.hh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#pragma once
2+
3+
#include "diffCheck/template.hh" // This is a dummy include to test the include path

src/diffCheck/template.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include "template.hh"
2+
3+
#include <iostream>
4+
5+
namespace diffCheck {
6+
void testTemplateCheck() {
7+
std::cout << "Hello, DiffCheck!" << std::endl;
8+
}
9+
}

src/diffCheck/template.hh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#pragma once
2+
3+
namespace diffCheck {
4+
class TemplateCheck {
5+
public:
6+
TemplateCheck() = default;
7+
~TemplateCheck() = default;
8+
};
9+
10+
/// @brief Testing function for header import
11+
void testTemplateCheck();
12+
} // namespace diffCheck

src/diffCheckApp.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
#include <iostream>
1+
#include "diffcheckpch.hh"
2+
#include "diffCheck.hh"
23

34
int main() {
4-
std::cout << "Hello, World!" << std::endl;
5+
diffCheck::testTemplateCheck();
56
return 0;
67
}

src/diffcheckpch.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# include "diffcheckpch.hh"

src/diffcheckpch.hh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#pragma once
2+
3+
#include <iostream>
4+
#include <memory>
5+
#include <utility>
6+
#include <algorithm>
7+
#include <functional>
8+
#include <filesystem>
9+
10+
#include <string>
11+
#include <string_view>
12+
#include <sstream>
13+
#include <array>
14+
#include <vector>
15+
#include <stdint.h>
16+
#include <type_traits>
17+
#include <typeindex>
18+
#include <typeinfo>
19+
#include <unordered_map>
20+
#include <unordered_set>
21+
22+
#include <stdlib.h>

0 commit comments

Comments
 (0)