-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removed conan and updated template (#2)
* removed conan and updated template * removed conan installation from github actions * run test script from CI * updated CI
- Loading branch information
Showing
23 changed files
with
111 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,24 @@ | ||
AccessModifierOffset: '-4' | ||
AllowShortFunctionsOnASingleLine: Inline | ||
AlignConsecutiveAssignments: true | ||
AlignConsecutiveDeclarations: true | ||
BasedOnStyle: Google | ||
BinPackArguments: false | ||
BinPackParameters: false | ||
BreakConstructorInitializers: BeforeComma | ||
ConstructorInitializerAllOnOneLineOrOnePerLine: false | ||
ColumnLimit: 120 | ||
AccessModifierOffset: '-4' | ||
IndentWidth: '4' | ||
IndentPPDirectives: AfterHash | ||
IndentCaseLabels: false | ||
IncludeBlocks: Regroup | ||
IncludeCategories: | ||
- Regex: '^<.*\..*>' | ||
Priority: 2 | ||
- Regex: '^<.*>' | ||
Priority: 1 | ||
- Regex: '".*"' | ||
Priority: 3 | ||
Language: Cpp | ||
TabWidth: '4' | ||
UseTab: ForIndentation | ||
IndentPPDirectives: AfterHash | ||
AlignConsecutiveAssignments: true | ||
IndentCaseLabels: false | ||
IncludeBlocks: Preserve |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
bullet_char: '*' | ||
enum_char: . | ||
line_width: 120 | ||
max_pargs_hwrap: 3 | ||
separate_ctrl_name_with_space: false | ||
separate_fn_name_with_space: false | ||
tab_size: 4 | ||
columnize: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.build/ | ||
.vscode/ | ||
.vscode/ | ||
.deps/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
cmake_minimum_required(VERSION 3.16) | ||
set(PROJECT_NAME "project_name") | ||
project(${PROJECT_NAME} C CXX) | ||
|
||
project("project_name" C CXX) | ||
|
||
include("cmake/prevent_in_source_builds.cmake") | ||
include("cmake/standard_project_setup.cmake") | ||
|
||
include("cmake/compiler_features.cmake") | ||
include("cmake/compiler_warnings.cmake") | ||
include("cmake/conan.cmake") | ||
|
||
set_property(GLOBAL PROPERTY CXX_STANDARD 20) | ||
set_property(GLOBAL PROPERTY USE_FOLDERS ON) | ||
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "predefined") | ||
add_subdirectory("app") | ||
|
||
include(GoogleTest) | ||
enable_testing() | ||
set(PROJECT_NAME_FOLDER | ||
${PROJECT_NAME} | ||
CACHE STRING "The folder that ${PROJECT_NAME} projects will be placed in.") | ||
|
||
add_subdirectory("app") | ||
option(PROJECT_NAME_BUILD_TESTS "If unit tests should be build." OFF) | ||
if(PROJECT_NAME_BUILD_TESTS) | ||
enable_testing() | ||
include(GoogleTest) | ||
include("thirdparty/googletest.cmake") | ||
add_subdirectory("test") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# cmake-project-template | ||
|
||
Uses CMake for generating and Conan for package management. | ||
Uses CMake for generating. | ||
|
||
 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,12 @@ | ||
set(target_name "app") | ||
|
||
set(src_files | ||
"src/main.cpp") | ||
set(src_files "src/main.cpp") | ||
|
||
# Project | ||
add_executable(${target_name} ${src_files}) | ||
|
||
target_link_libraries(${target_name} compiler_features compiler_warnings) | ||
|
||
source_group("src" FILES "src/main.cpp") | ||
|
||
set_target_properties(${target_name} PROPERTIES FOLDER ${PROJECT_NAME}) | ||
set_target_properties(${target_name} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/bin) | ||
|
||
# Tests | ||
add_executable(${target_name}_test "test/test.cpp") | ||
|
||
target_link_libraries(${target_name}_test CONAN_PKG::gtest) | ||
|
||
set_target_properties(${target_name}_test PROPERTIES FOLDER ${PROJECT_NAME}) | ||
|
||
gtest_discover_tests(${target_name}_test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#include <iostream> | ||
|
||
int main() { | ||
std::cout << "Hello World!" << std::endl; | ||
std::cout << "This will become something epic!" << std::endl; | ||
|
||
return 0; | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
if (MSVC) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++latest") | ||
else() | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++2a") | ||
endif() | ||
add_library(compiler_features INTERFACE) | ||
|
||
message("-- CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}") | ||
target_compile_features(compiler_features INTERFACE cxx_std_20) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
get_filename_component(srcdir "${CMAKE_SOURCE_DIR}" REALPATH) | ||
get_filename_component(bindir "${CMAKE_BINARY_DIR}" REALPATH) | ||
|
||
if("${srcdir}" STREQUAL "${bindir}") | ||
message("=========================================================") | ||
message("Warning: in-source builds are disabled!") | ||
message("Please create a separate build folder using the -B flag") | ||
message("=========================================================") | ||
message(FATAL_ERROR "Quitting configuration!") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
set_property(GLOBAL PROPERTY USE_FOLDERS ON) | ||
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "predefined") |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cmake --build .build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cmake . -B.build -Ax64 -DPROJECT_NAME_BUILD_TESTS=OFF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cmake --open .build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@echo off | ||
|
||
cmake . -B.build -Ax64 -DPROJECT_NAME_BUILD_TESTS=ON | ||
cmake --build .build/ | ||
cd .build/ | ||
ctest . | ||
cd .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
set(target_name "app_test") | ||
|
||
set(src_files "src/unit.cpp") | ||
|
||
add_executable(${target_name} ${src_files}) | ||
|
||
target_link_libraries( | ||
${target_name} | ||
gtest | ||
gmock | ||
gmock_main) | ||
|
||
set_target_properties(${target_name} PROPERTIES FOLDER ${PROJECT_NAME}/test) | ||
|
||
gtest_discover_tests(${target_name}) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
message("-- External Project: googletest") | ||
include(FetchContent) | ||
|
||
FetchContent_Declare( | ||
googletest | ||
GIT_REPOSITORY https://github.com/google/googletest.git | ||
GIT_TAG a4ab0ab # This includes a fix when using C++20 | ||
) | ||
|
||
FetchContent_MakeAvailable(googletest) | ||
|
||
set_target_properties("gtest" PROPERTIES FOLDER "thirdparty/googletest") | ||
set_target_properties("gmock" PROPERTIES FOLDER "thirdparty/googletest") | ||
set_target_properties("gtest_main" PROPERTIES FOLDER "thirdparty/googletest") | ||
set_target_properties("gmock_main" PROPERTIES FOLDER "thirdparty/googletest") |