From 6c9624dfb44802dd3b406d7ceef8e5230a19f519 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sat, 12 Sep 2020 16:24:29 +0200 Subject: [PATCH 001/272] updated link to point to an existing github source Original project did not work anymore due a missing link, now updated --- {{cookiecutter.repo_name}}/external/gtest.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/external/gtest.cmake b/{{cookiecutter.repo_name}}/external/gtest.cmake index e11ca1e..f28bc56 100644 --- a/{{cookiecutter.repo_name}}/external/gtest.cmake +++ b/{{cookiecutter.repo_name}}/external/gtest.cmake @@ -7,8 +7,8 @@ include(ExternalProject) # Fetch GoogleTest remotely ExternalProject_Add( gtest - URL https://googletest.googlecode.com/files/gtest-1.7.0.zip - URL_MD5 2d6ec8ccdf5c46b05ba54a9fd1d130d7 + URL https://github.com/google/googletest/archive/release-1.7.0.zip + URL_MD5 ef5e700c8a0f3ee123e2e0209b8b4961 PREFIX ${CMAKE_CURRENT_BINARY_DIR} # Disable INSTALL INSTALL_COMMAND "" From f7c2bd77a6add4b0b58bce0b3a75fb974765fbf0 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sat, 12 Sep 2020 16:33:04 +0200 Subject: [PATCH 002/272] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b59f173..831f7bd 100644 --- a/README.md +++ b/README.md @@ -11,4 +11,4 @@ Usage: ------ $ pip install cookiecutter - $ cookiecutter gh:hbristow/cookiecutter-cpp + $ cookiecutter gh:reinout91/cookiecutter-cpp From d2f857c3cb087ade086357b51b249bb391ab1d3d Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 13 Sep 2020 20:00:57 +0200 Subject: [PATCH 003/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 4a76ac5..011d95e 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -11,18 +11,32 @@ set(PROJECT_VERSION_MINOR "{{ cookiecutter.version.split('.')[1] }}") set(PROJECT_VERSION_PATCH "{{ cookiecutter.version.split('.')[2] }}") # Build flags +# Set build type if not set. +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release) +endif() +set(CMAKE_CXX_FLAGS_DEBUG "-g -O0") +set(CMAKE_CXX_FLAGS_RELEASE "-O3") +set (CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -march=native") {% if cookiecutter.pedantic -%} set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -pedantic") {%- endif %} +# Tell cmake to output binaries here: +set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) +set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib) # --------------------------------------------------------- # Features # --------------------------------------------------------- add_subdirectory(external) +# Tell cmake where to look for *.h files. +include_directories(${PROJECT_SOURCE_DIR}/src) +# Outsource the actual processing to folders. add_subdirectory(src) - +# Must be in the top-most CMakeLists.txt file. enable_testing() -add_subdirectory(test) +# Outsource tests to another folder. +add_subdirectory(tests) add_subdirectory(doc) From 38f127309dadb095e44836af1f461a5c8754f206 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 13 Sep 2020 20:12:53 +0200 Subject: [PATCH 004/272] adopt to Bonn example --- {{cookiecutter.repo_name}}/src/CMakeLists.txt | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/{{cookiecutter.repo_name}}/src/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/CMakeLists.txt index 3e2e0ba..a251d7b 100644 --- a/{{cookiecutter.repo_name}}/src/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/CMakeLists.txt @@ -1,10 +1,7 @@ -# Target: {{ cookiecutter.project_name }}_lib -# Type: Library -file(GLOB SOURCE *.cpp) -add_library({{ cookiecutter.project_name }}_lib SHARED ${SOURCE}) -set_target_properties({{ cookiecutter.project_name }}_lib PROPERTIES - "OUTPUT_NAME" "{{ cookiecutter.project_name }}" - "INCLUDE_DIRECTORIES" "${CMAKE_CURRENT_SOURCE_DIR}/include" -) -install(TARGETS {{ cookiecutter.project_name }}_lib EXPORT {{ cookiecutter.project_name }} DESTINATION ${CMAKE_SOURCE_DIR}/lib) -export(TARGETS {{ cookiecutter.project_name }}_lib FILE ${CMAKE_BINARY_DIR}/{{ cookiecutter.project_name }}-config.cmake) +# Target: {{ cookiecutter.project_name }} +add_subdirectory({{ cookiecutter.project_name }}) + +# add executable main +add_executable(main main.cpp) +# tell the linker to bin these objects: +# target_link_libraries(main) From fb257744a3be29277e7da9dc5df11ffdc87c5459 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 13 Sep 2020 20:13:19 +0200 Subject: [PATCH 005/272] adopt to Bonn example --- {{cookiecutter.repo_name}}/src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/CMakeLists.txt index a251d7b..85caa37 100644 --- a/{{cookiecutter.repo_name}}/src/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/CMakeLists.txt @@ -4,4 +4,4 @@ add_subdirectory({{ cookiecutter.project_name }}) # add executable main add_executable(main main.cpp) # tell the linker to bin these objects: -# target_link_libraries(main) +target_link_libraries(main) From 913b4fa15563822325d17b9524f713815badbc34 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 13 Sep 2020 20:18:51 +0200 Subject: [PATCH 006/272] Create main.cpp --- .../src/{{cookiecutter.repo_name}}/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp new file mode 100644 index 0000000..cb7c692 --- /dev/null +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp @@ -0,0 +1,9 @@ +#include + +using namespace std; + +int main() +{ +std::cout << "Hello World" < Date: Sun, 13 Sep 2020 20:20:03 +0200 Subject: [PATCH 007/272] Delete feature.cpp --- {{cookiecutter.repo_name}}/src/feature.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 {{cookiecutter.repo_name}}/src/feature.cpp diff --git a/{{cookiecutter.repo_name}}/src/feature.cpp b/{{cookiecutter.repo_name}}/src/feature.cpp deleted file mode 100644 index e69de29..0000000 From ebbbb1d2d62bb7992aa826cbe07ecc8e21a6922f Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 13 Sep 2020 20:22:22 +0200 Subject: [PATCH 008/272] Create CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt new file mode 100644 index 0000000..571cfaa --- /dev/null +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -0,0 +1,3 @@ +add_library(main main.cpp) + +target_link_libraries(main) From 9c43eeb7d087b7f852c86bbc8159403ad9301cc8 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 13 Sep 2020 20:26:20 +0200 Subject: [PATCH 009/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/src/CMakeLists.txt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/{{cookiecutter.repo_name}}/src/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/CMakeLists.txt index 85caa37..622463f 100644 --- a/{{cookiecutter.repo_name}}/src/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/CMakeLists.txt @@ -1,7 +1,2 @@ # Target: {{ cookiecutter.project_name }} add_subdirectory({{ cookiecutter.project_name }}) - -# add executable main -add_executable(main main.cpp) -# tell the linker to bin these objects: -target_link_libraries(main) From 02cbeea98edf070bcbd7ca0e04f8dad560957579 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 13 Sep 2020 20:33:52 +0200 Subject: [PATCH 010/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 011d95e..577baad 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -38,5 +38,5 @@ add_subdirectory(src) # Must be in the top-most CMakeLists.txt file. enable_testing() # Outsource tests to another folder. -add_subdirectory(tests) +add_subdirectory(test) add_subdirectory(doc) From 6a7f3171a2f883070f761470a3b718db837aaab5 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 13 Sep 2020 20:39:37 +0200 Subject: [PATCH 011/272] Delete test_{{cookiecutter.project_name}}.cpp --- .../test/test_{{cookiecutter.project_name}}.cpp | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 {{cookiecutter.repo_name}}/test/test_{{cookiecutter.project_name}}.cpp diff --git a/{{cookiecutter.repo_name}}/test/test_{{cookiecutter.project_name}}.cpp b/{{cookiecutter.repo_name}}/test/test_{{cookiecutter.project_name}}.cpp deleted file mode 100644 index ac4d862..0000000 --- a/{{cookiecutter.repo_name}}/test/test_{{cookiecutter.project_name}}.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include - -TEST({{ cookiecutter.project_name | capitalize }}Test, Contrived) { - EXPECT_TRUE(true); -} From f14676a278229f3e8c5734a8b441c01f9fc9ff85 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 13 Sep 2020 20:40:49 +0200 Subject: [PATCH 012/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/test/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/test/CMakeLists.txt b/{{cookiecutter.repo_name}}/test/CMakeLists.txt index fb41ad2..c5e85db 100644 --- a/{{cookiecutter.repo_name}}/test/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/test/CMakeLists.txt @@ -4,5 +4,5 @@ add_executable(${PROJECT_NAME}_test ${SOURCES}) target_link_libraries(${PROJECT_NAME}_test ${PROJECT_NAME}_lib libgtest) # Register the tests -add_test(NAME ${PROJECT_NAME}_test - COMMAND ${PROJECT_NAME}_test) +# add_test(NAME ${PROJECT_NAME}_test +# COMMAND ${PROJECT_NAME}_test) From 785afcbf10cf4758c2b8189af34f3443bee562f7 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 13 Sep 2020 20:41:22 +0200 Subject: [PATCH 013/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/test/CMakeLists.txt b/{{cookiecutter.repo_name}}/test/CMakeLists.txt index c5e85db..bc8eb7d 100644 --- a/{{cookiecutter.repo_name}}/test/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/test/CMakeLists.txt @@ -1,7 +1,7 @@ # Tests for {{ cookiecutter.project_name }} file(GLOB SOURCES *.cpp) add_executable(${PROJECT_NAME}_test ${SOURCES}) -target_link_libraries(${PROJECT_NAME}_test ${PROJECT_NAME}_lib libgtest) +target_link_libraries(${PROJECT_NAME}_test libgtest) # Register the tests # add_test(NAME ${PROJECT_NAME}_test From 30b5cc3b22d00f70fb756ef9dc38ba9054209412 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 14 Sep 2020 10:26:44 +0200 Subject: [PATCH 014/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/test/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/test/CMakeLists.txt b/{{cookiecutter.repo_name}}/test/CMakeLists.txt index bc8eb7d..0365791 100644 --- a/{{cookiecutter.repo_name}}/test/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/test/CMakeLists.txt @@ -4,5 +4,5 @@ add_executable(${PROJECT_NAME}_test ${SOURCES}) target_link_libraries(${PROJECT_NAME}_test libgtest) # Register the tests -# add_test(NAME ${PROJECT_NAME}_test -# COMMAND ${PROJECT_NAME}_test) +add_test(NAME ${PROJECT_NAME}_test + COMMAND ${PROJECT_NAME}_test) From 12870b233ed9d6975a603790c13e70bd7bb903a1 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 14 Sep 2020 10:28:14 +0200 Subject: [PATCH 015/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/src/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/src/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/CMakeLists.txt index 622463f..571cfaa 100644 --- a/{{cookiecutter.repo_name}}/src/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/CMakeLists.txt @@ -1,2 +1,3 @@ -# Target: {{ cookiecutter.project_name }} -add_subdirectory({{ cookiecutter.project_name }}) +add_library(main main.cpp) + +target_link_libraries(main) From 04062e225cf23b8d808a38f35920fe0b3b92f83a Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 14 Sep 2020 10:29:13 +0200 Subject: [PATCH 016/272] Delete main.cpp --- .../src/{{cookiecutter.repo_name}}/main.cpp | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp deleted file mode 100644 index cb7c692..0000000 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include - -using namespace std; - -int main() -{ -std::cout << "Hello World" < Date: Mon, 14 Sep 2020 10:29:28 +0200 Subject: [PATCH 017/272] Delete CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt deleted file mode 100644 index 571cfaa..0000000 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -add_library(main main.cpp) - -target_link_libraries(main) From 263b3253e67fbba406c122d8750da0dd21d78c05 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 14 Sep 2020 10:31:38 +0200 Subject: [PATCH 018/272] Create {{cookiecutter.repo_name}}.cpp --- .../src/{{cookiecutter.repo_name}}.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}.cpp diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}.cpp new file mode 100644 index 0000000..3a84a71 --- /dev/null +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}.cpp @@ -0,0 +1,8 @@ +#include +using namespace std; + +int main() +{ +std::cout << "hello world" << std::endl; +return 0; +} From f2ec0552ba1616a82c5b638f475e5a5a4f078219 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 14 Sep 2020 10:32:22 +0200 Subject: [PATCH 019/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/src/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/CMakeLists.txt index 571cfaa..bae9b1a 100644 --- a/{{cookiecutter.repo_name}}/src/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/CMakeLists.txt @@ -1,3 +1,3 @@ -add_library(main main.cpp) +add_library({{cookiecutter.repo_name}} {{cookiecutter.repo_name}}.cpp) -target_link_libraries(main) +target_link_libraries({{cookiecutter.repo_name}}) From 06409826ff0c2c5672c86a2595af4b1a2c579803 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 14 Sep 2020 22:44:56 +0200 Subject: [PATCH 020/272] Create main.cpp --- .../src/{{cookiecutter.repo_name}}/main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp new file mode 100644 index 0000000..3a84a71 --- /dev/null +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp @@ -0,0 +1,8 @@ +#include +using namespace std; + +int main() +{ +std::cout << "hello world" << std::endl; +return 0; +} From 59ca1060752279b8911d2294933eb2c5d50ade75 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 14 Sep 2020 22:45:23 +0200 Subject: [PATCH 021/272] Delete {{cookiecutter.repo_name}}.cpp --- .../src/{{cookiecutter.repo_name}}.cpp | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}.cpp diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}.cpp deleted file mode 100644 index 3a84a71..0000000 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include -using namespace std; - -int main() -{ -std::cout << "hello world" << std::endl; -return 0; -} From 9fd5f65732f9506a126432e9e265a2cca322cff7 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 14 Sep 2020 22:46:39 +0200 Subject: [PATCH 022/272] Create bin.txt --- {{cookiecutter.repo_name}}/bin/bin.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 {{cookiecutter.repo_name}}/bin/bin.txt diff --git a/{{cookiecutter.repo_name}}/bin/bin.txt b/{{cookiecutter.repo_name}}/bin/bin.txt new file mode 100644 index 0000000..13aef47 --- /dev/null +++ b/{{cookiecutter.repo_name}}/bin/bin.txt @@ -0,0 +1 @@ +application folder From 5321f799ca6999e868679a9201513274045d244d Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 14 Sep 2020 22:47:26 +0200 Subject: [PATCH 023/272] Create lib.txt --- {{cookiecutter.repo_name}}/lib/lib.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 {{cookiecutter.repo_name}}/lib/lib.txt diff --git a/{{cookiecutter.repo_name}}/lib/lib.txt b/{{cookiecutter.repo_name}}/lib/lib.txt new file mode 100644 index 0000000..4670f82 --- /dev/null +++ b/{{cookiecutter.repo_name}}/lib/lib.txt @@ -0,0 +1 @@ +This is the lib folder From 1ff1edabd83312bcc0ba22e7f748fd5a1c90add8 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 14 Sep 2020 22:49:15 +0200 Subject: [PATCH 024/272] Update cookiecutter.json --- cookiecutter.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookiecutter.json b/cookiecutter.json index 14ba594..9776cc1 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -5,7 +5,7 @@ "check_style": true, "pedantic": true, "version": "0.0.1", - "year": 2015, + "year": 2020, "author": "First Last", "email": "{{ cookiecutter.author.split()|join('.')|lower }}@gmail.com", "username": "{{ cookiecutter.author|first|lower }}{{ cookiecutter.author.split()|last|lower }}", From a14c7f3eaee4a8900d3f9bf323903e9779660153 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 14 Sep 2020 22:53:45 +0200 Subject: [PATCH 025/272] Create tools.h --- .../src/{{cookiecutter.repo_name}}/tools.h | 1 + 1 file changed, 1 insertion(+) create mode 100644 {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.h diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.h b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.h new file mode 100644 index 0000000..a585ea3 --- /dev/null +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.h @@ -0,0 +1 @@ +#pragma once; From 016042cd7ec0cab5e387ba57cd0deac6a9d5ec90 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 14 Sep 2020 22:54:17 +0200 Subject: [PATCH 026/272] Create tools.cpp --- .../src/{{cookiecutter.repo_name}}/tools.cpp | 1 + 1 file changed, 1 insertion(+) create mode 100644 {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.cpp diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.cpp new file mode 100644 index 0000000..2fa7e97 --- /dev/null +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.cpp @@ -0,0 +1 @@ +#include "tools.h" From ed866c59eed86b51c54da9d9ebc1f470f49c4c0c Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 14 Sep 2020 22:58:43 +0200 Subject: [PATCH 027/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/src/CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/{{cookiecutter.repo_name}}/src/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/CMakeLists.txt index bae9b1a..72c615e 100644 --- a/{{cookiecutter.repo_name}}/src/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/CMakeLists.txt @@ -1,3 +1 @@ -add_library({{cookiecutter.repo_name}} {{cookiecutter.repo_name}}.cpp) - -target_link_libraries({{cookiecutter.repo_name}}) +add_subdirectory({{cookiecutter.repo_name}}) From 09ecd199b39014fe030a23d3e906617cad54fb56 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 14 Sep 2020 23:01:57 +0200 Subject: [PATCH 028/272] Create CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt new file mode 100644 index 0000000..d5fda64 --- /dev/null +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -0,0 +1,3 @@ +add_library(tools, tools.cpp) +add_executable(main main.cpp) +target_link_libraries(main, tools) From 76db9ad267c4eec1ab08462a040fb7add9f02fcf Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 14 Sep 2020 23:15:45 +0200 Subject: [PATCH 029/272] Update tools.h --- .../src/{{cookiecutter.repo_name}}/tools.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.h b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.h index a585ea3..d077a7a 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.h +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.h @@ -1 +1,3 @@ #pragma once; +#include +void printHello(); From c7dceda282d8870479ed658378c7e9473b30923d Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 14 Sep 2020 23:16:59 +0200 Subject: [PATCH 030/272] Update tools.cpp --- .../src/{{cookiecutter.repo_name}}/tools.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.cpp index 2fa7e97..9968531 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.cpp @@ -1 +1,4 @@ #include "tools.h" +void printHello() +{ + std::cout << "hello" << std::endl From 3b546ddb90b10502e2554a35ebf9adda786dbb6a Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 14 Sep 2020 23:19:55 +0200 Subject: [PATCH 031/272] Update tools.cpp --- .../src/{{cookiecutter.repo_name}}/tools.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.cpp index 9968531..4f224f4 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.cpp @@ -1,4 +1,4 @@ -#include "tools.h" +#include void printHello() { std::cout << "hello" << std::endl From 7d10393ae8c06d9332a5589a3c3b95cf91c6a1c8 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 14 Sep 2020 23:22:44 +0200 Subject: [PATCH 032/272] Update tools.cpp --- .../src/{{cookiecutter.repo_name}}/tools.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.cpp index 4f224f4..b2d3e42 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.cpp @@ -1,4 +1,4 @@ -#include +#include "./tools.h" void printHello() { std::cout << "hello" << std::endl From 79d865d890546c7406a1bc9f7dcaeda99d4a600a Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 14 Sep 2020 23:28:41 +0200 Subject: [PATCH 033/272] Update main.cpp --- .../src/{{cookiecutter.repo_name}}/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp index 3a84a71..8c423b2 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp @@ -1,8 +1,9 @@ #include +#include using namespace std; int main() { -std::cout << "hello world" << std::endl; + printHello(); return 0; } From 1cb43e9e9c0c752cd3c6cc58c88cfacfdf0e0eb4 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 14 Sep 2020 23:47:48 +0200 Subject: [PATCH 034/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/test/CMakeLists.txt b/{{cookiecutter.repo_name}}/test/CMakeLists.txt index 0365791..211d722 100644 --- a/{{cookiecutter.repo_name}}/test/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/test/CMakeLists.txt @@ -1,7 +1,7 @@ # Tests for {{ cookiecutter.project_name }} file(GLOB SOURCES *.cpp) add_executable(${PROJECT_NAME}_test ${SOURCES}) -target_link_libraries(${PROJECT_NAME}_test libgtest) +target_link_libraries(${PROJECT_NAME}_test tools libgtest) # Register the tests add_test(NAME ${PROJECT_NAME}_test From 61a40c1e3ba9272834f8ec71e63df13d6a7095f6 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 14 Sep 2020 23:56:32 +0200 Subject: [PATCH 035/272] Create testBlah.cpp --- {{cookiecutter.repo_name}}/test/testBlah.cpp | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 {{cookiecutter.repo_name}}/test/testBlah.cpp diff --git a/{{cookiecutter.repo_name}}/test/testBlah.cpp b/{{cookiecutter.repo_name}}/test/testBlah.cpp new file mode 100644 index 0000000..df48b0b --- /dev/null +++ b/{{cookiecutter.repo_name}}/test/testBlah.cpp @@ -0,0 +1,5 @@ +#include + +TEST(testBlah, OutputTest) { + EXPECT_EQ(1,1); +} From 2de8aee0c2088a5361fa7e89634581a85d1f1b0f Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 14 Sep 2020 23:59:00 +0200 Subject: [PATCH 036/272] Update tools.cpp --- .../src/{{cookiecutter.repo_name}}/tools.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.cpp index b2d3e42..3770570 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.cpp @@ -1,4 +1,5 @@ #include "./tools.h" -void printHello() +int sum(int a, int b) { - std::cout << "hello" << std::endl + return a + b; +} From a259220b40381fb5d6f649114c395e70e0e750d4 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 14 Sep 2020 23:59:43 +0200 Subject: [PATCH 037/272] Update main.cpp --- .../src/{{cookiecutter.repo_name}}/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp index 8c423b2..e581e2f 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp @@ -4,6 +4,6 @@ using namespace std; int main() { - printHello(); + std::cout << sum(1,2) < Date: Tue, 15 Sep 2020 00:01:27 +0200 Subject: [PATCH 038/272] Update tools.cpp --- .../src/{{cookiecutter.repo_name}}/tools.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.cpp index 3770570..53dfdf4 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.cpp @@ -1,5 +1,6 @@ #include "./tools.h" int sum(int a, int b) { + std::cout "input a: "<< a << std::endl << "input b: " << b << std::endl; return a + b; } From 5abcc151426635af869a89863dbf1b09015e2f3e Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 00:02:11 +0200 Subject: [PATCH 039/272] Update main.cpp --- .../src/{{cookiecutter.repo_name}}/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp index e581e2f..afd568c 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp @@ -4,6 +4,6 @@ using namespace std; int main() { - std::cout << sum(1,2) < Date: Tue, 15 Sep 2020 00:03:27 +0200 Subject: [PATCH 040/272] Update and rename testBlah.cpp to testSum.cpp --- {{cookiecutter.repo_name}}/test/testBlah.cpp | 5 ----- {{cookiecutter.repo_name}}/test/testSum.cpp | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) delete mode 100644 {{cookiecutter.repo_name}}/test/testBlah.cpp create mode 100644 {{cookiecutter.repo_name}}/test/testSum.cpp diff --git a/{{cookiecutter.repo_name}}/test/testBlah.cpp b/{{cookiecutter.repo_name}}/test/testBlah.cpp deleted file mode 100644 index df48b0b..0000000 --- a/{{cookiecutter.repo_name}}/test/testBlah.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include - -TEST(testBlah, OutputTest) { - EXPECT_EQ(1,1); -} diff --git a/{{cookiecutter.repo_name}}/test/testSum.cpp b/{{cookiecutter.repo_name}}/test/testSum.cpp new file mode 100644 index 0000000..d236783 --- /dev/null +++ b/{{cookiecutter.repo_name}}/test/testSum.cpp @@ -0,0 +1,5 @@ +#include + +TEST(testSum, OutputTest) { + EXPECT_EQ(4, sum(1,3)); +} From 9d6327b4ca9d7540d193527116f14a7a926bf4bd Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 00:07:04 +0200 Subject: [PATCH 041/272] Update and rename testSum.cpp to testTools.cpp --- {{cookiecutter.repo_name}}/test/{testSum.cpp => testTools.cpp} | 1 + 1 file changed, 1 insertion(+) rename {{cookiecutter.repo_name}}/test/{testSum.cpp => testTools.cpp} (81%) diff --git a/{{cookiecutter.repo_name}}/test/testSum.cpp b/{{cookiecutter.repo_name}}/test/testTools.cpp similarity index 81% rename from {{cookiecutter.repo_name}}/test/testSum.cpp rename to {{cookiecutter.repo_name}}/test/testTools.cpp index d236783..61c9895 100644 --- a/{{cookiecutter.repo_name}}/test/testSum.cpp +++ b/{{cookiecutter.repo_name}}/test/testTools.cpp @@ -1,4 +1,5 @@ #include +#include TEST(testSum, OutputTest) { EXPECT_EQ(4, sum(1,3)); From 62db99eb7764b296f0a842873125a29312ffef37 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 00:11:25 +0200 Subject: [PATCH 042/272] Update and rename tools.cpp to utils.cpp --- .../src/{{cookiecutter.repo_name}}/{tools.cpp => utils.cpp} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{tools.cpp => utils.cpp} (84%) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/utils.cpp similarity index 84% rename from {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.cpp rename to {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/utils.cpp index 53dfdf4..397c7b1 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/utils.cpp @@ -1,4 +1,4 @@ -#include "./tools.h" +#include "./utils.h" int sum(int a, int b) { std::cout "input a: "<< a << std::endl << "input b: " << b << std::endl; From 7d2366b97c8a0903f807c6539a4f49f682204723 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 00:12:01 +0200 Subject: [PATCH 043/272] Update and rename tools.h to utils.h --- .../src/{{cookiecutter.repo_name}}/{tools.h => utils.h} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{tools.h => utils.h} (64%) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.h b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/utils.h similarity index 64% rename from {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.h rename to {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/utils.h index d077a7a..ec3d90a 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/tools.h +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/utils.h @@ -1,3 +1,3 @@ #pragma once; #include -void printHello(); +int sum(); From ae2bb643ee61b2472054bd21a44dafcf623351d4 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 00:12:42 +0200 Subject: [PATCH 044/272] Update and rename testTools.cpp to testUtils.cpp --- .../test/{testTools.cpp => testUtils.cpp} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {{cookiecutter.repo_name}}/test/{testTools.cpp => testUtils.cpp} (81%) diff --git a/{{cookiecutter.repo_name}}/test/testTools.cpp b/{{cookiecutter.repo_name}}/test/testUtils.cpp similarity index 81% rename from {{cookiecutter.repo_name}}/test/testTools.cpp rename to {{cookiecutter.repo_name}}/test/testUtils.cpp index 61c9895..a62690b 100644 --- a/{{cookiecutter.repo_name}}/test/testTools.cpp +++ b/{{cookiecutter.repo_name}}/test/testUtils.cpp @@ -1,5 +1,5 @@ #include -#include +#include TEST(testSum, OutputTest) { EXPECT_EQ(4, sum(1,3)); From 237a5e85d0bfdb852ce62b291548c3a526ea91ec Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 00:12:56 +0200 Subject: [PATCH 045/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/test/CMakeLists.txt b/{{cookiecutter.repo_name}}/test/CMakeLists.txt index 211d722..203675f 100644 --- a/{{cookiecutter.repo_name}}/test/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/test/CMakeLists.txt @@ -1,7 +1,7 @@ # Tests for {{ cookiecutter.project_name }} file(GLOB SOURCES *.cpp) add_executable(${PROJECT_NAME}_test ${SOURCES}) -target_link_libraries(${PROJECT_NAME}_test tools libgtest) +target_link_libraries(${PROJECT_NAME}_test utils libgtest) # Register the tests add_test(NAME ${PROJECT_NAME}_test From b9fc08a3b7812268e4b236b486359eeecc581724 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 00:15:02 +0200 Subject: [PATCH 046/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index d5fda64..3fa8bdf 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,3 +1,3 @@ -add_library(tools, tools.cpp) +add_library(utils, utils.cpp) add_executable(main main.cpp) -target_link_libraries(main, tools) +target_link_libraries(main, utils) From b1d8b987dd7dd1cb2906579aa297e9595dd6e0ca Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 00:18:38 +0200 Subject: [PATCH 047/272] Update utils.cpp --- .../src/{{cookiecutter.repo_name}}/utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/utils.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/utils.cpp index 397c7b1..bdb08cf 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/utils.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/utils.cpp @@ -1,4 +1,4 @@ -#include "./utils.h" +#include "./{{cookiecutter.repo_name}}_utils.h" int sum(int a, int b) { std::cout "input a: "<< a << std::endl << "input b: " << b << std::endl; From 37b85738f97643eb8a85f9c8d6c28c2a86d3e6de Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 00:19:01 +0200 Subject: [PATCH 048/272] Rename utils.cpp to {{cookiecutter.repo_name}}_utils.cpp --- .../{utils.cpp => {{cookiecutter.repo_name}}_utils.cpp} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{utils.cpp => {{cookiecutter.repo_name}}_utils.cpp} (100%) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/utils.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}_utils.cpp similarity index 100% rename from {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/utils.cpp rename to {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}_utils.cpp From cf48027a9390a9bfc7ed426c601a0188b7d812f2 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 00:19:23 +0200 Subject: [PATCH 049/272] Rename utils.h to {{cookiecutter.repo_name}}_utils.h --- .../{utils.h => {{cookiecutter.repo_name}}_utils.h} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{utils.h => {{cookiecutter.repo_name}}_utils.h} (100%) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/utils.h b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}_utils.h similarity index 100% rename from {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/utils.h rename to {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}_utils.h From 28b1cf5dba562a5c093f41aad3790bf2e56e3f6f Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 00:20:09 +0200 Subject: [PATCH 050/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 3fa8bdf..22b232b 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,3 +1,3 @@ -add_library(utils, utils.cpp) +add_library({{cookiecutter.repo_name}}_utils, {{cookiecutter.repo_name}}_utils.cpp) add_executable(main main.cpp) -target_link_libraries(main, utils) +target_link_libraries(main, {{cookiecutter.repo_name}}_utils) From 43edd3c6c6c57efc9dfe78f3e9d7a04a1abbc847 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 00:20:51 +0200 Subject: [PATCH 051/272] Update and rename testUtils.cpp to test{{cookiecutter.repo_name}}_utils.cpp --- .../{testUtils.cpp => test{{cookiecutter.repo_name}}_utils.cpp} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {{cookiecutter.repo_name}}/test/{testUtils.cpp => test{{cookiecutter.repo_name}}_utils.cpp} (64%) diff --git a/{{cookiecutter.repo_name}}/test/testUtils.cpp b/{{cookiecutter.repo_name}}/test/test{{cookiecutter.repo_name}}_utils.cpp similarity index 64% rename from {{cookiecutter.repo_name}}/test/testUtils.cpp rename to {{cookiecutter.repo_name}}/test/test{{cookiecutter.repo_name}}_utils.cpp index a62690b..ea52772 100644 --- a/{{cookiecutter.repo_name}}/test/testUtils.cpp +++ b/{{cookiecutter.repo_name}}/test/test{{cookiecutter.repo_name}}_utils.cpp @@ -1,5 +1,5 @@ #include -#include +#include <{{cookiecutter.repo_name}}_utils.h> TEST(testSum, OutputTest) { EXPECT_EQ(4, sum(1,3)); From 454e259acbcae09b08a686b034e16a35ae700b2d Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 00:21:13 +0200 Subject: [PATCH 052/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/test/CMakeLists.txt b/{{cookiecutter.repo_name}}/test/CMakeLists.txt index 203675f..d2f0f5a 100644 --- a/{{cookiecutter.repo_name}}/test/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/test/CMakeLists.txt @@ -1,7 +1,7 @@ # Tests for {{ cookiecutter.project_name }} file(GLOB SOURCES *.cpp) add_executable(${PROJECT_NAME}_test ${SOURCES}) -target_link_libraries(${PROJECT_NAME}_test utils libgtest) +target_link_libraries(${PROJECT_NAME}_test {{cookiecutter.repo_name}}_utils libgtest) # Register the tests add_test(NAME ${PROJECT_NAME}_test From b9e8643ec836e345c9b002f5a5d11a7974031a77 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 10:47:54 +0200 Subject: [PATCH 053/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 22b232b..8297370 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,3 +1,3 @@ add_library({{cookiecutter.repo_name}}_utils, {{cookiecutter.repo_name}}_utils.cpp) add_executable(main main.cpp) -target_link_libraries(main, {{cookiecutter.repo_name}}_utils) +target_link_libraries(main {{cookiecutter.repo_name}}_utils) From b92cd63353ecbe1b31a353ebb92965ac0073e071 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 11:20:30 +0200 Subject: [PATCH 054/272] Update {{cookiecutter.repo_name}}_utils.cpp --- .../{{cookiecutter.repo_name}}_utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}_utils.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}_utils.cpp index bdb08cf..1282d07 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}_utils.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}_utils.cpp @@ -1,6 +1,6 @@ #include "./{{cookiecutter.repo_name}}_utils.h" int sum(int a, int b) { - std::cout "input a: "<< a << std::endl << "input b: " << b << std::endl; + std::cout << "input a: " << a << std::endl << "input b: " << b << std::endl; return a + b; } From 6952cc7f64b63a5d1ac6ade915df67a206ddf249 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 11:20:44 +0200 Subject: [PATCH 055/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 8297370..8430d1e 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,3 +1,3 @@ -add_library({{cookiecutter.repo_name}}_utils, {{cookiecutter.repo_name}}_utils.cpp) +add_library({{cookiecutter.repo_name}}_utils {{cookiecutter.repo_name}}_utils.cpp) add_executable(main main.cpp) target_link_libraries(main {{cookiecutter.repo_name}}_utils) From 6dcee21e45e00d6d263e4c57f51b12a69236077c Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 11:25:03 +0200 Subject: [PATCH 056/272] Update {{cookiecutter.repo_name}}_utils.h --- .../{{cookiecutter.repo_name}}_utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}_utils.h b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}_utils.h index ec3d90a..4ac6ea2 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}_utils.h +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}_utils.h @@ -1,3 +1,3 @@ -#pragma once; +#pragma once #include int sum(); From e3859ebf2a7cc1237b83b0a45e74c66bc35c14c2 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 11:32:03 +0200 Subject: [PATCH 057/272] Update main.cpp --- .../src/{{cookiecutter.repo_name}}/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp index afd568c..54dfd94 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp @@ -1,5 +1,5 @@ #include -#include +#include <{{cookiecutter.repo_name}}_utils.h> using namespace std; int main() From 2ebe5fcd05b90665361628933c8be3b4f0db7a71 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 12:18:13 +0200 Subject: [PATCH 058/272] Update CMakeLists.txt From 2c1b3a817a92653244b739b5555151ab6192f6d9 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 12:18:41 +0200 Subject: [PATCH 059/272] Update main.cpp --- .../src/{{cookiecutter.repo_name}}/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp index 54dfd94..2592905 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp @@ -1,5 +1,5 @@ #include -#include <{{cookiecutter.repo_name}}_utils.h> +#include "{{cookiecutter.repo_name}}_utils.h" using namespace std; int main() From 29eeef7d940147019a2c228fbe14df401fe92c3b Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 12:22:42 +0200 Subject: [PATCH 060/272] Update {{cookiecutter.repo_name}}_utils.h --- .../{{cookiecutter.repo_name}}_utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}_utils.h b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}_utils.h index 4ac6ea2..d1050ee 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}_utils.h +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}_utils.h @@ -1,3 +1,3 @@ #pragma once #include -int sum(); +int sum(int, int); From 7db5c724cb7aa1c2ac84d02e1f69b2b6c89c709c Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 12:45:45 +0200 Subject: [PATCH 061/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/test/CMakeLists.txt b/{{cookiecutter.repo_name}}/test/CMakeLists.txt index d2f0f5a..2a14515 100644 --- a/{{cookiecutter.repo_name}}/test/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/test/CMakeLists.txt @@ -2,7 +2,7 @@ file(GLOB SOURCES *.cpp) add_executable(${PROJECT_NAME}_test ${SOURCES}) target_link_libraries(${PROJECT_NAME}_test {{cookiecutter.repo_name}}_utils libgtest) - +target_include_directories({{cookiecutter.repo_name}}Test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src) # Register the tests add_test(NAME ${PROJECT_NAME}_test COMMAND ${PROJECT_NAME}_test) From 9355cd9f28bd44b53b5a044d56132afee6e046b8 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 12:47:15 +0200 Subject: [PATCH 062/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/test/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/test/CMakeLists.txt b/{{cookiecutter.repo_name}}/test/CMakeLists.txt index 2a14515..9f80f5e 100644 --- a/{{cookiecutter.repo_name}}/test/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/test/CMakeLists.txt @@ -2,7 +2,6 @@ file(GLOB SOURCES *.cpp) add_executable(${PROJECT_NAME}_test ${SOURCES}) target_link_libraries(${PROJECT_NAME}_test {{cookiecutter.repo_name}}_utils libgtest) -target_include_directories({{cookiecutter.repo_name}}Test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src) # Register the tests add_test(NAME ${PROJECT_NAME}_test COMMAND ${PROJECT_NAME}_test) From c53cd7339edcb03fd1cb11d75e80dccf426d6bfb Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 13:28:01 +0200 Subject: [PATCH 063/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 577baad..e24522a 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -32,7 +32,7 @@ set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib) # --------------------------------------------------------- add_subdirectory(external) # Tell cmake where to look for *.h files. -include_directories(${PROJECT_SOURCE_DIR}/src) +include_directories(${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/src/{{cookiecutter.repo_name}}) # Outsource the actual processing to folders. add_subdirectory(src) # Must be in the top-most CMakeLists.txt file. From b8a7abc35cd36b6a1e084253219f52d232a4e5e9 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 13:28:49 +0200 Subject: [PATCH 064/272] Update main.cpp --- .../src/{{cookiecutter.repo_name}}/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp index 2592905..54dfd94 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp @@ -1,5 +1,5 @@ #include -#include "{{cookiecutter.repo_name}}_utils.h" +#include <{{cookiecutter.repo_name}}_utils.h> using namespace std; int main() From b75717ecdbaa132272c5dec45d765eff0563e7fe Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 13:41:12 +0200 Subject: [PATCH 065/272] Update README.md --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 831f7bd..073c7ce 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,13 @@ cookiecutter-cpp A test-driven C++ project template built on CMake and GoogleTest -[![Build Status] - (https://travis-ci.org/hbristow/cookiecutter-cpp.svg)] - (https://travis-ci.org/hbristow/cookiecutter-cpp) +CMake is a fast and easy build tool. +Google test ensures robust code. +Doxygen enables documentation. + +This template was made by combining instructions from Igor Bogoslavskyi's videos https://www.youtube.com/watch?v=q8xO2eJijy4&list=PLgnQpQtFTOGR50iIOtO36nK6aNPtVq98C&index=4 with https://github.com/hbristow/cookiecutter-cpp + + Usage: ------ From 8b8df88af544bb36ed3f745e9e0416cf0819ea5b Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 13:41:38 +0200 Subject: [PATCH 066/272] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 073c7ce..7830f9c 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ cookiecutter-cpp A test-driven C++ project template built on CMake and GoogleTest -CMake is a fast and easy build tool. -Google test ensures robust code. +CMake is a fast and easy build tool. +GoogleTest test ensures robust code. Doxygen enables documentation. This template was made by combining instructions from Igor Bogoslavskyi's videos https://www.youtube.com/watch?v=q8xO2eJijy4&list=PLgnQpQtFTOGR50iIOtO36nK6aNPtVq98C&index=4 with https://github.com/hbristow/cookiecutter-cpp From 72a14c4e42e78f5c6279538bdcafcc80f28f6240 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 13:43:00 +0200 Subject: [PATCH 067/272] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7830f9c..73f11b5 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,9 @@ CMake is a fast and easy build tool. GoogleTest test ensures robust code. Doxygen enables documentation. -This template was made by combining instructions from Igor Bogoslavskyi's videos https://www.youtube.com/watch?v=q8xO2eJijy4&list=PLgnQpQtFTOGR50iIOtO36nK6aNPtVq98C&index=4 with https://github.com/hbristow/cookiecutter-cpp +This template was made by combining: +An existing Cookiecutter template with https://github.com/hbristow/cookiecutter-cpp with: +A lecture from Igor Bogoslavskyi's videos https://www.youtube.com/watch?v=q8xO2eJijy4&list=PLgnQpQtFTOGR50iIOtO36nK6aNPtVq98C&index=4 From 595d417af6719d8bf30303ca696f4f5fc787c2c6 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 13:46:29 +0200 Subject: [PATCH 068/272] Update README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 73f11b5..2814074 100644 --- a/README.md +++ b/README.md @@ -18,3 +18,11 @@ Usage: $ pip install cookiecutter $ cookiecutter gh:reinout91/cookiecutter-cpp + $ cd {project dir}/build + $ cmake .. + $ make + $ ctest -vv + $ ../bin/./main + + + From 45b079b2424ae85738b4c1035503444f2c3e0a2d Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 13:55:05 +0200 Subject: [PATCH 069/272] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2814074..9ef4cd5 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Usage: $ cmake .. $ make $ ctest -vv - $ ../bin/./main + $ ../bin/main From b7306cc974b22c6143a22696b13d02e1e8be2715 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Tue, 15 Sep 2020 14:00:04 +0200 Subject: [PATCH 070/272] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9ef4cd5..cb09025 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Doxygen enables documentation. This template was made by combining: An existing Cookiecutter template with https://github.com/hbristow/cookiecutter-cpp with: -A lecture from Igor Bogoslavskyi's videos https://www.youtube.com/watch?v=q8xO2eJijy4&list=PLgnQpQtFTOGR50iIOtO36nK6aNPtVq98C&index=4 +A lecture of Igor Bogoslavskyi https://www.youtube.com/watch?v=q8xO2eJijy4&list=PLgnQpQtFTOGR50iIOtO36nK6aNPtVq98C&index=4 From bd0b5eda3a1bf2426c857b736c98e327c82f8bba Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 16 Sep 2020 15:31:34 +0200 Subject: [PATCH 071/272] Add packagemanager manager --- {{cookiecutter.repo_name}}/pmm.cmake | 84 ++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 {{cookiecutter.repo_name}}/pmm.cmake diff --git a/{{cookiecutter.repo_name}}/pmm.cmake b/{{cookiecutter.repo_name}}/pmm.cmake new file mode 100644 index 0000000..5e3ee65 --- /dev/null +++ b/{{cookiecutter.repo_name}}/pmm.cmake @@ -0,0 +1,84 @@ +## MIT License +## +## Copyright (c) 2019 vector-of-bool +## +## Permission is hereby granted, free of charge, to any person obtaining a copy +## of this software and associated documentation files (the "Software"), to deal +## in the Software without restriction, including without limitation the rights +## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +## copies of the Software, and to permit persons to whom the Software is +## furnished to do so, subject to the following conditions: +## +## The above copyright notice and this permission notice shall be included in all +## copies or substantial portions of the Software. +## +## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +## AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +## SOFTWARE. + +# Bump this version to change what PMM version is downloaded +set(PMM_VERSION_INIT 1.5.0) + +# Helpful macro to set a variable if it isn't already set +macro(_pmm_set_if_undef varname) + if(NOT DEFINED "${varname}") + set("${varname}" "${ARGN}") + endif() +endmacro() + +## Variables used by this script +# The version: +_pmm_set_if_undef(PMM_VERSION ${PMM_VERSION_INIT}) +# The base URL we download PMM from: +_pmm_set_if_undef(PMM_URL_BASE "https://vector-of-bool.github.io/pmm") +# The real URL we download from (Based on the version) +_pmm_set_if_undef(PMM_URL "${PMM_URL_BASE}/${PMM_VERSION}") +# The directory where we store our downloaded files +_pmm_set_if_undef(PMM_DIR_BASE "${CMAKE_BINARY_DIR}/_pmm") +_pmm_set_if_undef(PMM_DIR "${PMM_DIR_BASE}/${PMM_VERSION}") +# The location of the current file +_pmm_set_if_undef(PMM_MODULE "${CMAKE_CURRENT_LIST_FILE}") + +# The file that we first download +set(_PMM_ENTRY_FILE "${PMM_DIR}/entry.cmake") + +# Guard against multiple processes trying to use the PMM dir simultaneously +file(LOCK "${PMM_DIR}/_init-pmm" + GUARD PROCESS + TIMEOUT 10 + RESULT_VARIABLE _lock_res + ) +if(NOT _lock_res STREQUAL "0") + message(WARNING "PMM entry didn't lock the directory ${PMM_DIR} successfully (${_lock_res}). We'll continue as best we can.") + set(_pmm_init_did_lock FALSE) +else() + set(_pmm_init_did_lock TRUE) +endif() + +if(NOT EXISTS "${_PMM_ENTRY_FILE}" OR PMM_ALWAYS_DOWNLOAD) + file( + DOWNLOAD "${PMM_URL}/entry.cmake" + "${_PMM_ENTRY_FILE}.tmp" + STATUS pair + ) + list(GET pair 0 rc) + list(GET pair 1 msg) + if (rc) + message(FATAL_ERROR "Failed to download PMM entry file: ${msg}") + endif () + file(RENAME "${_PMM_ENTRY_FILE}.tmp" "${_PMM_ENTRY_FILE}") +endif() + +# ^^^ DO NOT CHANGE THIS LINE vvv +set(_PMM_BOOTSTRAP_VERSION 3) +# ^^^ DO NOT CHANGE THIS LINE ^^^ + +include("${_PMM_ENTRY_FILE}") + +if(_pmm_init_did_lock) + file(LOCK "${PMM_DIR}/_init-pmm" RELEASE) +endif() From c07717f18d38acacf970527b27dfd108ccdde29e Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 16 Sep 2020 15:33:16 +0200 Subject: [PATCH 072/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index e24522a..fcd530c 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -2,6 +2,11 @@ # {{ cookiecutter.description }} # Copyright {{ cookiecutter.year }}, {{ cookiecutter.author }} cmake_minimum_required(VERSION 3.1) + +# Package manager manager +include(pmm.cmake) + +# Project project({{ cookiecutter.project_name }} C CXX) set(PROJECT_DESCRIPTION "{{ cookiecutter.description }}") set(PROJECT_AUTHOR "{{ cookiecutter.author }}") From e29f190058e6944c67f87b382d694bb9d86bce78 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 16 Sep 2020 22:25:48 +0200 Subject: [PATCH 073/272] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index cb09025..95bffc4 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ A test-driven C++ project template built on CMake and GoogleTest CMake is a fast and easy build tool. GoogleTest test ensures robust code. Doxygen enables documentation. +pmm is a package manager manager. You can configure your project to use Conan or VCPKG. This template was made by combining: An existing Cookiecutter template with https://github.com/hbristow/cookiecutter-cpp with: From 92cdb7a59af2489e37530b3c4c97466b32cdc357 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 16 Sep 2020 22:26:06 +0200 Subject: [PATCH 074/272] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 95bffc4..24c46da 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ A test-driven C++ project template built on CMake and GoogleTest CMake is a fast and easy build tool. GoogleTest test ensures robust code. Doxygen enables documentation. -pmm is a package manager manager. You can configure your project to use Conan or VCPKG. +pmm is a package manager manager. +You can configure your project to use Conan or VCPKG. This template was made by combining: An existing Cookiecutter template with https://github.com/hbristow/cookiecutter-cpp with: From d6f6012331b710e361d70921adf5332d9f3b1fd3 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 16 Sep 2020 22:26:45 +0200 Subject: [PATCH 075/272] Update README.md --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 24c46da..c8a17e0 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,8 @@ A test-driven C++ project template built on CMake and GoogleTest CMake is a fast and easy build tool. GoogleTest test ensures robust code. -Doxygen enables documentation. -pmm is a package manager manager. -You can configure your project to use Conan or VCPKG. +Doxygen enables documentation. +pmm is a package manager manager. You can configure your project to use Conan or VCPKG. This template was made by combining: An existing Cookiecutter template with https://github.com/hbristow/cookiecutter-cpp with: From 9dc53373a7a2c978bcb5f0e5b4b74b2296864229 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 16 Sep 2020 22:29:06 +0200 Subject: [PATCH 076/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index fcd530c..8d246c7 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -3,8 +3,8 @@ # Copyright {{ cookiecutter.year }}, {{ cookiecutter.author }} cmake_minimum_required(VERSION 3.1) -# Package manager manager -include(pmm.cmake) +# Find required packages for project +find_package(fmt CONFIG REQUIRED) # Project project({{ cookiecutter.project_name }} C CXX) @@ -32,6 +32,17 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -pedantic") set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib) +# Package manager manager +include(pmm.cmake) +pmm( + # Use vcpkg + VCPKG + # Specify vcpkg branch, tag, or revision + REVISION master + # Space seperated list of required vcpkg packages + REQUIRES fmt +) + # --------------------------------------------------------- # Features # --------------------------------------------------------- From b18e0a6b035b39f53ae766f4e4266b05fc659ba9 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 16 Sep 2020 22:30:30 +0200 Subject: [PATCH 077/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 8d246c7..6239cdc 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -32,7 +32,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -pedantic") set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib) -# Package manager manager +# Package manager manager (fmt is just a sample library to test the manager) include(pmm.cmake) pmm( # Use vcpkg @@ -43,6 +43,9 @@ pmm( REQUIRES fmt ) +# Find required packages for project +find_package(fmt CONFIG REQUIRED) + # --------------------------------------------------------- # Features # --------------------------------------------------------- From 0aa33fccea164ec67609ce2854290a2f90ba1d7f Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 16 Sep 2020 22:34:14 +0200 Subject: [PATCH 078/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 6239cdc..c7ef476 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -29,6 +29,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -pedantic") {%- endif %} # Tell cmake to output binaries here: +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib) From 21edc2af885a4fe6c45d656dee4d0118d307c431 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 16 Sep 2020 22:39:03 +0200 Subject: [PATCH 079/272] Update main.cpp --- .../src/{{cookiecutter.repo_name}}/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp index 54dfd94..01d9354 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp @@ -1,9 +1,11 @@ #include #include <{{cookiecutter.repo_name}}_utils.h> +#include using namespace std; int main() { - std::cout << "sum: " << sum(1,2) < Date: Wed, 16 Sep 2020 22:39:47 +0200 Subject: [PATCH 080/272] Update main.cpp --- .../src/{{cookiecutter.repo_name}}/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp index 01d9354..a69959e 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp @@ -1,6 +1,6 @@ #include #include <{{cookiecutter.repo_name}}_utils.h> -#include +#include //packagemanager downloaded library. using namespace std; int main() From dd7b41285126d51bef2c7d489da22ce1a2c35bf6 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 16 Sep 2020 22:40:19 +0200 Subject: [PATCH 081/272] Update main.cpp --- .../src/{{cookiecutter.repo_name}}/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp index a69959e..f5b426c 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp @@ -1,7 +1,7 @@ #include #include <{{cookiecutter.repo_name}}_utils.h> #include //packagemanager downloaded library. -using namespace std; +namespace std{ int main() { @@ -9,3 +9,4 @@ int main() std::cout << message < Date: Wed, 16 Sep 2020 22:41:29 +0200 Subject: [PATCH 082/272] Update main.cpp --- .../src/{{cookiecutter.repo_name}}/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp index f5b426c..62a5198 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp @@ -1,5 +1,5 @@ #include -#include <{{cookiecutter.repo_name}}_utils.h> +#include <{{cookiecutter.repo_name}}_utils.h> //included package #include //packagemanager downloaded library. namespace std{ From 001cde13f7d0264d55664134d2684c98c1d9d99c Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 16 Sep 2020 22:41:45 +0200 Subject: [PATCH 083/272] Update main.cpp --- .../src/{{cookiecutter.repo_name}}/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp index 62a5198..f5b426c 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp @@ -1,5 +1,5 @@ #include -#include <{{cookiecutter.repo_name}}_utils.h> //included package +#include <{{cookiecutter.repo_name}}_utils.h> #include //packagemanager downloaded library. namespace std{ From fad8eb44b1a7fd0f3096b658bebca62331150cbb Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 16 Sep 2020 22:42:48 +0200 Subject: [PATCH 084/272] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c8a17e0..17d2b5e 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ pmm is a package manager manager. You can configure your project to use Conan or This template was made by combining: An existing Cookiecutter template with https://github.com/hbristow/cookiecutter-cpp with: A lecture of Igor Bogoslavskyi https://www.youtube.com/watch?v=q8xO2eJijy4&list=PLgnQpQtFTOGR50iIOtO36nK6aNPtVq98C&index=4 +Boilerplate pmm project https://github.com/ariveron/boilerplate-pmm-vcpkg-cmake From 9c32e0a69ccd72514ee291957d28c09ef574a005 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 16 Sep 2020 22:45:32 +0200 Subject: [PATCH 085/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 8430d1e..0ce918c 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,3 +1,3 @@ add_library({{cookiecutter.repo_name}}_utils {{cookiecutter.repo_name}}_utils.cpp) add_executable(main main.cpp) -target_link_libraries(main {{cookiecutter.repo_name}}_utils) +target_link_libraries(main {{cookiecutter.repo_name}}_utils PRIVATE fmt::fmt) From 1bb63b36c1128a58cd57887e662f07f228af091c Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 16 Sep 2020 22:48:24 +0200 Subject: [PATCH 086/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index c7ef476..667bcd5 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -6,6 +6,9 @@ cmake_minimum_required(VERSION 3.1) # Find required packages for project find_package(fmt CONFIG REQUIRED) +# can be useful for vim? +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + # Project project({{ cookiecutter.project_name }} C CXX) set(PROJECT_DESCRIPTION "{{ cookiecutter.description }}") From 6da55f6fef27acd9b625e3a48445ece16df14275 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 17 Sep 2020 00:50:21 +0200 Subject: [PATCH 087/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 667bcd5..a668ce2 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -33,6 +33,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -pedantic") # Tell cmake to output binaries here: set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib) From 6fb2f019e362d357f4ca6bcf139ee99ba8485457 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 17 Sep 2020 01:05:00 +0200 Subject: [PATCH 088/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index a668ce2..867e5ca 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -32,10 +32,9 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -pedantic") {%- endif %} # Tell cmake to output binaries here: -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) -set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) -set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib) +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Static link libraries +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin) # Executables +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Dynamic link libraries # Package manager manager (fmt is just a sample library to test the manager) include(pmm.cmake) From 05dacabab7d9367507d310763add1f7358686bd1 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 17 Sep 2020 01:17:02 +0200 Subject: [PATCH 089/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 867e5ca..4bb72e3 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,7 +1,7 @@ # {{ cookiecutter.project_name }} # {{ cookiecutter.description }} # Copyright {{ cookiecutter.year }}, {{ cookiecutter.author }} -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.2) # Find required packages for project find_package(fmt CONFIG REQUIRED) From 6137cb7d5c6d14576bbeb030b473889f9b205df1 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 17 Sep 2020 01:17:28 +0200 Subject: [PATCH 090/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 4bb72e3..3f13b46 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -3,8 +3,7 @@ # Copyright {{ cookiecutter.year }}, {{ cookiecutter.author }} cmake_minimum_required(VERSION 3.2) -# Find required packages for project -find_package(fmt CONFIG REQUIRED) + # can be useful for vim? set(CMAKE_EXPORT_COMPILE_COMMANDS ON) From 00e1e6e237af4e047e38a89028a5abacc6bd257d Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 17 Sep 2020 01:17:42 +0200 Subject: [PATCH 091/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 3f13b46..0e78f70 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -3,8 +3,6 @@ # Copyright {{ cookiecutter.year }}, {{ cookiecutter.author }} cmake_minimum_required(VERSION 3.2) - - # can be useful for vim? set(CMAKE_EXPORT_COMPILE_COMMANDS ON) From a183b4681733d89d110933cd2d47192867a174bb Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 17 Sep 2020 01:33:17 +0200 Subject: [PATCH 092/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 0ce918c..942a3c2 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,3 +1,3 @@ add_library({{cookiecutter.repo_name}}_utils {{cookiecutter.repo_name}}_utils.cpp) add_executable(main main.cpp) -target_link_libraries(main {{cookiecutter.repo_name}}_utils PRIVATE fmt::fmt) +target_link_libraries(main {{cookiecutter.repo_name}}_utils fmt::fmt) From d98b1659260a30b04ea0f68314556513792b8fd4 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 17 Sep 2020 01:35:18 +0200 Subject: [PATCH 093/272] Update main.cpp --- .../src/{{cookiecutter.repo_name}}/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp index f5b426c..980179e 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp @@ -9,4 +9,4 @@ int main() std::cout << message < Date: Thu, 17 Sep 2020 01:38:23 +0200 Subject: [PATCH 094/272] Update main.cpp --- .../src/{{cookiecutter.repo_name}}/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp index 980179e..e640c7b 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp @@ -1,7 +1,7 @@ #include #include <{{cookiecutter.repo_name}}_utils.h> #include //packagemanager downloaded library. -namespace std{ +using namespace std; int main() { @@ -9,4 +9,4 @@ int main() std::cout << message < Date: Thu, 17 Sep 2020 01:40:44 +0200 Subject: [PATCH 095/272] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 17d2b5e..b7ea1dc 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ pmm is a package manager manager. You can configure your project to use Conan or This template was made by combining: An existing Cookiecutter template with https://github.com/hbristow/cookiecutter-cpp with: -A lecture of Igor Bogoslavskyi https://www.youtube.com/watch?v=q8xO2eJijy4&list=PLgnQpQtFTOGR50iIOtO36nK6aNPtVq98C&index=4 +A lecture of Igor Bogoslavskyi https://www.youtube.com/watch?v=q8xO2eJijy4&list=PLgnQpQtFTOGR50iIOtO36nK6aNPtVq98C&index=4 Boilerplate pmm project https://github.com/ariveron/boilerplate-pmm-vcpkg-cmake From 23f96ebac69b0feb2b5e51f5ee5fdfc0ded2e9a8 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 17 Sep 2020 01:41:54 +0200 Subject: [PATCH 096/272] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b7ea1dc..3c9668b 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Doxygen enables documentation. pmm is a package manager manager. You can configure your project to use Conan or VCPKG. This template was made by combining: -An existing Cookiecutter template with https://github.com/hbristow/cookiecutter-cpp with: +Original Cookicutter project https://github.com/hbristow/cookiecutter-cpp with: A lecture of Igor Bogoslavskyi https://www.youtube.com/watch?v=q8xO2eJijy4&list=PLgnQpQtFTOGR50iIOtO36nK6aNPtVq98C&index=4 Boilerplate pmm project https://github.com/ariveron/boilerplate-pmm-vcpkg-cmake From b239d961c0d7ae74d2e1870529bcf7a5f86ebdab Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 17 Sep 2020 01:42:14 +0200 Subject: [PATCH 097/272] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3c9668b..2d651d7 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Doxygen enables documentation. pmm is a package manager manager. You can configure your project to use Conan or VCPKG. This template was made by combining: -Original Cookicutter project https://github.com/hbristow/cookiecutter-cpp with: +Original Cookicutter project https://github.com/hbristow/cookiecutter-cpp A lecture of Igor Bogoslavskyi https://www.youtube.com/watch?v=q8xO2eJijy4&list=PLgnQpQtFTOGR50iIOtO36nK6aNPtVq98C&index=4 Boilerplate pmm project https://github.com/ariveron/boilerplate-pmm-vcpkg-cmake From f1722d71e0b2997be5a45533a7c850afcde13ee0 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sat, 19 Sep 2020 16:33:55 +0200 Subject: [PATCH 098/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 0e78f70..f6dd608 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,3 +1,4 @@ +# TODO: Stick to https://cliutils.gitlab.io/modern-cmake/chapters/intro/dodonot.html # {{ cookiecutter.project_name }} # {{ cookiecutter.description }} # Copyright {{ cookiecutter.year }}, {{ cookiecutter.author }} From fda08a14f09a5b12a063859d47c388d785ef2f22 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sat, 19 Sep 2020 18:02:44 +0200 Subject: [PATCH 099/272] Update main.cpp --- .../src/{{cookiecutter.repo_name}}/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp index e640c7b..c9a378d 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp @@ -7,6 +7,6 @@ int main() { auto message = fmt::format("The answer is {}", sum(1,2)); std::cout << message < Date: Sat, 19 Sep 2020 18:08:26 +0200 Subject: [PATCH 100/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index f6dd608..c7c7d77 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -8,13 +8,13 @@ cmake_minimum_required(VERSION 3.2) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Project -project({{ cookiecutter.project_name }} C CXX) +project({{ cookiecutter.project_name }} + LANGUAGES CXX + VERSION {{ cookiecutter.version }} + ) set(PROJECT_DESCRIPTION "{{ cookiecutter.description }}") set(PROJECT_AUTHOR "{{ cookiecutter.author }}") set(PROJECT_URL "https://github.com/{{ cookiecutter.username }}/{{ cookiecutter.repo_name }}") -set(PROJECT_VERSION_MAJOR "{{ cookiecutter.version.split('.')[0] }}") -set(PROJECT_VERSION_MINOR "{{ cookiecutter.version.split('.')[1] }}") -set(PROJECT_VERSION_PATCH "{{ cookiecutter.version.split('.')[2] }}") # Build flags # Set build type if not set. From 19311c08937dd1e1cab11dfc27217d9ecbed01ac Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sat, 19 Sep 2020 19:45:29 +0200 Subject: [PATCH 101/272] Update main.cpp --- .../src/{{cookiecutter.repo_name}}/main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp index c9a378d..6d7e8fb 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp @@ -1,12 +1,18 @@ #include -#include <{{cookiecutter.repo_name}}_utils.h> +#include #include //packagemanager downloaded library. +#include //system wide installed package. + using namespace std; +using namespace arma; int main() { auto message = fmt::format("The answer is {}", sum(1,2)); std::cout << message <(3,3); + mat b = randu(3,3); + std::cout << v*b << std::endl; return EXIT_SUCCESS; } From 4592076634865ac22ab30dfe73888433590dbc31 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sat, 19 Sep 2020 19:45:46 +0200 Subject: [PATCH 102/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 942a3c2..0ec79fd 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,3 +1,3 @@ -add_library({{cookiecutter.repo_name}}_utils {{cookiecutter.repo_name}}_utils.cpp) +add_library(matrix_example_utils matrix_example_utils.cpp) add_executable(main main.cpp) -target_link_libraries(main {{cookiecutter.repo_name}}_utils fmt::fmt) +target_link_libraries(main matrix_example_utils fmt::fmt ${ARMADILLO_LIBRARIES}) From b928e966665a90fea9bc9f58a969eeae4c332dff Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sat, 19 Sep 2020 19:47:02 +0200 Subject: [PATCH 103/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 26 +++++++++++------------ 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index c7c7d77..380e1fc 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,20 +1,19 @@ -# TODO: Stick to https://cliutils.gitlab.io/modern-cmake/chapters/intro/dodonot.html -# {{ cookiecutter.project_name }} -# {{ cookiecutter.description }} -# Copyright {{ cookiecutter.year }}, {{ cookiecutter.author }} +# matrix_example +# A rock solid project with enforced style, testing and static analysis +# Copyright 2020, First Last cmake_minimum_required(VERSION 3.2) # can be useful for vim? set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Project -project({{ cookiecutter.project_name }} - LANGUAGES CXX - VERSION {{ cookiecutter.version }} - ) -set(PROJECT_DESCRIPTION "{{ cookiecutter.description }}") -set(PROJECT_AUTHOR "{{ cookiecutter.author }}") -set(PROJECT_URL "https://github.com/{{ cookiecutter.username }}/{{ cookiecutter.repo_name }}") +project(matrix_example C CXX) +set(PROJECT_DESCRIPTION "A rock solid project with enforced style, testing and static analysis") +set(PROJECT_AUTHOR "First Last") +set(PROJECT_URL "https://github.com/flast/matrix_example") +set(PROJECT_VERSION_MAJOR "0") +set(PROJECT_VERSION_MINOR "0") +set(PROJECT_VERSION_PATCH "1") # Build flags # Set build type if not set. @@ -25,9 +24,7 @@ set(CMAKE_CXX_FLAGS_DEBUG "-g -O0") set(CMAKE_CXX_FLAGS_RELEASE "-O3") set (CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -march=native") -{% if cookiecutter.pedantic -%} set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -pedantic") -{%- endif %} # Tell cmake to output binaries here: set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Static link libraries @@ -47,13 +44,14 @@ pmm( # Find required packages for project find_package(fmt CONFIG REQUIRED) +find_package(Armadillo REQUIRED) #install it using ubuntu package manager: sudo apt-get install libarmadillo-dev # --------------------------------------------------------- # Features # --------------------------------------------------------- add_subdirectory(external) # Tell cmake where to look for *.h files. -include_directories(${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/src/{{cookiecutter.repo_name}}) +include_directories(${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/src/matrix_example ) # Outsource the actual processing to folders. add_subdirectory(src) # Must be in the top-most CMakeLists.txt file. From 459a131829208a4c66de7f27a2363ec671cb254c Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 14:31:56 +0200 Subject: [PATCH 104/272] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 2d651d7..05a69ba 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ cookiecutter-cpp ================ +Currently works only for Linux compilers, I'm currently changing the CMake scripts to make them compiler independent. + A test-driven C++ project template built on CMake and GoogleTest CMake is a fast and easy build tool. From ba1b4daa08f526bfd4b4d63cb4383fa96b23b5bf Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 18:00:25 +0200 Subject: [PATCH 105/272] update --- {{cookiecutter.repo_name}}/CMakeLists.txt | 29 +++++++++++++---------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 380e1fc..2324925 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,19 +1,20 @@ -# matrix_example -# A rock solid project with enforced style, testing and static analysis -# Copyright 2020, First Last -cmake_minimum_required(VERSION 3.2) +# {{ cookiecutter.project_name }} +# {{ cookiecutter.description }} +# Copyright {{ cookiecutter.year }}, {{ cookiecutter.author }} +cmake_minimum_required (VERSION 3.8.0 FATAL_ERROR) -# can be useful for vim? set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Project -project(matrix_example C CXX) -set(PROJECT_DESCRIPTION "A rock solid project with enforced style, testing and static analysis") -set(PROJECT_AUTHOR "First Last") -set(PROJECT_URL "https://github.com/flast/matrix_example") -set(PROJECT_VERSION_MAJOR "0") -set(PROJECT_VERSION_MINOR "0") -set(PROJECT_VERSION_PATCH "1") + +cmake_minimum_required (VERSION 3.8.0 FATAL_ERROR) +project({{cookiecutter.repo_name}} C CXX) +set(PROJECT_DESCRIPTION "{{ cookiecutter.description }}") +set(PROJECT_AUTHOR "{{ cookiecutter.author }}") +set(PROJECT_URL "https://github.com/{{ cookiecutter.username }}/{{ cookiecutter.repo_name }}") +set(PROJECT_VERSION_MAJOR "{{ cookiecutter.version.split('.')[0] }}") +set(PROJECT_VERSION_MINOR "{{ cookiecutter.version.split('.')[1] }}") +set(PROJECT_VERSION_PATCH "{{ cookiecutter.version.split('.')[2] }}") # Build flags # Set build type if not set. @@ -23,8 +24,12 @@ endif() set(CMAKE_CXX_FLAGS_DEBUG "-g -O0") set(CMAKE_CXX_FLAGS_RELEASE "-O3") set (CMAKE_CXX_STANDARD 11) + +# Build flags set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -march=native") +{% if cookiecutter.pedantic -%} set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -pedantic") +{%- endif %} # Tell cmake to output binaries here: set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Static link libraries From f7b615984d4280edef5545c5e3cb9bc74f021fea Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 18:07:40 +0200 Subject: [PATCH 106/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 2324925..54e8d90 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -6,15 +6,17 @@ cmake_minimum_required (VERSION 3.8.0 FATAL_ERROR) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Project - cmake_minimum_required (VERSION 3.8.0 FATAL_ERROR) -project({{cookiecutter.repo_name}} C CXX) -set(PROJECT_DESCRIPTION "{{ cookiecutter.description }}") -set(PROJECT_AUTHOR "{{ cookiecutter.author }}") -set(PROJECT_URL "https://github.com/{{ cookiecutter.username }}/{{ cookiecutter.repo_name }}") -set(PROJECT_VERSION_MAJOR "{{ cookiecutter.version.split('.')[0] }}") -set(PROJECT_VERSION_MINOR "{{ cookiecutter.version.split('.')[1] }}") -set(PROJECT_VERSION_PATCH "{{ cookiecutter.version.split('.')[2] }}") +project({{cookiecutter.repo_name}} + VERSION {{ cookiecutter.version }} + LANGUAGES CXX + PROJECT_DESCRIPTION "{{ cookiecutter.description }}" + PROJECT_AUTHOR "{{ cookiecutter.author }}" + PROJECT_URL "https://github.com/{{ cookiecutter.username }}/{{ cookiecutter.repo_name }}" +) + +# require C++17 +target_compile_features ({{cookiecutter.repo_name}} INTERFACE cxx_std_17) # Build flags # Set build type if not set. From ab7b534eeceb9d3e023011943ce09c52b2c5ea3e Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 19:07:44 +0200 Subject: [PATCH 107/272] changing to better cmake style - pending --- {{cookiecutter.repo_name}}/CMakeLists.txt | 51 +++++++---------------- 1 file changed, 14 insertions(+), 37 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 54e8d90..549118c 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -23,46 +23,23 @@ target_compile_features ({{cookiecutter.repo_name}} INTERFACE cxx_std_17) if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif() -set(CMAKE_CXX_FLAGS_DEBUG "-g -O0") -set(CMAKE_CXX_FLAGS_RELEASE "-O3") -set (CMAKE_CXX_STANDARD 11) -# Build flags -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -march=native") -{% if cookiecutter.pedantic -%} -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -pedantic") -{%- endif %} +# testing +enable_testing () +option ({{ cookiecutter.project_name }}_BUILD_TESTS "Build test programs" ON) +if ({{ cookiecutter.project_name }}_BUILD_TESTS) + add_subdirectory (test) +endif () -# Tell cmake to output binaries here: -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Static link libraries -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin) # Executables -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Dynamic link libraries +# install and export target +install (TARGETS {{ cookiecutter.project_name }} EXPORT {{ cookiecutter.project_name }}-targets) -# Package manager manager (fmt is just a sample library to test the manager) -include(pmm.cmake) -pmm( - # Use vcpkg - VCPKG - # Specify vcpkg branch, tag, or revision - REVISION master - # Space seperated list of required vcpkg packages - REQUIRES fmt +install (EXPORT {{ cookiecutter.project_name }}-targets + FILE {{ cookiecutter.project_name }}-config.cmake + NAMESPACE {{ cookiecutter.project_name }}:: + DESTINATION ${{{ cookiecutter.project_name }}_INSTALL_CMAKE_DIR} ) -# Find required packages for project -find_package(fmt CONFIG REQUIRED) -find_package(Armadillo REQUIRED) #install it using ubuntu package manager: sudo apt-get install libarmadillo-dev +install (DIRECTORY include/ DESTINATION ${{{ cookiecutter.project_name }}_INSTALL_INCLUDE_DIR}) +install (FILES LICENSE DESTINATION ${{{ cookiecutter.project_name }}_INSTALL_DOC_DIR}) -# --------------------------------------------------------- -# Features -# --------------------------------------------------------- -add_subdirectory(external) -# Tell cmake where to look for *.h files. -include_directories(${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/src/matrix_example ) -# Outsource the actual processing to folders. -add_subdirectory(src) -# Must be in the top-most CMakeLists.txt file. -enable_testing() -# Outsource tests to another folder. -add_subdirectory(test) -add_subdirectory(doc) From 32e273b6905e49c252c54931e44b77d623801ab7 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 19:11:45 +0200 Subject: [PATCH 108/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 549118c..6de56a4 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -36,7 +36,7 @@ install (TARGETS {{ cookiecutter.project_name }} EXPORT {{ cookiecutter.project_ install (EXPORT {{ cookiecutter.project_name }}-targets FILE {{ cookiecutter.project_name }}-config.cmake - NAMESPACE {{ cookiecutter.project_name }}:: + NAMESPACE {{ cookiecutter.project_name }} DESTINATION ${{{ cookiecutter.project_name }}_INSTALL_CMAKE_DIR} ) From e40f4cbcf1102989e0838f1704091781ee29b6e7 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 19:13:23 +0200 Subject: [PATCH 109/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 6de56a4..e880ae9 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -36,7 +36,7 @@ install (TARGETS {{ cookiecutter.project_name }} EXPORT {{ cookiecutter.project_ install (EXPORT {{ cookiecutter.project_name }}-targets FILE {{ cookiecutter.project_name }}-config.cmake - NAMESPACE {{ cookiecutter.project_name }} + NAMESPACE {{ cookiecutter.project_name+'::' }} DESTINATION ${{{ cookiecutter.project_name }}_INSTALL_CMAKE_DIR} ) From fc58a477f2eee85e667d453f7a77a6b47cc58a41 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 19:20:46 +0200 Subject: [PATCH 110/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index e880ae9..33b1338 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -26,20 +26,20 @@ endif() # testing enable_testing () -option ({{ cookiecutter.project_name }}_BUILD_TESTS "Build test programs" ON) -if ({{ cookiecutter.project_name }}_BUILD_TESTS) +option ({{ cookiecutter.project_name|upper }}_BUILD_TESTS "Build test programs" ON) +if ({{ cookiecutter.project_name|upper }}_BUILD_TESTS) add_subdirectory (test) endif () # install and export target -install (TARGETS {{ cookiecutter.project_name }} EXPORT {{ cookiecutter.project_name }}-targets) +install (TARGETS {{ cookiecutter.project_name|lower }} EXPORT {{ cookiecutter.project_name|lower }}-targets) install (EXPORT {{ cookiecutter.project_name }}-targets - FILE {{ cookiecutter.project_name }}-config.cmake - NAMESPACE {{ cookiecutter.project_name+'::' }} - DESTINATION ${{{ cookiecutter.project_name }}_INSTALL_CMAKE_DIR} + FILE {{ cookiecutter.project_name|lower }}-config.cmake + NAMESPACE {{ cookiecutter.project_name|append('::'}} + DESTINATION ${{{ cookiecutter.project_name|upper }}_INSTALL_CMAKE_DIR} ) -install (DIRECTORY include/ DESTINATION ${{{ cookiecutter.project_name }}_INSTALL_INCLUDE_DIR}) -install (FILES LICENSE DESTINATION ${{{ cookiecutter.project_name }}_INSTALL_DOC_DIR}) +install (DIRECTORY include/ DESTINATION ${{{ cookiecutter.project_name|upper }}_INSTALL_INCLUDE_DIR}) +install (FILES LICENSE DESTINATION ${{{ cookiecutter.project_name|upper }}_INSTALL_DOC_DIR}) From e5267da40db5973fb624952d50d76711057adccc Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 19:22:11 +0200 Subject: [PATCH 111/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 33b1338..2888f98 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -36,7 +36,7 @@ install (TARGETS {{ cookiecutter.project_name|lower }} EXPORT {{ cookiecutter.pr install (EXPORT {{ cookiecutter.project_name }}-targets FILE {{ cookiecutter.project_name|lower }}-config.cmake - NAMESPACE {{ cookiecutter.project_name|append('::'}} + NAMESPACE {{ cookiecutter.project_name|append('::' }} DESTINATION ${{{ cookiecutter.project_name|upper }}_INSTALL_CMAKE_DIR} ) From d55550b76f90f66be25547b4e4cae8a5aaef1e09 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 19:22:54 +0200 Subject: [PATCH 112/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 2888f98..844f4b1 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -36,7 +36,7 @@ install (TARGETS {{ cookiecutter.project_name|lower }} EXPORT {{ cookiecutter.pr install (EXPORT {{ cookiecutter.project_name }}-targets FILE {{ cookiecutter.project_name|lower }}-config.cmake - NAMESPACE {{ cookiecutter.project_name|append('::' }} + NAMESPACE {{ cookiecutter.project_name|append('::') }} DESTINATION ${{{ cookiecutter.project_name|upper }}_INSTALL_CMAKE_DIR} ) From 41408ff1908d14c9fec3e8f777cc0ef4a814e77e Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 19:25:54 +0200 Subject: [PATCH 113/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 844f4b1..9f11a73 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -36,7 +36,7 @@ install (TARGETS {{ cookiecutter.project_name|lower }} EXPORT {{ cookiecutter.pr install (EXPORT {{ cookiecutter.project_name }}-targets FILE {{ cookiecutter.project_name|lower }}-config.cmake - NAMESPACE {{ cookiecutter.project_name|append('::') }} + NAMESPACE {{ cookiecutter.project_name|join('::') }} DESTINATION ${{{ cookiecutter.project_name|upper }}_INSTALL_CMAKE_DIR} ) From 0e365aa790583a8a5138de314cbfd03bcb65d80d Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 19:28:30 +0200 Subject: [PATCH 114/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 9f11a73..5f0e50f 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -37,7 +37,7 @@ install (TARGETS {{ cookiecutter.project_name|lower }} EXPORT {{ cookiecutter.pr install (EXPORT {{ cookiecutter.project_name }}-targets FILE {{ cookiecutter.project_name|lower }}-config.cmake NAMESPACE {{ cookiecutter.project_name|join('::') }} - DESTINATION ${{{ cookiecutter.project_name|upper }}_INSTALL_CMAKE_DIR} + DESTINATION ${{{ cookiecutter.project_name|upper|join('_INSTALL_CMAKE_DIR' }}} ) install (DIRECTORY include/ DESTINATION ${{{ cookiecutter.project_name|upper }}_INSTALL_INCLUDE_DIR}) From 8dcb2f571be8f511ced2f53d9c31e84a361c00b5 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 19:29:51 +0200 Subject: [PATCH 115/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 5f0e50f..aacd4fb 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -37,7 +37,9 @@ install (TARGETS {{ cookiecutter.project_name|lower }} EXPORT {{ cookiecutter.pr install (EXPORT {{ cookiecutter.project_name }}-targets FILE {{ cookiecutter.project_name|lower }}-config.cmake NAMESPACE {{ cookiecutter.project_name|join('::') }} - DESTINATION ${{{ cookiecutter.project_name|upper|join('_INSTALL_CMAKE_DIR' }}} + DESTINATION ${ + {{ cookiecutter.project_name|upper|join('_INSTALL_CMAKE_DIR' }} + } ) install (DIRECTORY include/ DESTINATION ${{{ cookiecutter.project_name|upper }}_INSTALL_INCLUDE_DIR}) From a638aa3b5b7c9396caa089a06a49e030f9c1c236 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 19:32:07 +0200 Subject: [PATCH 116/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index aacd4fb..4117ac1 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -37,11 +37,5 @@ install (TARGETS {{ cookiecutter.project_name|lower }} EXPORT {{ cookiecutter.pr install (EXPORT {{ cookiecutter.project_name }}-targets FILE {{ cookiecutter.project_name|lower }}-config.cmake NAMESPACE {{ cookiecutter.project_name|join('::') }} - DESTINATION ${ - {{ cookiecutter.project_name|upper|join('_INSTALL_CMAKE_DIR' }} - } -) - -install (DIRECTORY include/ DESTINATION ${{{ cookiecutter.project_name|upper }}_INSTALL_INCLUDE_DIR}) -install (FILES LICENSE DESTINATION ${{{ cookiecutter.project_name|upper }}_INSTALL_DOC_DIR}) - + DESTINATION TEST + ) From de10851326432bc8ba256423415e314836bef69e Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 19:33:58 +0200 Subject: [PATCH 117/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 4117ac1..b016df5 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -36,6 +36,6 @@ install (TARGETS {{ cookiecutter.project_name|lower }} EXPORT {{ cookiecutter.pr install (EXPORT {{ cookiecutter.project_name }}-targets FILE {{ cookiecutter.project_name|lower }}-config.cmake - NAMESPACE {{ cookiecutter.project_name|join('::') }} + NAMESPACE {{ cookiecutter.project_name|append('::') }} DESTINATION TEST ) From 56ec02799d9b263e51ddf38397414957fb1882b7 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 19:35:19 +0200 Subject: [PATCH 118/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index b016df5..a5ce7eb 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -36,6 +36,6 @@ install (TARGETS {{ cookiecutter.project_name|lower }} EXPORT {{ cookiecutter.pr install (EXPORT {{ cookiecutter.project_name }}-targets FILE {{ cookiecutter.project_name|lower }}-config.cmake - NAMESPACE {{ cookiecutter.project_name|append('::') }} + NAMESPACE {{ cookiecutter.project_name+'::' }} DESTINATION TEST ) From 7c18bf5cbede8bae48af6697196ac38809470e52 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 19:39:52 +0200 Subject: [PATCH 119/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index a5ce7eb..ed538a1 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -37,5 +37,5 @@ install (TARGETS {{ cookiecutter.project_name|lower }} EXPORT {{ cookiecutter.pr install (EXPORT {{ cookiecutter.project_name }}-targets FILE {{ cookiecutter.project_name|lower }}-config.cmake NAMESPACE {{ cookiecutter.project_name+'::' }} - DESTINATION TEST + DESTINATION ${{{ cookiecutter.project_name|upper+('_INSTALL_CMAKE_DIR' }}} ) From 700dc569bac6fb21a934beef3f2a6158b16e338c Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 19:43:11 +0200 Subject: [PATCH 120/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index ed538a1..a56c0f3 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -37,5 +37,5 @@ install (TARGETS {{ cookiecutter.project_name|lower }} EXPORT {{ cookiecutter.pr install (EXPORT {{ cookiecutter.project_name }}-targets FILE {{ cookiecutter.project_name|lower }}-config.cmake NAMESPACE {{ cookiecutter.project_name+'::' }} - DESTINATION ${{{ cookiecutter.project_name|upper+('_INSTALL_CMAKE_DIR' }}} + DESTINATION ${{ "{"+cookiecutter.project_name|upper+('_INSTALL_CMAKE_DIR'+"}" }} ) From 902161b9721230caba3a9700d86493281a0f0476 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 19:45:54 +0200 Subject: [PATCH 121/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index a56c0f3..de8de53 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -37,5 +37,5 @@ install (TARGETS {{ cookiecutter.project_name|lower }} EXPORT {{ cookiecutter.pr install (EXPORT {{ cookiecutter.project_name }}-targets FILE {{ cookiecutter.project_name|lower }}-config.cmake NAMESPACE {{ cookiecutter.project_name+'::' }} - DESTINATION ${{ "{"+cookiecutter.project_name|upper+('_INSTALL_CMAKE_DIR'+"}" }} + DESTINATION ${{ '{'+cookiecutter.project_name|upper+('_INSTALL_CMAKE_DIR}' }} ) From 375394d036ae302b338b63494dafd57674977f25 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 19:48:46 +0200 Subject: [PATCH 122/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index de8de53..e1655b4 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -37,5 +37,5 @@ install (TARGETS {{ cookiecutter.project_name|lower }} EXPORT {{ cookiecutter.pr install (EXPORT {{ cookiecutter.project_name }}-targets FILE {{ cookiecutter.project_name|lower }}-config.cmake NAMESPACE {{ cookiecutter.project_name+'::' }} - DESTINATION ${{ '{'+cookiecutter.project_name|upper+('_INSTALL_CMAKE_DIR}' }} + DESTINATION ${{ '"{"'+cookiecutter.project_name|upper+('_INSTALL_CMAKE_DIR"}"' }} ) From a8f5bd557d5694b747795cb6c4da11169495b971 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 19:55:11 +0200 Subject: [PATCH 123/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index e1655b4..8b30111 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -37,5 +37,5 @@ install (TARGETS {{ cookiecutter.project_name|lower }} EXPORT {{ cookiecutter.pr install (EXPORT {{ cookiecutter.project_name }}-targets FILE {{ cookiecutter.project_name|lower }}-config.cmake NAMESPACE {{ cookiecutter.project_name+'::' }} - DESTINATION ${{ '"{"'+cookiecutter.project_name|upper+('_INSTALL_CMAKE_DIR"}"' }} + DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name|upper+('_INSTALL_CMAKE_DIR' }}{% raw %}}{% endraw %} ) From 8c87ebc6683f84a918a09aa7094cb036e753e0bf Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 19:56:07 +0200 Subject: [PATCH 124/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 8b30111..7b672c7 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -37,5 +37,5 @@ install (TARGETS {{ cookiecutter.project_name|lower }} EXPORT {{ cookiecutter.pr install (EXPORT {{ cookiecutter.project_name }}-targets FILE {{ cookiecutter.project_name|lower }}-config.cmake NAMESPACE {{ cookiecutter.project_name+'::' }} - DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name|upper+('_INSTALL_CMAKE_DIR' }}{% raw %}}{% endraw %} + DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name}}{% raw %}}{% endraw %} ) From d76d016d1f0fb1991aad938c942d5c9e85af9e2d Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 19:58:06 +0200 Subject: [PATCH 125/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 7b672c7..3570195 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -37,5 +37,5 @@ install (TARGETS {{ cookiecutter.project_name|lower }} EXPORT {{ cookiecutter.pr install (EXPORT {{ cookiecutter.project_name }}-targets FILE {{ cookiecutter.project_name|lower }}-config.cmake NAMESPACE {{ cookiecutter.project_name+'::' }} - DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name}}{% raw %}}{% endraw %} + DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name|upper}}{% raw %}(_INSTALL_CMAKE_DIR}{% endraw %} ) From d98686aa2d0d54b0c04427c70429f5aa7bbc96c7 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 19:59:03 +0200 Subject: [PATCH 126/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 3570195..1b3e730 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -37,5 +37,5 @@ install (TARGETS {{ cookiecutter.project_name|lower }} EXPORT {{ cookiecutter.pr install (EXPORT {{ cookiecutter.project_name }}-targets FILE {{ cookiecutter.project_name|lower }}-config.cmake NAMESPACE {{ cookiecutter.project_name+'::' }} - DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name|upper}}{% raw %}(_INSTALL_CMAKE_DIR}{% endraw %} + DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name|upper}}{% raw %}_INSTALL_CMAKE_DIR}{% endraw %} ) From 4cf06373fdf3752c005d2241ea7058fb950a2945 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 20:04:00 +0200 Subject: [PATCH 127/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 1b3e730..9c97763 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -39,3 +39,6 @@ install (EXPORT {{ cookiecutter.project_name }}-targets NAMESPACE {{ cookiecutter.project_name+'::' }} DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name|upper}}{% raw %}_INSTALL_CMAKE_DIR}{% endraw %} ) + +install (DIRECTORY include/ DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name|upper }}{% raw %_INSTALL_INCLUDE_DIR)}{% endraw %} +install (FILES LICENSE DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name|upper }}{% raw %_INSTALL_DOC_DIR)}{% endraw %} From 9bb49a7eeaa9b1bc32aa040e02183e4a57546c26 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 20:04:44 +0200 Subject: [PATCH 128/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 9c97763..f4ede23 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -40,5 +40,5 @@ install (EXPORT {{ cookiecutter.project_name }}-targets DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name|upper}}{% raw %}_INSTALL_CMAKE_DIR}{% endraw %} ) -install (DIRECTORY include/ DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name|upper }}{% raw %_INSTALL_INCLUDE_DIR)}{% endraw %} -install (FILES LICENSE DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name|upper }}{% raw %_INSTALL_DOC_DIR)}{% endraw %} +install (DIRECTORY include/ DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name|upper }}{% raw %}_INSTALL_INCLUDE_DIR)}{% endraw %} +install (FILES LICENSE DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name|upper }}{% raw %}_INSTALL_DOC_DIR)}{% endraw %} From 88758bb0f05f9e6327b10f8ce4e5e4fa1fe6a0cf Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 20:06:17 +0200 Subject: [PATCH 129/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index f4ede23..644493d 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -40,5 +40,5 @@ install (EXPORT {{ cookiecutter.project_name }}-targets DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name|upper}}{% raw %}_INSTALL_CMAKE_DIR}{% endraw %} ) -install (DIRECTORY include/ DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name|upper }}{% raw %}_INSTALL_INCLUDE_DIR)}{% endraw %} -install (FILES LICENSE DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name|upper }}{% raw %}_INSTALL_DOC_DIR)}{% endraw %} +install (DIRECTORY include/ DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name|upper }}{% raw %}_INSTALL_INCLUDE_DIR}){% endraw %} +install (FILES LICENSE DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name|upper }}{% raw %}_INSTALL_DOC_DIR}){% endraw %} From e5bd26e7d1ee5e51e26a207d9d1ee29612444e22 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 20:15:10 +0200 Subject: [PATCH 130/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 644493d..159dc9b 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -3,6 +3,12 @@ # Copyright {{ cookiecutter.year }}, {{ cookiecutter.author }} cmake_minimum_required (VERSION 3.8.0 FATAL_ERROR) +# installation directories +set ({{ cookiecutter.project_name|upper }}_INSTALL_INCLUDE_DIR "include" CACHE STRING "The installation include directory") +set ({{ cookiecutter.project_name|upper }}_INSTALL_DOC_DIR "doc" CACHE STRING "The installation doc directory") +set ({{ cookiecutter.project_name|upper }}_INSTALL_CMAKE_DIR "share/{{ cookiecutter.project_name|lower }}/cmake" CACHE STRING "The installation cmake directory") + +# Make flags for running from an editor set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Project From c83b34fa22591d09b79583bf2ee94f96e6d439cd Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 20:26:43 +0200 Subject: [PATCH 131/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 159dc9b..ea27126 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -24,12 +24,13 @@ project({{cookiecutter.repo_name}} # require C++17 target_compile_features ({{cookiecutter.repo_name}} INTERFACE cxx_std_17) -# Build flags # Set build type if not set. if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif() +add_subdirectory (src/{{ cookiecutter.project_name|upper }}) + # testing enable_testing () option ({{ cookiecutter.project_name|upper }}_BUILD_TESTS "Build test programs" ON) From e9c10857d48bed0b32178fad6309ecba8629400c Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 20:27:19 +0200 Subject: [PATCH 132/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index ea27126..6641bfb 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -29,6 +29,7 @@ if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif() +# Add the project package called {{ cookiecutter.project_name|upper }} add_subdirectory (src/{{ cookiecutter.project_name|upper }}) # testing From 61c957a6ff3535bc04c6f79e26ea197f97a50859 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 20:33:46 +0200 Subject: [PATCH 133/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 6641bfb..40770a4 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -24,6 +24,19 @@ project({{cookiecutter.repo_name}} # require C++17 target_compile_features ({{cookiecutter.repo_name}} INTERFACE cxx_std_17) +# Set compile options +set_target_properties (${exename} PROPERTIES + CXX_STANDARD 11 + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS OFF +) +if (MSVC) + target_compile_options (${exename} PRIVATE /W4 /WX /utf-8) +else () + target_compile_options (${exename} PRIVATE -pedantic -Wall -Wextra -Wshadow -Werror) +endif () + + # Set build type if not set. if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) From 3c28ff2619e01388b82a5fd624d426f8eda73257 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 20:36:16 +0200 Subject: [PATCH 134/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 40770a4..c10a665 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -22,11 +22,11 @@ project({{cookiecutter.repo_name}} ) # require C++17 -target_compile_features ({{cookiecutter.repo_name}} INTERFACE cxx_std_17) +target_compile_features ({{cookiecutter.repo_name}} INTERFACE cxx_std_14) # Set compile options set_target_properties (${exename} PROPERTIES - CXX_STANDARD 11 + CXX_STANDARD 14 CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS OFF ) From 5daaa1fde00eb922edf4223df522ab3a66b529fa Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 20:38:35 +0200 Subject: [PATCH 135/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index c10a665..067828d 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required (VERSION 3.8.0 FATAL_ERROR) # installation directories -set ({{ cookiecutter.project_name|upper }}_INSTALL_INCLUDE_DIR "include" CACHE STRING "The installation include directory") +set ({{ cookiecutter.project_name|upper }}_INSTALL_INCLUDE_DIR "lib" CACHE STRING "The installation include directory") set ({{ cookiecutter.project_name|upper }}_INSTALL_DOC_DIR "doc" CACHE STRING "The installation doc directory") set ({{ cookiecutter.project_name|upper }}_INSTALL_CMAKE_DIR "share/{{ cookiecutter.project_name|lower }}/cmake" CACHE STRING "The installation cmake directory") @@ -61,5 +61,5 @@ install (EXPORT {{ cookiecutter.project_name }}-targets DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name|upper}}{% raw %}_INSTALL_CMAKE_DIR}{% endraw %} ) -install (DIRECTORY include/ DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name|upper }}{% raw %}_INSTALL_INCLUDE_DIR}){% endraw %} +install (DIRECTORY lib/ DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name|upper }}{% raw %}_INSTALL_INCLUDE_DIR}){% endraw %} install (FILES LICENSE DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name|upper }}{% raw %}_INSTALL_DOC_DIR}){% endraw %} From 694c3c30d7f2452ae4ab96078eec9f0145c859ee Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 20:43:33 +0200 Subject: [PATCH 136/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 067828d..8c869dd 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -24,7 +24,15 @@ project({{cookiecutter.repo_name}} # require C++17 target_compile_features ({{cookiecutter.repo_name}} INTERFACE cxx_std_14) +# Set build type if not set. +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release) +endif() + # Set compile options +set(CMAKE_CXX_FLAGS_DEBUG "-g -O0") +set(CMAKE_CXX_FLAGS_RELEASE "-O3") + set_target_properties (${exename} PROPERTIES CXX_STANDARD 14 CXX_STANDARD_REQUIRED ON @@ -36,12 +44,6 @@ else () target_compile_options (${exename} PRIVATE -pedantic -Wall -Wextra -Wshadow -Werror) endif () - -# Set build type if not set. -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE Release) -endif() - # Add the project package called {{ cookiecutter.project_name|upper }} add_subdirectory (src/{{ cookiecutter.project_name|upper }}) From bce76ccc91199c898439349a0e32efa1772826bd Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 20:46:45 +0200 Subject: [PATCH 137/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 8c869dd..4f24aac 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -8,6 +8,10 @@ set ({{ cookiecutter.project_name|upper }}_INSTALL_INCLUDE_DIR "lib" CACHE STRIN set ({{ cookiecutter.project_name|upper }}_INSTALL_DOC_DIR "doc" CACHE STRING "The installation doc directory") set ({{ cookiecutter.project_name|upper }}_INSTALL_CMAKE_DIR "share/{{ cookiecutter.project_name|lower }}/cmake" CACHE STRING "The installation cmake directory") +# set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Static link libraries +# set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin) # Executables +# set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Dynamic link libraries + # Make flags for running from an editor set(CMAKE_EXPORT_COMPILE_COMMANDS ON) @@ -65,3 +69,18 @@ install (EXPORT {{ cookiecutter.project_name }}-targets install (DIRECTORY lib/ DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name|upper }}{% raw %}_INSTALL_INCLUDE_DIR}){% endraw %} install (FILES LICENSE DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name|upper }}{% raw %}_INSTALL_DOC_DIR}){% endraw %} + +# Package manager manager (fmt is just a sample library to test the manager) +include(pmm.cmake) +pmm( + # Use vcpkg + VCPKG + # Specify vcpkg branch, tag, or revision + REVISION master + # Space seperated list of required vcpkg packages + REQUIRES fmt +) + +# Find required packages for project +find_package(fmt CONFIG REQUIRED) +find_package(Armadillo REQUIRED) #install it using ubuntu package manager: sudo apt-get install libarmadillo-dev From 33100026843b3c5c486b0b7fa9659f0cac9be2ae Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 20:48:37 +0200 Subject: [PATCH 138/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 4f24aac..dfe3613 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -58,6 +58,9 @@ if ({{ cookiecutter.project_name|upper }}_BUILD_TESTS) add_subdirectory (test) endif () +# Doxygen documentation +add_subdirectory(doc) + # install and export target install (TARGETS {{ cookiecutter.project_name|lower }} EXPORT {{ cookiecutter.project_name|lower }}-targets) From ace33264326685716f7de17e42d6432ccb9d1cc0 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 20:56:12 +0200 Subject: [PATCH 139/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index dfe3613..8cf362b 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -17,13 +17,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Project cmake_minimum_required (VERSION 3.8.0 FATAL_ERROR) -project({{cookiecutter.repo_name}} - VERSION {{ cookiecutter.version }} - LANGUAGES CXX - PROJECT_DESCRIPTION "{{ cookiecutter.description }}" - PROJECT_AUTHOR "{{ cookiecutter.author }}" - PROJECT_URL "https://github.com/{{ cookiecutter.username }}/{{ cookiecutter.repo_name }}" -) +project({{cookiecutter.repo_name}} VERSION {{ cookiecutter.version }} LANGUAGES CXX PROJECT_DESCRIPTION "{{ cookiecutter.description }}" PROJECT_AUTHOR "{{ cookiecutter.author }}" PROJECT_URL "https://github.com/{{ cookiecutter.username }}/{{ cookiecutter.repo_name }}") # require C++17 target_compile_features ({{cookiecutter.repo_name}} INTERFACE cxx_std_14) From d83649e4f5c9fe101f2ca3af09b2cd168e3b31b4 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 21:00:08 +0200 Subject: [PATCH 140/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 8cf362b..3343cd7 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -16,7 +16,6 @@ set ({{ cookiecutter.project_name|upper }}_INSTALL_CMAKE_DIR "share/{{ cookiecut set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Project -cmake_minimum_required (VERSION 3.8.0 FATAL_ERROR) project({{cookiecutter.repo_name}} VERSION {{ cookiecutter.version }} LANGUAGES CXX PROJECT_DESCRIPTION "{{ cookiecutter.description }}" PROJECT_AUTHOR "{{ cookiecutter.author }}" PROJECT_URL "https://github.com/{{ cookiecutter.username }}/{{ cookiecutter.repo_name }}") # require C++17 From 81fbf8baaf9157a460626f3452c2c6ff0d2a2146 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 21:05:31 +0200 Subject: [PATCH 141/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 3343cd7..cf9a113 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -41,8 +41,8 @@ else () target_compile_options (${exename} PRIVATE -pedantic -Wall -Wextra -Wshadow -Werror) endif () -# Add the project package called {{ cookiecutter.project_name|upper }} -add_subdirectory (src/{{ cookiecutter.project_name|upper }}) +# Add the project package called {{ cookiecutter.project_name }} +add_subdirectory (src/{{ cookiecutter.project_name|lower }}) # testing enable_testing () From f3adbd824376bbd7d33ea3b9a28e5e6efdd56ee7 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 21:06:36 +0200 Subject: [PATCH 142/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index cf9a113..64760f6 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -16,7 +16,7 @@ set ({{ cookiecutter.project_name|upper }}_INSTALL_CMAKE_DIR "share/{{ cookiecut set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Project -project({{cookiecutter.repo_name}} VERSION {{ cookiecutter.version }} LANGUAGES CXX PROJECT_DESCRIPTION "{{ cookiecutter.description }}" PROJECT_AUTHOR "{{ cookiecutter.author }}" PROJECT_URL "https://github.com/{{ cookiecutter.username }}/{{ cookiecutter.repo_name }}") +project({{cookiecutter.repo_name}} VERSION {{ cookiecutter.version }} LANGUAGES CXX) # require C++17 target_compile_features ({{cookiecutter.repo_name}} INTERFACE cxx_std_14) From c03497db8b00bd12798e4785c171bdfe7603fceb Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 21:08:08 +0200 Subject: [PATCH 143/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 64760f6..7165772 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -16,7 +16,10 @@ set ({{ cookiecutter.project_name|upper }}_INSTALL_CMAKE_DIR "share/{{ cookiecut set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Project -project({{cookiecutter.repo_name}} VERSION {{ cookiecutter.version }} LANGUAGES CXX) +project({{cookiecutter.repo_name}} VERSION {{ cookiecutter.version }} LANGUAGES CXX) +set(PROJECT_DESCRIPTION "A rock solid project with enforced style, testing and static analysis") +set(PROJECT_AUTHOR "First Last") +set(PROJECT_URL "https://github.com/flast/matrix_example") # require C++17 target_compile_features ({{cookiecutter.repo_name}} INTERFACE cxx_std_14) From 01ba382baf7c57a71c6c3d8f8a5ee5b551abaaf5 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 21:15:40 +0200 Subject: [PATCH 144/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 7165772..97cd52a 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -22,7 +22,7 @@ set(PROJECT_AUTHOR "First Last") set(PROJECT_URL "https://github.com/flast/matrix_example") # require C++17 -target_compile_features ({{cookiecutter.repo_name}} INTERFACE cxx_std_14) +target_compile_features (main INTERFACE cxx_std_14) #{{cookiecutter.repo_name}} # Set build type if not set. if(NOT CMAKE_BUILD_TYPE) From 2ede19fa68296c4a4edaea1eeb1edfd5ac17ea06 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 21:18:06 +0200 Subject: [PATCH 145/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 0ec79fd..a429ef5 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,3 +1,3 @@ add_library(matrix_example_utils matrix_example_utils.cpp) -add_executable(main main.cpp) +add_executable(${exename} main.cpp) target_link_libraries(main matrix_example_utils fmt::fmt ${ARMADILLO_LIBRARIES}) From 53a0d713d7b054044997dd004c57887db6e27b66 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 21:18:34 +0200 Subject: [PATCH 146/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index a429ef5..61795de 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,3 +1,3 @@ add_library(matrix_example_utils matrix_example_utils.cpp) add_executable(${exename} main.cpp) -target_link_libraries(main matrix_example_utils fmt::fmt ${ARMADILLO_LIBRARIES}) +target_link_libraries(${exename} matrix_example_utils fmt::fmt ${ARMADILLO_LIBRARIES}) From cdf8f56935dd39a5e54065092b9e08d429c1807f Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 21:25:54 +0200 Subject: [PATCH 147/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 97cd52a..97f0240 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -22,28 +22,13 @@ set(PROJECT_AUTHOR "First Last") set(PROJECT_URL "https://github.com/flast/matrix_example") # require C++17 -target_compile_features (main INTERFACE cxx_std_14) #{{cookiecutter.repo_name}} +target_compile_features ({{ cookiecutter.project_name }} INTERFACE cxx_std_14) #{{cookiecutter.repo_name}} # Set build type if not set. if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif() -# Set compile options -set(CMAKE_CXX_FLAGS_DEBUG "-g -O0") -set(CMAKE_CXX_FLAGS_RELEASE "-O3") - -set_target_properties (${exename} PROPERTIES - CXX_STANDARD 14 - CXX_STANDARD_REQUIRED ON - CXX_EXTENSIONS OFF -) -if (MSVC) - target_compile_options (${exename} PRIVATE /W4 /WX /utf-8) -else () - target_compile_options (${exename} PRIVATE -pedantic -Wall -Wextra -Wshadow -Werror) -endif () - # Add the project package called {{ cookiecutter.project_name }} add_subdirectory (src/{{ cookiecutter.project_name|lower }}) From edf1d19a2324ef6c5e7a387645412ac39b8ceabf Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 21:26:55 +0200 Subject: [PATCH 148/272] Update CMakeLists.txt --- .../{{cookiecutter.repo_name}}/CMakeLists.txt | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 61795de..254a9bb 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,3 +1,19 @@ +# Set compile options +set(CMAKE_CXX_FLAGS_DEBUG "-g -O0") +set(CMAKE_CXX_FLAGS_RELEASE "-O3") + +set_target_properties (${exename} PROPERTIES + CXX_STANDARD 14 + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS OFF +) +if (MSVC) + target_compile_options ({{ cookiecutter.project_name }} PRIVATE /W4 /WX /utf-8) +else () + target_compile_options ({{ cookiecutter.project_name }} PRIVATE -pedantic -Wall -Wextra -Wshadow -Werror) +endif () + + add_library(matrix_example_utils matrix_example_utils.cpp) -add_executable(${exename} main.cpp) -target_link_libraries(${exename} matrix_example_utils fmt::fmt ${ARMADILLO_LIBRARIES}) +add_executable({{ cookiecutter.project_name }} main.cpp) +target_link_libraries({{ cookiecutter.project_name }} matrix_example_utils fmt::fmt ${ARMADILLO_LIBRARIES}) From 97fd9c2189bee9a236a511089d8d87add31d0629 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 21:29:46 +0200 Subject: [PATCH 149/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 97f0240..88e35a7 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -21,9 +21,6 @@ set(PROJECT_DESCRIPTION "A rock solid project with enforced style, testing and set(PROJECT_AUTHOR "First Last") set(PROJECT_URL "https://github.com/flast/matrix_example") -# require C++17 -target_compile_features ({{ cookiecutter.project_name }} INTERFACE cxx_std_14) #{{cookiecutter.repo_name}} - # Set build type if not set. if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) From 5024402c5f7ad49928cd2cfc0532b31dd3451b15 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 21:30:35 +0200 Subject: [PATCH 150/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 254a9bb..506ac6b 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -17,3 +17,6 @@ endif () add_library(matrix_example_utils matrix_example_utils.cpp) add_executable({{ cookiecutter.project_name }} main.cpp) target_link_libraries({{ cookiecutter.project_name }} matrix_example_utils fmt::fmt ${ARMADILLO_LIBRARIES}) + +# require C++17 +target_compile_features ({{ cookiecutter.project_name }} INTERFACE cxx_std_14) #{{cookiecutter.repo_name}} From 9ee877af1d66004445afce86fc82a81030a142f2 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 21:31:46 +0200 Subject: [PATCH 151/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 506ac6b..373ce98 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -19,4 +19,4 @@ add_executable({{ cookiecutter.project_name }} main.cpp) target_link_libraries({{ cookiecutter.project_name }} matrix_example_utils fmt::fmt ${ARMADILLO_LIBRARIES}) # require C++17 -target_compile_features ({{ cookiecutter.project_name }} INTERFACE cxx_std_14) #{{cookiecutter.repo_name}} +# target_compile_features ({{ cookiecutter.project_name }} INTERFACE cxx_std_14) #{{cookiecutter.repo_name}} From 914c49d05ca06f37466881f385f4f3d3e853875a Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 21:33:29 +0200 Subject: [PATCH 152/272] Update CMakeLists.txt --- .../{{cookiecutter.repo_name}}/CMakeLists.txt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 373ce98..562537e 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,3 +1,12 @@ + +add_library(matrix_example_utils matrix_example_utils.cpp) +add_executable({{ cookiecutter.project_name }} main.cpp) +target_link_libraries({{ cookiecutter.project_name }} matrix_example_utils fmt::fmt ${ARMADILLO_LIBRARIES}) + +# require C++17 +# target_compile_features ({{ cookiecutter.project_name }} INTERFACE cxx_std_14) #{{cookiecutter.repo_name}} + + # Set compile options set(CMAKE_CXX_FLAGS_DEBUG "-g -O0") set(CMAKE_CXX_FLAGS_RELEASE "-O3") @@ -12,11 +21,3 @@ if (MSVC) else () target_compile_options ({{ cookiecutter.project_name }} PRIVATE -pedantic -Wall -Wextra -Wshadow -Werror) endif () - - -add_library(matrix_example_utils matrix_example_utils.cpp) -add_executable({{ cookiecutter.project_name }} main.cpp) -target_link_libraries({{ cookiecutter.project_name }} matrix_example_utils fmt::fmt ${ARMADILLO_LIBRARIES}) - -# require C++17 -# target_compile_features ({{ cookiecutter.project_name }} INTERFACE cxx_std_14) #{{cookiecutter.repo_name}} From 21515387ed189aa213a431744e5a245250ec23e7 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 21:35:08 +0200 Subject: [PATCH 153/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 562537e..4a750f1 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,7 +1,7 @@ add_library(matrix_example_utils matrix_example_utils.cpp) add_executable({{ cookiecutter.project_name }} main.cpp) -target_link_libraries({{ cookiecutter.project_name }} matrix_example_utils fmt::fmt ${ARMADILLO_LIBRARIES}) +target_link_libraries({{ cookiecutter.project_name }} {{ cookiecutter.project_name }}_utils fmt::fmt ${ARMADILLO_LIBRARIES}) # require C++17 # target_compile_features ({{ cookiecutter.project_name }} INTERFACE cxx_std_14) #{{cookiecutter.repo_name}} From 55671ff89a552eaf75b7a495f753d1e3632f84fb Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 21:36:19 +0200 Subject: [PATCH 154/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 4a750f1..12944f7 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,5 +1,5 @@ -add_library(matrix_example_utils matrix_example_utils.cpp) +add_library({{ cookiecutter.project_name }}_utils {{ cookiecutter.project_name }}_utils.cpp) add_executable({{ cookiecutter.project_name }} main.cpp) target_link_libraries({{ cookiecutter.project_name }} {{ cookiecutter.project_name }}_utils fmt::fmt ${ARMADILLO_LIBRARIES}) From 4d9e7e947c16670ba57ac241673bd8e0e388998c Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 21:38:19 +0200 Subject: [PATCH 155/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 12944f7..efd3ac4 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,6 +1,6 @@ add_library({{ cookiecutter.project_name }}_utils {{ cookiecutter.project_name }}_utils.cpp) -add_executable({{ cookiecutter.project_name }} main.cpp) +add_executable({{ cookiecutter.project_name }} {{ cookiecutter.project_name }}.cpp) target_link_libraries({{ cookiecutter.project_name }} {{ cookiecutter.project_name }}_utils fmt::fmt ${ARMADILLO_LIBRARIES}) # require C++17 From 39f1aec231eb34010fea3d58fa13fea73b304ef4 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 21:38:42 +0200 Subject: [PATCH 156/272] Rename main.cpp to {{ cookiecutter.project_name }}.cpp --- .../{main.cpp => {{ cookiecutter.project_name }}.cpp} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{main.cpp => {{ cookiecutter.project_name }}.cpp} (100%) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp similarity index 100% rename from {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/main.cpp rename to {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp From 05d3e11f8f28977bff00f89416c12f6a9743ffb4 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 21:53:23 +0200 Subject: [PATCH 157/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index efd3ac4..269cf23 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,7 +1,7 @@ - +set (exename "{{ cookiecutter.project_name }}") add_library({{ cookiecutter.project_name }}_utils {{ cookiecutter.project_name }}_utils.cpp) -add_executable({{ cookiecutter.project_name }} {{ cookiecutter.project_name }}.cpp) -target_link_libraries({{ cookiecutter.project_name }} {{ cookiecutter.project_name }}_utils fmt::fmt ${ARMADILLO_LIBRARIES}) +add_executable(${exename} {{ cookiecutter.project_name }}.cpp) +target_link_libraries(${exename} {{ cookiecutter.project_name }}_utils fmt::fmt ${ARMADILLO_LIBRARIES}) # require C++17 # target_compile_features ({{ cookiecutter.project_name }} INTERFACE cxx_std_14) #{{cookiecutter.repo_name}} @@ -17,7 +17,7 @@ set_target_properties (${exename} PROPERTIES CXX_EXTENSIONS OFF ) if (MSVC) - target_compile_options ({{ cookiecutter.project_name }} PRIVATE /W4 /WX /utf-8) + target_compile_options (${exename}} PRIVATE /W4 /WX /utf-8) else () - target_compile_options ({{ cookiecutter.project_name }} PRIVATE -pedantic -Wall -Wextra -Wshadow -Werror) + target_compile_options (${exename} PRIVATE -pedantic -Wall -Wextra -Wshadow -Werror) endif () From d6544bfdc6c3fb4ad1645a4c6a31c917a9f5b0f9 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 21:57:41 +0200 Subject: [PATCH 158/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 269cf23..8e4815c 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,12 +1,9 @@ set (exename "{{ cookiecutter.project_name }}") add_library({{ cookiecutter.project_name }}_utils {{ cookiecutter.project_name }}_utils.cpp) add_executable(${exename} {{ cookiecutter.project_name }}.cpp) +target_compile_features ({{ cookiecutter.project_name }}_utils INTERFACE cxx_std_14) target_link_libraries(${exename} {{ cookiecutter.project_name }}_utils fmt::fmt ${ARMADILLO_LIBRARIES}) -# require C++17 -# target_compile_features ({{ cookiecutter.project_name }} INTERFACE cxx_std_14) #{{cookiecutter.repo_name}} - - # Set compile options set(CMAKE_CXX_FLAGS_DEBUG "-g -O0") set(CMAKE_CXX_FLAGS_RELEASE "-O3") From 08ecc354293294e9a6c122e2ecdb1e3d41877dc5 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 22:05:50 +0200 Subject: [PATCH 159/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 8e4815c..491ec5d 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,3 +1,4 @@ +set(CMAKE_INCLUDE_CURRENT_DIR ON) set (exename "{{ cookiecutter.project_name }}") add_library({{ cookiecutter.project_name }}_utils {{ cookiecutter.project_name }}_utils.cpp) add_executable(${exename} {{ cookiecutter.project_name }}.cpp) From 488949a6148849f026b3f2445a70e165a0857b57 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 22:12:52 +0200 Subject: [PATCH 160/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 491ec5d..4ec578c 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,4 +1,4 @@ -set(CMAKE_INCLUDE_CURRENT_DIR ON) +# set(CMAKE_INCLUDE_CURRENT_DIR ON) set (exename "{{ cookiecutter.project_name }}") add_library({{ cookiecutter.project_name }}_utils {{ cookiecutter.project_name }}_utils.cpp) add_executable(${exename} {{ cookiecutter.project_name }}.cpp) From 18f30144055cfd4e27643f2bace7de41cdde60e7 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 20 Sep 2020 22:17:04 +0200 Subject: [PATCH 161/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 88e35a7..87c4f66 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -8,9 +8,9 @@ set ({{ cookiecutter.project_name|upper }}_INSTALL_INCLUDE_DIR "lib" CACHE STRIN set ({{ cookiecutter.project_name|upper }}_INSTALL_DOC_DIR "doc" CACHE STRING "The installation doc directory") set ({{ cookiecutter.project_name|upper }}_INSTALL_CMAKE_DIR "share/{{ cookiecutter.project_name|lower }}/cmake" CACHE STRING "The installation cmake directory") -# set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Static link libraries -# set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin) # Executables -# set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Dynamic link libraries +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Static link libraries +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin) # Executables +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Dynamic link libraries # Make flags for running from an editor set(CMAKE_EXPORT_COMPILE_COMMANDS ON) From ffde76d152b44139fafa7e43df5225de66bf20be Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 21 Sep 2020 09:58:45 +0200 Subject: [PATCH 162/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 87c4f66..3d27500 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -23,7 +23,7 @@ set(PROJECT_URL "https://github.com/flast/matrix_example") # Set build type if not set. if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE Release) + set(CMAKE_BUILD_TYPE Debug CACHE STRING "Build type" FORCE) endif() # Add the project package called {{ cookiecutter.project_name }} From 3ccfae16634ae9ad1b1da72335e98b2ae52fb93b Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 21 Sep 2020 10:37:30 +0200 Subject: [PATCH 163/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 3d27500..6737372 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -3,6 +3,22 @@ # Copyright {{ cookiecutter.year }}, {{ cookiecutter.author }} cmake_minimum_required (VERSION 3.8.0 FATAL_ERROR) +# Check compiler support for vectorization +include(CheckCXXCompilerFlag) +check_cxx_compiler_flag("-march=native" _march_native_works) +check_cxx_compiler_flag("-xHost" _xhost_works) + +set(_CXX_FLAGS) +if(_march_native_works) + message(STATUS "Using processor's vector instructions (-march=native compiler flag set)") + set(_CXX_FLAGS "-march=native") +elseif(_xhost_works) + message(STATUS "Using processor's vector instructions (-xHost compiler flag set)") + set(_CXX_FLAGS "-xHost") +else() + message(STATUS "No suitable compiler flag found for vectorization") +endif() + # installation directories set ({{ cookiecutter.project_name|upper }}_INSTALL_INCLUDE_DIR "lib" CACHE STRING "The installation include directory") set ({{ cookiecutter.project_name|upper }}_INSTALL_DOC_DIR "doc" CACHE STRING "The installation doc directory") From 96799fed7f357e9fd56b318f70dd4911b14315a4 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 21 Sep 2020 10:39:05 +0200 Subject: [PATCH 164/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 4ec578c..640268f 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -3,6 +3,11 @@ set (exename "{{ cookiecutter.project_name }}") add_library({{ cookiecutter.project_name }}_utils {{ cookiecutter.project_name }}_utils.cpp) add_executable(${exename} {{ cookiecutter.project_name }}.cpp) target_compile_features ({{ cookiecutter.project_name }}_utils INTERFACE cxx_std_14) + +target_compile_options(${exename} + PRIVATE + ${_CXX_FLAGS} + ) target_link_libraries(${exename} {{ cookiecutter.project_name }}_utils fmt::fmt ${ARMADILLO_LIBRARIES}) # Set compile options From 3c575f68317ade30b17c7d5c075aec421d0bc209 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 21 Sep 2020 10:40:33 +0200 Subject: [PATCH 165/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 640268f..ff78fd9 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -8,7 +8,7 @@ target_compile_options(${exename} PRIVATE ${_CXX_FLAGS} ) -target_link_libraries(${exename} {{ cookiecutter.project_name }}_utils fmt::fmt ${ARMADILLO_LIBRARIES}) +target_link_libraries(${exename} {{ cookiecutter.project_name }}_utils PRIVATE fmt::fmt ${ARMADILLO_LIBRARIES}) # Set compile options set(CMAKE_CXX_FLAGS_DEBUG "-g -O0") From c023a937f4b4be3d9db95b03b2940afb3754bd3d Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 21 Sep 2020 10:41:19 +0200 Subject: [PATCH 166/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index ff78fd9..e7c836b 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -8,7 +8,6 @@ target_compile_options(${exename} PRIVATE ${_CXX_FLAGS} ) -target_link_libraries(${exename} {{ cookiecutter.project_name }}_utils PRIVATE fmt::fmt ${ARMADILLO_LIBRARIES}) # Set compile options set(CMAKE_CXX_FLAGS_DEBUG "-g -O0") @@ -24,3 +23,5 @@ if (MSVC) else () target_compile_options (${exename} PRIVATE -pedantic -Wall -Wextra -Wshadow -Werror) endif () + +target_link_libraries(${exename} {{ cookiecutter.project_name }}_utils PRIVATE fmt::fmt ${ARMADILLO_LIBRARIES}) From 03c43b31e76fd92756f63c36e5df5d50ab96fc35 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 21 Sep 2020 10:44:12 +0200 Subject: [PATCH 167/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index e7c836b..5d1d13a 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -24,4 +24,4 @@ else () target_compile_options (${exename} PRIVATE -pedantic -Wall -Wextra -Wshadow -Werror) endif () -target_link_libraries(${exename} {{ cookiecutter.project_name }}_utils PRIVATE fmt::fmt ${ARMADILLO_LIBRARIES}) +target_link_libraries(${exename} {{ cookiecutter.project_name }}_utils fmt::fmt ${ARMADILLO_LIBRARIES}) From b805dd7352d75a75bd5f6d629d9d15c6cfad2d4e Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 21 Sep 2020 10:47:08 +0200 Subject: [PATCH 168/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 6737372..cd35bc3 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -8,17 +8,6 @@ include(CheckCXXCompilerFlag) check_cxx_compiler_flag("-march=native" _march_native_works) check_cxx_compiler_flag("-xHost" _xhost_works) -set(_CXX_FLAGS) -if(_march_native_works) - message(STATUS "Using processor's vector instructions (-march=native compiler flag set)") - set(_CXX_FLAGS "-march=native") -elseif(_xhost_works) - message(STATUS "Using processor's vector instructions (-xHost compiler flag set)") - set(_CXX_FLAGS "-xHost") -else() - message(STATUS "No suitable compiler flag found for vectorization") -endif() - # installation directories set ({{ cookiecutter.project_name|upper }}_INSTALL_INCLUDE_DIR "lib" CACHE STRING "The installation include directory") set ({{ cookiecutter.project_name|upper }}_INSTALL_DOC_DIR "doc" CACHE STRING "The installation doc directory") From 23d9997327ae4c6eabd51f8b5355960ad549f663 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 21 Sep 2020 10:49:43 +0200 Subject: [PATCH 169/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index cd35bc3..d29c852 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -4,9 +4,9 @@ cmake_minimum_required (VERSION 3.8.0 FATAL_ERROR) # Check compiler support for vectorization -include(CheckCXXCompilerFlag) -check_cxx_compiler_flag("-march=native" _march_native_works) -check_cxx_compiler_flag("-xHost" _xhost_works) +# include(CheckCXXCompilerFlag) +# check_cxx_compiler_flag("-march=native" _march_native_works) +# check_cxx_compiler_flag("-xHost" _xhost_works) # installation directories set ({{ cookiecutter.project_name|upper }}_INSTALL_INCLUDE_DIR "lib" CACHE STRING "The installation include directory") From 94d06d60a4d7cc0ca636688adbeca9876e021398 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 21 Sep 2020 13:09:27 +0200 Subject: [PATCH 170/272] Update {{ cookiecutter.project_name }}.cpp --- .../{{ cookiecutter.project_name }}.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp index 6d7e8fb..bc92ba8 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp @@ -1,5 +1,5 @@ #include -#include +#include {{ cookiecutter.project_name }}_utils.h> #include //packagemanager downloaded library. #include //system wide installed package. From 9bae8917a2e66b5e4e116a5f0558d159d3e3df9f Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 21 Sep 2020 20:39:55 +0200 Subject: [PATCH 171/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 5d1d13a..47b4f12 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -24,4 +24,9 @@ else () target_compile_options (${exename} PRIVATE -pedantic -Wall -Wextra -Wshadow -Werror) endif () -target_link_libraries(${exename} {{ cookiecutter.project_name }}_utils fmt::fmt ${ARMADILLO_LIBRARIES}) +target_link_libraries(${exename} + PRIVATE + {{ cookiecutter.project_name }}_utils + fmt::fmt + ${ARMADILLO_LIBRARIES} + ) From fd965debb8b89e95e87b3f19b97268b4495a79a9 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 21 Sep 2020 20:40:29 +0200 Subject: [PATCH 172/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index d29c852..fa2a32d 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -13,9 +13,13 @@ set ({{ cookiecutter.project_name|upper }}_INSTALL_INCLUDE_DIR "lib" CACHE STRIN set ({{ cookiecutter.project_name|upper }}_INSTALL_DOC_DIR "doc" CACHE STRING "The installation doc directory") set ({{ cookiecutter.project_name|upper }}_INSTALL_CMAKE_DIR "share/{{ cookiecutter.project_name|lower }}/cmake" CACHE STRING "The installation cmake directory") -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Static link libraries -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin) # Executables -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Dynamic link libraries +# set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Static link libraries +# set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin) # Executables +# set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Dynamic link libraries + +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}) # Make flags for running from an editor set(CMAKE_EXPORT_COMPILE_COMMANDS ON) From 529be9a258a6afd7b75d31117b3e7a31dee8763b Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 21 Sep 2020 20:44:29 +0200 Subject: [PATCH 173/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index fa2a32d..6747b28 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -38,6 +38,9 @@ endif() # Add the project package called {{ cookiecutter.project_name }} add_subdirectory (src/{{ cookiecutter.project_name|lower }}) +# add external +add_subdirectory(external) + # testing enable_testing () option ({{ cookiecutter.project_name|upper }}_BUILD_TESTS "Build test programs" ON) From 04c215d98d56919d601426b28de78f5a98301cca Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 21 Sep 2020 20:44:57 +0200 Subject: [PATCH 174/272] Update CMakeLists.txt From 9f9fcc5b986f87cf309c459449ca041401441d3f Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 21 Sep 2020 21:07:26 +0200 Subject: [PATCH 175/272] test dit maar eventjes --- {{cookiecutter.repo_name}}/CMakeLists.txt | 31 ++++++++++++++++++----- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 6747b28..fcf8860 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -9,17 +9,28 @@ cmake_minimum_required (VERSION 3.8.0 FATAL_ERROR) # check_cxx_compiler_flag("-xHost" _xhost_works) # installation directories -set ({{ cookiecutter.project_name|upper }}_INSTALL_INCLUDE_DIR "lib" CACHE STRING "The installation include directory") -set ({{ cookiecutter.project_name|upper }}_INSTALL_DOC_DIR "doc" CACHE STRING "The installation doc directory") -set ({{ cookiecutter.project_name|upper }}_INSTALL_CMAKE_DIR "share/{{ cookiecutter.project_name|lower }}/cmake" CACHE STRING "The installation cmake directory") +# set ({{ cookiecutter.project_name|upper }}_INSTALL_INCLUDE_DIR "lib" CACHE STRING "The installation include directory") +# set ({{ cookiecutter.project_name|upper }}_INSTALL_DOC_DIR "doc" CACHE STRING "The installation doc directory") +# set ({{ cookiecutter.project_name|upper }}_INSTALL_CMAKE_DIR "share/{{ cookiecutter.project_name|lower }}/cmake" CACHE STRING "The installation cmake directory") # set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Static link libraries # set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin) # Executables # set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Dynamic link libraries -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}) +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}) + +# Offer the user the choice of overriding the installation directories +set(INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR} CACHE PATH "Installation directory for libraries") +set(INSTALL_BINDIR ${CMAKE_INSTALL_BINDIR} CACHE PATH "Installation directory for executables") +set(INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR} CACHE PATH "Installation directory for header files") +if(WIN32 AND NOT CYGWIN) + set(DEF_INSTALL_CMAKEDIR CMake) +else() + set(DEF_INSTALL_CMAKEDIR share/cmake/${PROJECT_NAME}) +endif() +set(INSTALL_CMAKEDIR ${DEF_INSTALL_CMAKEDIR} CACHE PATH "Installation directory for CMake files") # Make flags for running from an editor set(CMAKE_EXPORT_COMPILE_COMMANDS ON) @@ -30,11 +41,19 @@ set(PROJECT_DESCRIPTION "A rock solid project with enforced style, testing and set(PROJECT_AUTHOR "First Last") set(PROJECT_URL "https://github.com/flast/matrix_example") +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +message(STATUS "Project will be installed to ${CMAKE_INSTALL_PREFIX}") + # Set build type if not set. if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Debug CACHE STRING "Build type" FORCE) endif() +message(STATUS "Build type set to ${CMAKE_BUILD_TYPE}") + # Add the project package called {{ cookiecutter.project_name }} add_subdirectory (src/{{ cookiecutter.project_name|lower }}) From 793334e9a35173eb5bdbe686155e6062c1311b06 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 21 Sep 2020 21:12:03 +0200 Subject: [PATCH 176/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index fcf8860..07c9b43 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -9,9 +9,9 @@ cmake_minimum_required (VERSION 3.8.0 FATAL_ERROR) # check_cxx_compiler_flag("-xHost" _xhost_works) # installation directories -# set ({{ cookiecutter.project_name|upper }}_INSTALL_INCLUDE_DIR "lib" CACHE STRING "The installation include directory") -# set ({{ cookiecutter.project_name|upper }}_INSTALL_DOC_DIR "doc" CACHE STRING "The installation doc directory") -# set ({{ cookiecutter.project_name|upper }}_INSTALL_CMAKE_DIR "share/{{ cookiecutter.project_name|lower }}/cmake" CACHE STRING "The installation cmake directory") +set ({{ cookiecutter.project_name|upper }}_INSTALL_INCLUDE_DIR "lib" CACHE STRING "The installation include directory") +set ({{ cookiecutter.project_name|upper }}_INSTALL_DOC_DIR "doc" CACHE STRING "The installation doc directory") +set ({{ cookiecutter.project_name|upper }}_INSTALL_CMAKE_DIR "share/{{ cookiecutter.project_name|lower }}/cmake" CACHE STRING "The installation cmake directory") # set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Static link libraries # set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin) # Executables From d950303856198c7ec895eca686a965b2c60f3f56 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Mon, 21 Sep 2020 21:14:27 +0200 Subject: [PATCH 177/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 47b4f12..2c48d16 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -27,6 +27,6 @@ endif () target_link_libraries(${exename} PRIVATE {{ cookiecutter.project_name }}_utils - fmt::fmt + fmt ${ARMADILLO_LIBRARIES} ) From 8e4b00cbdc37cca84a10cd93f8100920d40896a3 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 23 Sep 2020 15:10:38 +0200 Subject: [PATCH 178/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 2c48d16..0f99063 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -19,11 +19,23 @@ set_target_properties (${exename} PROPERTIES CXX_EXTENSIONS OFF ) if (MSVC) - target_compile_options (${exename}} PRIVATE /W4 /WX /utf-8) + target_compile_options (${exename} PRIVATE /W4 /WX /utf-8) else () target_compile_options (${exename} PRIVATE -pedantic -Wall -Wextra -Wshadow -Werror) endif () +set_target_properties ({{ cookiecutter.project_name }}_utils PROPERTIES + CXX_STANDARD 14 + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS OFF +) +if (MSVC) + target_compile_options ({{ cookiecutter.project_name }}_utils PRIVATE /W4 /WX /utf-8) +else () + target_compile_options ({{ cookiecutter.project_name }}_utils PRIVATE -pedantic -Wall -Wextra -Wshadow -Werror) +endif () + + target_link_libraries(${exename} PRIVATE {{ cookiecutter.project_name }}_utils From 62f171d117702ab52a236154e05eeabe21f857b9 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 23 Sep 2020 19:12:39 +0200 Subject: [PATCH 179/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 156 ++++++++++++---------- 1 file changed, 83 insertions(+), 73 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 07c9b43..baa640e 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,98 +1,108 @@ -# {{ cookiecutter.project_name }} -# {{ cookiecutter.description }} -# Copyright {{ cookiecutter.year }}, {{ cookiecutter.author }} -cmake_minimum_required (VERSION 3.8.0 FATAL_ERROR) +# {{cookiecutter.project_name}} +# A rock solid project with enforced style, testing and static analysis +# Copyright 2020, First Last +cmake_minimum_required(VERSION 3.8 FATAL_ERROR) -# Check compiler support for vectorization -# include(CheckCXXCompilerFlag) -# check_cxx_compiler_flag("-march=native" _march_native_works) -# check_cxx_compiler_flag("-xHost" _xhost_works) - -# installation directories -set ({{ cookiecutter.project_name|upper }}_INSTALL_INCLUDE_DIR "lib" CACHE STRING "The installation include directory") -set ({{ cookiecutter.project_name|upper }}_INSTALL_DOC_DIR "doc" CACHE STRING "The installation doc directory") -set ({{ cookiecutter.project_name|upper }}_INSTALL_CMAKE_DIR "share/{{ cookiecutter.project_name|lower }}/cmake" CACHE STRING "The installation cmake directory") - -# set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Static link libraries -# set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin) # Executables -# set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Dynamic link libraries - -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}) - -# Offer the user the choice of overriding the installation directories -set(INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR} CACHE PATH "Installation directory for libraries") -set(INSTALL_BINDIR ${CMAKE_INSTALL_BINDIR} CACHE PATH "Installation directory for executables") -set(INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR} CACHE PATH "Installation directory for header files") -if(WIN32 AND NOT CYGWIN) - set(DEF_INSTALL_CMAKEDIR CMake) -else() - set(DEF_INSTALL_CMAKEDIR share/cmake/${PROJECT_NAME}) -endif() -set(INSTALL_CMAKEDIR ${DEF_INSTALL_CMAKEDIR} CACHE PATH "Installation directory for CMake files") - -# Make flags for running from an editor +# Can be useful for vim? set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Project +project({{cookiecutter.project_name}} C CXX) project({{cookiecutter.repo_name}} VERSION {{ cookiecutter.version }} LANGUAGES CXX) set(PROJECT_DESCRIPTION "A rock solid project with enforced style, testing and static analysis") set(PROJECT_AUTHOR "First Last") -set(PROJECT_URL "https://github.com/flast/matrix_example") +set(PROJECT_URL "https://github.com/flast/{{cookiecutter.project_name}}") -set(CMAKE_CXX_STANDARD 14) -set(CMAKE_CXX_EXTENSIONS OFF) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -message(STATUS "Project will be installed to ${CMAKE_INSTALL_PREFIX}") - -# Set build type if not set. +# Build flags if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE Debug CACHE STRING "Build type" FORCE) + set(CMAKE_BUILD_TYPE Debug) endif() -message(STATUS "Build type set to ${CMAKE_BUILD_TYPE}") - -# Add the project package called {{ cookiecutter.project_name }} -add_subdirectory (src/{{ cookiecutter.project_name|lower }}) - -# add external -add_subdirectory(external) +set (CMAKE_CXX_STANDARD 14) -# testing -enable_testing () -option ({{ cookiecutter.project_name|upper }}_BUILD_TESTS "Build test programs" ON) -if ({{ cookiecutter.project_name|upper }}_BUILD_TESTS) - add_subdirectory (test) +if (MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /WX /utf-8") +else () + set(CMAKE_CXX_FLAGS_DEBUG "-g -O0") + set(CMAKE_CXX_FLAGS_RELEASE "-O3") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -march=native") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -pedantic") endif () -# Doxygen documentation -add_subdirectory(doc) - -# install and export target -install (TARGETS {{ cookiecutter.project_name|lower }} EXPORT {{ cookiecutter.project_name|lower }}-targets) - -install (EXPORT {{ cookiecutter.project_name }}-targets - FILE {{ cookiecutter.project_name|lower }}-config.cmake - NAMESPACE {{ cookiecutter.project_name+'::' }} - DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name|upper}}{% raw %}_INSTALL_CMAKE_DIR}{% endraw %} - ) - -install (DIRECTORY lib/ DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name|upper }}{% raw %}_INSTALL_INCLUDE_DIR}){% endraw %} -install (FILES LICENSE DESTINATION ${% raw %}{{% endraw %}{{ cookiecutter.project_name|upper }}{% raw %}_INSTALL_DOC_DIR}){% endraw %} - +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORYCMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}) # Package manager manager (fmt is just a sample library to test the manager) include(pmm.cmake) + +# In the case of a Microsoft system, all packages should be installed by VCPKG, for UNIX systems, the user has to install the required packages using their system package manager. +if (MSVC) + set(PMM_PACKAGES "fmt Armadillo") +else () + set(PMM_PACKAGES "fmt") + #sudo apt-get install libarmadillo-dev (VCPKG version is broken) +endif () pmm( # Use vcpkg VCPKG # Specify vcpkg branch, tag, or revision REVISION master # Space seperated list of required vcpkg packages - REQUIRES fmt + REQUIRES ${PMM_PACKAGES} ) -# Find required packages for project +# Find required packages for project, these are the cmake targets reported by vcpkg. find_package(fmt CONFIG REQUIRED) -find_package(Armadillo REQUIRED) #install it using ubuntu package manager: sudo apt-get install libarmadillo-dev +find_package(Armadillo REQUIRED) + +add_subdirectory(external) +# Tell cmake where to look for *.h files. +include_directories(${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/src/{{cookiecutter.project_name}} ) +# Outsource the actual processing to folders. +add_subdirectory(src) +# Must be in the top-most CMakeLists.txt file. +enable_testing() +# Outsource tests to another folder. +add_subdirectory(test) +add_subdirectory(doc) + +# Prepare RPATH +if (NOT MSVC) + set(CMAKE_INSTALL_PREFIX "/home/user/.local") #We don't want to install to the default /usr/local. +endif () +file(RELATIVE_PATH _rel ${CMAKE_INSTALL_PREFIX}/${INSTALL_BINDIR} ${CMAKE_INSTALL_PREFIX}) +if(APPLE) + set(_rpath "@loader_path/${_rel}") +else() + set(_rpath "\$ORIGIN/${_rel}") +endif() +file(TO_NATIVE_PATH "${_rpath}/${INSTALL_LIBDIR}" message_RPATH) + +set_target_properties({{cookiecutter.project_name}} + PROPERTIES + MACOSX_RPATH ON + SKIP_BUILD_RPATH OFF + BUILD_WITH_INSTALL_RPATH OFF + INSTALL_RPATH "${message_RPATH}" + INSTALL_RPATH_USE_LINK_PATH ON + ) + +# Here you can select the binaries and libraries that have to be installed to the system. +message(STATUS "Project will be installed to ${CMAKE_INSTALL_PREFIX}, admin rights may be required to make install") +install( + TARGETS + {{cookiecutter.project_name}}_utils + {{cookiecutter.project_name}} + ARCHIVE + DESTINATION ${INSTALL_LIBDIR} + COMPONENT lib + RUNTIME + DESTINATION ${INSTALL_BINDIR} + COMPONENT bin + LIBRARY + DESTINATION ${INSTALL_LIBDIR} + COMPONENT lib + PUBLIC_HEADER + DESTINATION ${INSTALL_INCLUDEDIR}/{{cookiecutter.project_name}}_utils + COMPONENT dev + ) From d9e5f2b79fb44148bf204d0b9ff92a4e6fa2aa2d Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 23 Sep 2020 19:13:36 +0200 Subject: [PATCH 180/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index baa640e..c7ef94d 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -91,7 +91,7 @@ set_target_properties({{cookiecutter.project_name}} message(STATUS "Project will be installed to ${CMAKE_INSTALL_PREFIX}, admin rights may be required to make install") install( TARGETS - {{cookiecutter.project_name}}_utils + {{cookiecutter.project_name}}Utils {{cookiecutter.project_name}} ARCHIVE DESTINATION ${INSTALL_LIBDIR} @@ -103,6 +103,6 @@ install( DESTINATION ${INSTALL_LIBDIR} COMPONENT lib PUBLIC_HEADER - DESTINATION ${INSTALL_INCLUDEDIR}/{{cookiecutter.project_name}}_utils + DESTINATION ${INSTALL_INCLUDEDIR}/{{cookiecutter.project_name}}Utils COMPONENT dev ) From 721ce27a024b28cd8a379cd816deedafeda101e7 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 23 Sep 2020 19:16:34 +0200 Subject: [PATCH 181/272] Update CMakeLists.txt --- .../{{cookiecutter.repo_name}}/CMakeLists.txt | 47 ++----------------- 1 file changed, 3 insertions(+), 44 deletions(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 0f99063..1abb035 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,44 +1,3 @@ -# set(CMAKE_INCLUDE_CURRENT_DIR ON) -set (exename "{{ cookiecutter.project_name }}") -add_library({{ cookiecutter.project_name }}_utils {{ cookiecutter.project_name }}_utils.cpp) -add_executable(${exename} {{ cookiecutter.project_name }}.cpp) -target_compile_features ({{ cookiecutter.project_name }}_utils INTERFACE cxx_std_14) - -target_compile_options(${exename} - PRIVATE - ${_CXX_FLAGS} - ) - -# Set compile options -set(CMAKE_CXX_FLAGS_DEBUG "-g -O0") -set(CMAKE_CXX_FLAGS_RELEASE "-O3") - -set_target_properties (${exename} PROPERTIES - CXX_STANDARD 14 - CXX_STANDARD_REQUIRED ON - CXX_EXTENSIONS OFF -) -if (MSVC) - target_compile_options (${exename} PRIVATE /W4 /WX /utf-8) -else () - target_compile_options (${exename} PRIVATE -pedantic -Wall -Wextra -Wshadow -Werror) -endif () - -set_target_properties ({{ cookiecutter.project_name }}_utils PROPERTIES - CXX_STANDARD 14 - CXX_STANDARD_REQUIRED ON - CXX_EXTENSIONS OFF -) -if (MSVC) - target_compile_options ({{ cookiecutter.project_name }}_utils PRIVATE /W4 /WX /utf-8) -else () - target_compile_options ({{ cookiecutter.project_name }}_utils PRIVATE -pedantic -Wall -Wextra -Wshadow -Werror) -endif () - - -target_link_libraries(${exename} - PRIVATE - {{ cookiecutter.project_name }}_utils - fmt - ${ARMADILLO_LIBRARIES} - ) +add_library({{cookiecutter.repo_name}}Utils STATIC {{cookiecutter.repo_name}}Utils.cpp) +add_executable({{cookiecutter.repo_name}} {{cookiecutter.repo_name}}.cpp) +target_link_libraries({{cookiecutter.repo_name}} {{cookiecutter.repo_name}}Utils fmt::fmt ${ARMADILLO_LIBRARIES}) From 2c39c9dce19c00b8dfa37fcafddedfa949ab1e6b Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 23 Sep 2020 19:19:50 +0200 Subject: [PATCH 182/272] Update {{cookiecutter.repo_name}}_utils.cpp --- .../{{cookiecutter.repo_name}}_utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}_utils.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}_utils.cpp index 1282d07..af0306b 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}_utils.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}_utils.cpp @@ -1,4 +1,4 @@ -#include "./{{cookiecutter.repo_name}}_utils.h" +#include "./{{cookiecutter.repo_name}}Utils.h" int sum(int a, int b) { std::cout << "input a: " << a << std::endl << "input b: " << b << std::endl; From 6f25e6dd040a31ff072505820194ccb12d63ae41 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 23 Sep 2020 19:20:24 +0200 Subject: [PATCH 183/272] Rename {{cookiecutter.repo_name}}_utils.cpp to {{cookiecutter.repo_name}}Utils.cpp --- ....repo_name}}_utils.cpp => {{cookiecutter.repo_name}}Utils.cpp} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{{cookiecutter.repo_name}}_utils.cpp => {{cookiecutter.repo_name}}Utils.cpp} (100%) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}_utils.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}Utils.cpp similarity index 100% rename from {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}_utils.cpp rename to {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}Utils.cpp From 1b60cbe9cccdd3d2f68938a063cd8c34c26485f4 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 23 Sep 2020 19:20:49 +0200 Subject: [PATCH 184/272] Rename {{cookiecutter.repo_name}}_utils.h to {{cookiecutter.repo_name}}Utils.h --- ...tter.repo_name}}_utils.h => {{cookiecutter.repo_name}}Utils.h} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{{cookiecutter.repo_name}}_utils.h => {{cookiecutter.repo_name}}Utils.h} (100%) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}_utils.h b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}Utils.h similarity index 100% rename from {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}_utils.h rename to {{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}Utils.h From f7720673a0b2414239b4804d9f8820ba93a17717 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 23 Sep 2020 19:23:01 +0200 Subject: [PATCH 185/272] Update {{ cookiecutter.project_name }}.cpp --- .../{{ cookiecutter.project_name }}.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp index bc92ba8..afcceaa 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp @@ -1,5 +1,5 @@ #include -#include {{ cookiecutter.project_name }}_utils.h> +#include {{ cookiecutter.project_name }}Utils.h> #include //packagemanager downloaded library. #include //system wide installed package. From d277b8b6bc7b321dde74dd40c098f3a8610d33c6 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 23 Sep 2020 19:23:53 +0200 Subject: [PATCH 186/272] Update test{{cookiecutter.repo_name}}_utils.cpp --- .../test/test{{cookiecutter.repo_name}}_utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/test/test{{cookiecutter.repo_name}}_utils.cpp b/{{cookiecutter.repo_name}}/test/test{{cookiecutter.repo_name}}_utils.cpp index ea52772..25f9bf0 100644 --- a/{{cookiecutter.repo_name}}/test/test{{cookiecutter.repo_name}}_utils.cpp +++ b/{{cookiecutter.repo_name}}/test/test{{cookiecutter.repo_name}}_utils.cpp @@ -1,5 +1,5 @@ #include -#include <{{cookiecutter.repo_name}}_utils.h> +#include <{{cookiecutter.repo_name}}Utils.h> TEST(testSum, OutputTest) { EXPECT_EQ(4, sum(1,3)); From 7160290421ba5e03a8ce0adc0773373c5cb70c62 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 23 Sep 2020 19:25:46 +0200 Subject: [PATCH 187/272] Update {{ cookiecutter.project_name }}.cpp --- .../{{ cookiecutter.project_name }}.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp index afcceaa..7279d19 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp @@ -1,5 +1,5 @@ #include -#include {{ cookiecutter.project_name }}Utils.h> +#include <{{ cookiecutter.project_name }}Utils.h> #include //packagemanager downloaded library. #include //system wide installed package. From b64bc4b85fb041a5a8c03196108afff6076ab299 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 23 Sep 2020 19:43:39 +0200 Subject: [PATCH 188/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/test/CMakeLists.txt b/{{cookiecutter.repo_name}}/test/CMakeLists.txt index 9f80f5e..635aedc 100644 --- a/{{cookiecutter.repo_name}}/test/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/test/CMakeLists.txt @@ -1,7 +1,7 @@ # Tests for {{ cookiecutter.project_name }} file(GLOB SOURCES *.cpp) add_executable(${PROJECT_NAME}_test ${SOURCES}) -target_link_libraries(${PROJECT_NAME}_test {{cookiecutter.repo_name}}_utils libgtest) +target_link_libraries(${PROJECT_NAME}_test {{cookiecutter.repo_name}}Utils libgtest) # Register the tests add_test(NAME ${PROJECT_NAME}_test COMMAND ${PROJECT_NAME}_test) From 17ab2533675624c6931da5a0b778349db15e1dc9 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 23 Sep 2020 19:57:45 +0200 Subject: [PATCH 189/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index c7ef94d..173bb9d 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -29,9 +29,10 @@ else () set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -pedantic") endif () -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORYCMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}) +# Tell cmake to output binaries here: +# set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Static link libraries +# set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin) # Executables +# set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Dynamic link libraries # Package manager manager (fmt is just a sample library to test the manager) include(pmm.cmake) From 9fb1906a5cbeb9e36ad7a80309a0e5fc2a7527e0 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 23 Sep 2020 20:01:01 +0200 Subject: [PATCH 190/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 173bb9d..4b61420 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -30,10 +30,10 @@ else () endif () # Tell cmake to output binaries here: -# set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Static link libraries -# set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin) # Executables -# set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Dynamic link libraries -# Package manager manager (fmt is just a sample library to test the manager) +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Static link libraries +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin) # Executables +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Dynamic link libraries + include(pmm.cmake) # In the case of a Microsoft system, all packages should be installed by VCPKG, for UNIX systems, the user has to install the required packages using their system package manager. From 9b9f87d4265afe104c9e96d1b055332444cbbc76 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 23 Sep 2020 20:02:11 +0200 Subject: [PATCH 191/272] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 05a69ba..de07cf0 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ Usage: $ make $ ctest -vv $ ../bin/main + $ sudo make install From e3e8a758df5f5d115e9d9b33885f696a079b4de9 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 23 Sep 2020 20:08:08 +0200 Subject: [PATCH 192/272] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index de07cf0..ca14e79 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ cookiecutter-cpp ================ -Currently works only for Linux compilers, I'm currently changing the CMake scripts to make them compiler independent. +Currently works only tested for Linux compilers. A test-driven C++ project template built on CMake and GoogleTest @@ -13,8 +13,8 @@ pmm is a package manager manager. You can configure your project to use Conan or This template was made by combining: Original Cookicutter project https://github.com/hbristow/cookiecutter-cpp A lecture of Igor Bogoslavskyi https://www.youtube.com/watch?v=q8xO2eJijy4&list=PLgnQpQtFTOGR50iIOtO36nK6aNPtVq98C&index=4 -Boilerplate pmm project https://github.com/ariveron/boilerplate-pmm-vcpkg-cmake - +Boilerplate pmm project https://github.com/ariveron/boilerplate-pmm-vcpkg-cmake +CMake Example: https://github.com/dev-cafe/cmake-cookbook/blob/master/chapter-10/recipe-01/cxx-example/CMakeLists.txt Usage: From e596878ea40bd418938e4ca2dfc5ff28bb49b2fd Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 23 Sep 2020 20:08:30 +0200 Subject: [PATCH 193/272] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ca14e79..4df6410 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ cookiecutter-cpp ================ -Currently works only tested for Linux compilers. +Currently only tested for Linux. A test-driven C++ project template built on CMake and GoogleTest From c71cd4f755eed9ce2edab534cf4a8ee42c9c7265 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 23 Sep 2020 20:09:01 +0200 Subject: [PATCH 194/272] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4df6410..1349124 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,9 @@ Doxygen enables documentation. pmm is a package manager manager. You can configure your project to use Conan or VCPKG. This template was made by combining: -Original Cookicutter project https://github.com/hbristow/cookiecutter-cpp -A lecture of Igor Bogoslavskyi https://www.youtube.com/watch?v=q8xO2eJijy4&list=PLgnQpQtFTOGR50iIOtO36nK6aNPtVq98C&index=4 -Boilerplate pmm project https://github.com/ariveron/boilerplate-pmm-vcpkg-cmake +Original Cookicutter project: https://github.com/hbristow/cookiecutter-cpp +A lecture of Igor Bogoslavskyi: https://www.youtube.com/watch?v=q8xO2eJijy4&list=PLgnQpQtFTOGR50iIOtO36nK6aNPtVq98C&index=4 +Boilerplate pmm project: https://github.com/ariveron/boilerplate-pmm-vcpkg-cmake CMake Example: https://github.com/dev-cafe/cmake-cookbook/blob/master/chapter-10/recipe-01/cxx-example/CMakeLists.txt From 9594604ce3486a0017ceeda6bff540c56d2f4006 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 23 Sep 2020 20:09:51 +0200 Subject: [PATCH 195/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 4b61420..a2212d2 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -9,9 +9,9 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Project project({{cookiecutter.project_name}} C CXX) project({{cookiecutter.repo_name}} VERSION {{ cookiecutter.version }} LANGUAGES CXX) -set(PROJECT_DESCRIPTION "A rock solid project with enforced style, testing and static analysis") -set(PROJECT_AUTHOR "First Last") -set(PROJECT_URL "https://github.com/flast/{{cookiecutter.project_name}}") +set(PROJECT_DESCRIPTION "{{ cookiecutter.description }}") +set(PROJECT_AUTHOR "{{ cookiecutter.author }}") +set(PROJECT_URL "https://github.com/{{ cookiecutter.username }}/{{ cookiecutter.repo_name }}") # Build flags if(NOT CMAKE_BUILD_TYPE) From d2d3bdc629a2f19de7c2e51b183a04c1bde3fffd Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 23 Sep 2020 20:12:59 +0200 Subject: [PATCH 196/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index a2212d2..145d814 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -37,6 +37,7 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Dynamic link lib include(pmm.cmake) # In the case of a Microsoft system, all packages should be installed by VCPKG, for UNIX systems, the user has to install the required packages using their system package manager. +# In Linux, when a broken VCPKG package is installed by VCPKG, it should be manually uninstalled. Otherwise build errors might occur. if (MSVC) set(PMM_PACKAGES "fmt Armadillo") else () From 29c9800e83ea45e74c84be28c3cdb5b835eae3fe Mon Sep 17 00:00:00 2001 From: reinout91 Date: Wed, 23 Sep 2020 20:27:12 +0200 Subject: [PATCH 197/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 145d814..faa9c31 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -96,14 +96,14 @@ install( {{cookiecutter.project_name}}Utils {{cookiecutter.project_name}} ARCHIVE - DESTINATION ${INSTALL_LIBDIR} + DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} COMPONENT lib RUNTIME DESTINATION ${INSTALL_BINDIR} - COMPONENT bin + COMPONENT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} LIBRARY DESTINATION ${INSTALL_LIBDIR} - COMPONENT lib + COMPONENT ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} PUBLIC_HEADER DESTINATION ${INSTALL_INCLUDEDIR}/{{cookiecutter.project_name}}Utils COMPONENT dev From b281b062466a1dd75b6fa3efea28a7e0814bf7db Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 24 Sep 2020 09:32:46 +0200 Subject: [PATCH 198/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index faa9c31..350712e 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,6 +1,7 @@ -# {{cookiecutter.project_name}} -# A rock solid project with enforced style, testing and static analysis -# Copyright 2020, First Last + +# {{ cookiecutter.project_name }} +# {{ cookiecutter.description }} +# Copyright {{ cookiecutter.year }}, {{ cookiecutter.author }} cmake_minimum_required(VERSION 3.8 FATAL_ERROR) # Can be useful for vim? From ef826f136735e5fc05c33168da3346ee7b7c81cf Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 24 Sep 2020 09:49:47 +0200 Subject: [PATCH 199/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 350712e..e3a422e 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -94,11 +94,11 @@ set_target_properties({{cookiecutter.project_name}} message(STATUS "Project will be installed to ${CMAKE_INSTALL_PREFIX}, admin rights may be required to make install") install( TARGETS - {{cookiecutter.project_name}}Utils - {{cookiecutter.project_name}} + tythUtils + tyth ARCHIVE - DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} - COMPONENT lib + DESTINATION ${INSTALL_LIBDIR} + COMPONENT ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} RUNTIME DESTINATION ${INSTALL_BINDIR} COMPONENT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} @@ -106,6 +106,6 @@ install( DESTINATION ${INSTALL_LIBDIR} COMPONENT ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} PUBLIC_HEADER - DESTINATION ${INSTALL_INCLUDEDIR}/{{cookiecutter.project_name}}Utils + DESTINATION ${INSTALL_INCLUDEDIR}/tythUtils COMPONENT dev ) From 894a18a859e6f051fd56a1519c104d84c8ad3748 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 24 Sep 2020 11:17:33 +0200 Subject: [PATCH 200/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index e3a422e..d6307cc 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -71,7 +71,7 @@ add_subdirectory(doc) # Prepare RPATH if (NOT MSVC) - set(CMAKE_INSTALL_PREFIX "/home/user/.local") #We don't want to install to the default /usr/local. + set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/user/.local") #We don't want to install to the default /usr/local. endif () file(RELATIVE_PATH _rel ${CMAKE_INSTALL_PREFIX}/${INSTALL_BINDIR} ${CMAKE_INSTALL_PREFIX}) if(APPLE) From c43d3542c1b323349c044610999940a854ff8de0 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 24 Sep 2020 11:21:51 +0200 Subject: [PATCH 201/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index d6307cc..da0d3f8 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -94,8 +94,8 @@ set_target_properties({{cookiecutter.project_name}} message(STATUS "Project will be installed to ${CMAKE_INSTALL_PREFIX}, admin rights may be required to make install") install( TARGETS - tythUtils - tyth + {{cookiecutter.repo_name}}Utils + {{cookiecutter.repo_name}} ARCHIVE DESTINATION ${INSTALL_LIBDIR} COMPONENT ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} From 1e57c6bd33675d0061b031a67d1dd3b2d9aab1d1 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 24 Sep 2020 11:24:56 +0200 Subject: [PATCH 202/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index da0d3f8..5e1d972 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -71,7 +71,7 @@ add_subdirectory(doc) # Prepare RPATH if (NOT MSVC) - set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/user/.local") #We don't want to install to the default /usr/local. + set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.local") #We don't want to install to the default /usr/local. endif () file(RELATIVE_PATH _rel ${CMAKE_INSTALL_PREFIX}/${INSTALL_BINDIR} ${CMAKE_INSTALL_PREFIX}) if(APPLE) From 7d8b411be96a6ca442465aae64014de59174b8a9 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 24 Sep 2020 11:29:36 +0200 Subject: [PATCH 203/272] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1349124..172422b 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,9 @@ Currently only tested for Linux. A test-driven C++ project template built on CMake and GoogleTest CMake is a fast and easy build tool. -GoogleTest test ensures robust code. +Use of GoogleTest test ensures robust code. Doxygen enables documentation. -pmm is a package manager manager. You can configure your project to use Conan or VCPKG. +pmm is a package manager manager. You can configure your project to use Conan or VCPKG. This may become more important for cross platform development. This template was made by combining: Original Cookicutter project: https://github.com/hbristow/cookiecutter-cpp @@ -27,7 +27,7 @@ Usage: $ make $ ctest -vv $ ../bin/main - $ sudo make install + $ make install From 0972ca26791f2009da0a9b17309e06328344727a Mon Sep 17 00:00:00 2001 From: reinout91 Date: Fri, 25 Sep 2020 16:46:57 +0200 Subject: [PATCH 204/272] Update post_gen_project.py --- hooks/post_gen_project.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 7190096..6eebf9d 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -1,4 +1,5 @@ """Post-project generation hooks""" +import os if __name__ == '__main__': """Initialize a git repository based on the configured branch and repo""" @@ -10,4 +11,8 @@ subprocess.call(('git', 'init')) subprocess.call(('git', 'checkout', '-b', branch)) subprocess.call(('git', 'remote', 'add', remote, url)) - subprocess.call(('mv', 'pre-commit', '.git/hooks/')) + if os.name == 'nt': + subprocess.call(('move', 'pre-commit', '.git/hooks/')) + else: + subprocess.call(('mv', 'pre-commit', '.git/hooks/')) + From 6249b604e5d07a4b052e5d6de525149a394e2656 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Fri, 25 Sep 2020 16:55:37 +0200 Subject: [PATCH 205/272] Update post_gen_project.py --- hooks/post_gen_project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 6eebf9d..e6139ef 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -12,7 +12,7 @@ subprocess.call(('git', 'checkout', '-b', branch)) subprocess.call(('git', 'remote', 'add', remote, url)) if os.name == 'nt': - subprocess.call(('move', 'pre-commit', '.git/hooks/')) + subprocess.call(('move', 'pre-commit', '.git\\hooks\\')) else: subprocess.call(('mv', 'pre-commit', '.git/hooks/')) From fa3f9dcaece56282af972dd0993a66b7b4319bcc Mon Sep 17 00:00:00 2001 From: reinout91 Date: Fri, 25 Sep 2020 17:02:27 +0200 Subject: [PATCH 206/272] Update post_gen_project.py --- hooks/post_gen_project.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index e6139ef..e01e05c 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -1,5 +1,6 @@ """Post-project generation hooks""" import os +import shutil if __name__ == '__main__': """Initialize a git repository based on the configured branch and repo""" @@ -12,7 +13,7 @@ subprocess.call(('git', 'checkout', '-b', branch)) subprocess.call(('git', 'remote', 'add', remote, url)) if os.name == 'nt': - subprocess.call(('move', 'pre-commit', '.git\\hooks\\')) + shutil.move('pre-commit', '.git\\hooks\\') else: subprocess.call(('mv', 'pre-commit', '.git/hooks/')) From 63b45606ee91d84376776058fb0c97787b06e534 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Fri, 25 Sep 2020 17:02:45 +0200 Subject: [PATCH 207/272] Update post_gen_project.py --- hooks/post_gen_project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index e01e05c..1aa5594 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -13,7 +13,7 @@ subprocess.call(('git', 'checkout', '-b', branch)) subprocess.call(('git', 'remote', 'add', remote, url)) if os.name == 'nt': - shutil.move('pre-commit', '.git\\hooks\\') + shutil.move('pre-commit', '.git\\hooks') else: subprocess.call(('mv', 'pre-commit', '.git/hooks/')) From d7848e0e33fa73be20a536d0b996e4f9aeb00e09 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Fri, 25 Sep 2020 18:35:28 +0200 Subject: [PATCH 208/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 5e1d972..f40d2b4 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -40,9 +40,9 @@ include(pmm.cmake) # In the case of a Microsoft system, all packages should be installed by VCPKG, for UNIX systems, the user has to install the required packages using their system package manager. # In Linux, when a broken VCPKG package is installed by VCPKG, it should be manually uninstalled. Otherwise build errors might occur. if (MSVC) - set(PMM_PACKAGES "fmt Armadillo") + set(PMM_PACKAGES fmt Armadillo) else () - set(PMM_PACKAGES "fmt") + set(PMM_PACKAGES fmt) #sudo apt-get install libarmadillo-dev (VCPKG version is broken) endif () pmm( From aa5a8fc170f5466becc2d647161a17cd2c1b6c9a Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sat, 26 Sep 2020 14:46:40 +0200 Subject: [PATCH 209/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 1abb035..01eb163 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,3 +1,4 @@ add_library({{cookiecutter.repo_name}}Utils STATIC {{cookiecutter.repo_name}}Utils.cpp) +include_directories(${ARMADILLO_INCLUDE_DIRS}) add_executable({{cookiecutter.repo_name}} {{cookiecutter.repo_name}}.cpp) target_link_libraries({{cookiecutter.repo_name}} {{cookiecutter.repo_name}}Utils fmt::fmt ${ARMADILLO_LIBRARIES}) From 3c6df471acaac504046e96d437197f1800b8c107 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sat, 26 Sep 2020 15:09:43 +0200 Subject: [PATCH 210/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index f40d2b4..f7f7e27 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -40,7 +40,7 @@ include(pmm.cmake) # In the case of a Microsoft system, all packages should be installed by VCPKG, for UNIX systems, the user has to install the required packages using their system package manager. # In Linux, when a broken VCPKG package is installed by VCPKG, it should be manually uninstalled. Otherwise build errors might occur. if (MSVC) - set(PMM_PACKAGES fmt Armadillo) + set(PMM_PACKAGES fmt armadillo-x64-windows-shared) else () set(PMM_PACKAGES fmt) #sudo apt-get install libarmadillo-dev (VCPKG version is broken) @@ -53,6 +53,7 @@ pmm( # Space seperated list of required vcpkg packages REQUIRES ${PMM_PACKAGES} ) +DCMAKE_TOOLCHAIN_FILE=C:/Users/reino/AppData/Local/pmm/1.5.0/vcpkg-master/scripts/buildsystems/vcpkg.cmake # Find required packages for project, these are the cmake targets reported by vcpkg. find_package(fmt CONFIG REQUIRED) From e15ddedfb36cac242c328d1dac2d1b5c7d274a11 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sat, 26 Sep 2020 15:11:47 +0200 Subject: [PATCH 211/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index f7f7e27..5002608 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -53,7 +53,7 @@ pmm( # Space seperated list of required vcpkg packages REQUIRES ${PMM_PACKAGES} ) -DCMAKE_TOOLCHAIN_FILE=C:/Users/reino/AppData/Local/pmm/1.5.0/vcpkg-master/scripts/buildsystems/vcpkg.cmake +set(DCMAKE_TOOLCHAIN_FILE="C:/Users/reino/AppData/Local/pmm/1.5.0/vcpkg-master/scripts/buildsystems/vcpkg.cmake") # Find required packages for project, these are the cmake targets reported by vcpkg. find_package(fmt CONFIG REQUIRED) From 1361cbabfa01682aee3a692ab0fc0d4b4d74c1b3 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sat, 26 Sep 2020 15:13:09 +0200 Subject: [PATCH 212/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 5002608..2d7b231 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -40,7 +40,7 @@ include(pmm.cmake) # In the case of a Microsoft system, all packages should be installed by VCPKG, for UNIX systems, the user has to install the required packages using their system package manager. # In Linux, when a broken VCPKG package is installed by VCPKG, it should be manually uninstalled. Otherwise build errors might occur. if (MSVC) - set(PMM_PACKAGES fmt armadillo-x64-windows-shared) + set(PMM_PACKAGES fmt armadillo) else () set(PMM_PACKAGES fmt) #sudo apt-get install libarmadillo-dev (VCPKG version is broken) From a1a223a6ac99dc4862cfdfa84115eabe2831af1c Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sat, 26 Sep 2020 15:15:42 +0200 Subject: [PATCH 213/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 2d7b231..d5e7b65 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -53,7 +53,6 @@ pmm( # Space seperated list of required vcpkg packages REQUIRES ${PMM_PACKAGES} ) -set(DCMAKE_TOOLCHAIN_FILE="C:/Users/reino/AppData/Local/pmm/1.5.0/vcpkg-master/scripts/buildsystems/vcpkg.cmake") # Find required packages for project, these are the cmake targets reported by vcpkg. find_package(fmt CONFIG REQUIRED) From 630e445aa064b0801d1e48c08593383f297bc21e Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sat, 26 Sep 2020 15:29:59 +0200 Subject: [PATCH 214/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index d5e7b65..e23a175 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -39,6 +39,9 @@ include(pmm.cmake) # In the case of a Microsoft system, all packages should be installed by VCPKG, for UNIX systems, the user has to install the required packages using their system package manager. # In Linux, when a broken VCPKG package is installed by VCPKG, it should be manually uninstalled. Otherwise build errors might occur. + +set(BUILD_SHARED_LIBS=false) + if (MSVC) set(PMM_PACKAGES fmt armadillo) else () From ef6b0d5c0f7462a2d1a739e9a449202918f7b3dd Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sat, 26 Sep 2020 15:34:47 +0200 Subject: [PATCH 215/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 01eb163..70d983d 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,4 +1,4 @@ add_library({{cookiecutter.repo_name}}Utils STATIC {{cookiecutter.repo_name}}Utils.cpp) include_directories(${ARMADILLO_INCLUDE_DIRS}) add_executable({{cookiecutter.repo_name}} {{cookiecutter.repo_name}}.cpp) -target_link_libraries({{cookiecutter.repo_name}} {{cookiecutter.repo_name}}Utils fmt::fmt ${ARMADILLO_LIBRARIES}) +target_link_libraries({{cookiecutter.repo_name}} PRIVATE {{cookiecutter.repo_name}}Utils fmt::fmt ${ARMADILLO_LIBRARIES}) From b09e6cea036d92e57d1d244458098f0c2ed87b4e Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sat, 26 Sep 2020 15:42:31 +0200 Subject: [PATCH 216/272] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 172422b..217ce1b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ cookiecutter-cpp ================ -Currently only tested for Linux. +PROBLEM!! +I don't get the Armadillo library installed from VCPKG working, while an apt install in linux of libarmadillo-dev works as a charm. + A test-driven C++ project template built on CMake and GoogleTest From 6dd916dc4378aa029fdb791d6e23f37d769a6553 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sat, 26 Sep 2020 15:50:22 +0200 Subject: [PATCH 217/272] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 217ce1b..6534097 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ cookiecutter-cpp ================ PROBLEM!! -I don't get the Armadillo library installed from VCPKG working, while an apt install in linux of libarmadillo-dev works as a charm. +I don't get the Armadillo library installed from VCPKG working, while an apt install in linux of libarmadillo-dev works as a charm. The vcpkg version does not get properly linked. A test-driven C++ project template built on CMake and GoogleTest From 5f24b0b805b86766be5ce315155101716b0e1399 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sat, 26 Sep 2020 16:04:05 +0200 Subject: [PATCH 218/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 70d983d..5427fbb 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,4 +1,3 @@ add_library({{cookiecutter.repo_name}}Utils STATIC {{cookiecutter.repo_name}}Utils.cpp) -include_directories(${ARMADILLO_INCLUDE_DIRS}) add_executable({{cookiecutter.repo_name}} {{cookiecutter.repo_name}}.cpp) target_link_libraries({{cookiecutter.repo_name}} PRIVATE {{cookiecutter.repo_name}}Utils fmt::fmt ${ARMADILLO_LIBRARIES}) From 2ebca0d1e3ba06789172e7eb83d6f78e2d4f77df Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sat, 26 Sep 2020 16:07:35 +0200 Subject: [PATCH 219/272] try with linked armadillo --- {{cookiecutter.repo_name}}/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index e23a175..1a78069 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -60,6 +60,7 @@ pmm( # Find required packages for project, these are the cmake targets reported by vcpkg. find_package(fmt CONFIG REQUIRED) find_package(Armadillo REQUIRED) +include_directories(${ARMADILLO_INCLUDE_DIRS}) add_subdirectory(external) # Tell cmake where to look for *.h files. From e7940c6fd49cf09a416d91eb027baa1309a92f5e Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sat, 26 Sep 2020 16:19:27 +0200 Subject: [PATCH 220/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 5427fbb..70d983d 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,3 +1,4 @@ add_library({{cookiecutter.repo_name}}Utils STATIC {{cookiecutter.repo_name}}Utils.cpp) +include_directories(${ARMADILLO_INCLUDE_DIRS}) add_executable({{cookiecutter.repo_name}} {{cookiecutter.repo_name}}.cpp) target_link_libraries({{cookiecutter.repo_name}} PRIVATE {{cookiecutter.repo_name}}Utils fmt::fmt ${ARMADILLO_LIBRARIES}) From 101af4ba1aab5d24c6ff2e9fd802fc271c0bc359 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sat, 26 Sep 2020 16:24:11 +0200 Subject: [PATCH 221/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 70d983d..f501ffb 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,4 +1,4 @@ add_library({{cookiecutter.repo_name}}Utils STATIC {{cookiecutter.repo_name}}Utils.cpp) -include_directories(${ARMADILLO_INCLUDE_DIRS}) +include_directories(SYSTEM ${ARMADILLO_INCLUDE_DIRS}) add_executable({{cookiecutter.repo_name}} {{cookiecutter.repo_name}}.cpp) target_link_libraries({{cookiecutter.repo_name}} PRIVATE {{cookiecutter.repo_name}}Utils fmt::fmt ${ARMADILLO_LIBRARIES}) From 4705c1c17da997adb0c5c8bedabb0d9477ae8911 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sat, 26 Sep 2020 16:56:31 +0200 Subject: [PATCH 222/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index f501ffb..35e4e00 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,4 +1,6 @@ add_library({{cookiecutter.repo_name}}Utils STATIC {{cookiecutter.repo_name}}Utils.cpp) include_directories(SYSTEM ${ARMADILLO_INCLUDE_DIRS}) add_executable({{cookiecutter.repo_name}} {{cookiecutter.repo_name}}.cpp) -target_link_libraries({{cookiecutter.repo_name}} PRIVATE {{cookiecutter.repo_name}}Utils fmt::fmt ${ARMADILLO_LIBRARIES}) +set(DIRS=fmt::fmt) +list(APPEND DIRS ${ARMADILLO_LIBRARIES} +target_link_libraries({{cookiecutter.repo_name}} ${DIRS}) From 73279b72501ca2d94e2ad16f79da640b751a45a3 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sat, 26 Sep 2020 17:10:51 +0200 Subject: [PATCH 223/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 1a78069..2084636 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -59,7 +59,10 @@ pmm( # Find required packages for project, these are the cmake targets reported by vcpkg. find_package(fmt CONFIG REQUIRED) +find_package(LAPACK) +find_package( BLAS REQUIRED ) find_package(Armadillo REQUIRED) + include_directories(${ARMADILLO_INCLUDE_DIRS}) add_subdirectory(external) From 1409f4481de51cf328c4ee5210b7365f81628d82 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sat, 26 Sep 2020 17:13:03 +0200 Subject: [PATCH 224/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 35e4e00..de7ddb3 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -2,5 +2,5 @@ add_library({{cookiecutter.repo_name}}Utils STATIC {{cookiecutter.repo_name}}Uti include_directories(SYSTEM ${ARMADILLO_INCLUDE_DIRS}) add_executable({{cookiecutter.repo_name}} {{cookiecutter.repo_name}}.cpp) set(DIRS=fmt::fmt) -list(APPEND DIRS ${ARMADILLO_LIBRARIES} +list(APPEND DIRS ${ARMADILLO_LIBRARIES}) target_link_libraries({{cookiecutter.repo_name}} ${DIRS}) From 21f0a1baeb1d433e11df5f15a591b34cc0268056 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sat, 26 Sep 2020 17:16:00 +0200 Subject: [PATCH 225/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 2084636..696b8a5 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -59,8 +59,6 @@ pmm( # Find required packages for project, these are the cmake targets reported by vcpkg. find_package(fmt CONFIG REQUIRED) -find_package(LAPACK) -find_package( BLAS REQUIRED ) find_package(Armadillo REQUIRED) include_directories(${ARMADILLO_INCLUDE_DIRS}) From 05365bd43aec81d6c0e75245a60ad1eb259fc882 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sat, 26 Sep 2020 17:21:59 +0200 Subject: [PATCH 226/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index de7ddb3..114b04d 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,5 +1,7 @@ add_library({{cookiecutter.repo_name}}Utils STATIC {{cookiecutter.repo_name}}Utils.cpp) include_directories(SYSTEM ${ARMADILLO_INCLUDE_DIRS}) +message(STATUS armaincludes ${ARMADILLO_INCLUDE_DIRS}) +message(STATUS armalibs ${ARMADILLO_LIBRARIES}) add_executable({{cookiecutter.repo_name}} {{cookiecutter.repo_name}}.cpp) set(DIRS=fmt::fmt) list(APPEND DIRS ${ARMADILLO_LIBRARIES}) From f166e35d91f7ad1d7d275710f9f574d5c5741f16 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sat, 26 Sep 2020 17:26:16 +0200 Subject: [PATCH 227/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 114b04d..4feae6a 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,6 +1,4 @@ add_library({{cookiecutter.repo_name}}Utils STATIC {{cookiecutter.repo_name}}Utils.cpp) -include_directories(SYSTEM ${ARMADILLO_INCLUDE_DIRS}) -message(STATUS armaincludes ${ARMADILLO_INCLUDE_DIRS}) message(STATUS armalibs ${ARMADILLO_LIBRARIES}) add_executable({{cookiecutter.repo_name}} {{cookiecutter.repo_name}}.cpp) set(DIRS=fmt::fmt) From 6933997b01a83e5b7e3364d67859c6bc41b050ff Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 13:46:34 +0200 Subject: [PATCH 228/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 4feae6a..530606a 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,6 +1,7 @@ add_library({{cookiecutter.repo_name}}Utils STATIC {{cookiecutter.repo_name}}Utils.cpp) message(STATUS armalibs ${ARMADILLO_LIBRARIES}) add_executable({{cookiecutter.repo_name}} {{cookiecutter.repo_name}}.cpp) -set(DIRS=fmt::fmt) +set(DIRS fmt::fmt) list(APPEND DIRS ${ARMADILLO_LIBRARIES}) +list(APPEND DIRS {{cookiecutter.repo_name}}Utils) target_link_libraries({{cookiecutter.repo_name}} ${DIRS}) From b60e47a3df8cd5bc95c4e7129b0d13dcbe512b5c Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 14:15:00 +0200 Subject: [PATCH 229/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 530606a..d7de9db 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -4,4 +4,5 @@ add_executable({{cookiecutter.repo_name}} {{cookiecutter.repo_name}}.cpp) set(DIRS fmt::fmt) list(APPEND DIRS ${ARMADILLO_LIBRARIES}) list(APPEND DIRS {{cookiecutter.repo_name}}Utils) +list(APPEND DIRS OpenBLAS::OpenBLAS) target_link_libraries({{cookiecutter.repo_name}} ${DIRS}) From 68bc7553c0caaa55026e74d525eb33ad1399a7d6 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 14:16:54 +0200 Subject: [PATCH 230/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 696b8a5..5bd0399 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -43,7 +43,7 @@ include(pmm.cmake) set(BUILD_SHARED_LIBS=false) if (MSVC) - set(PMM_PACKAGES fmt armadillo) + set(PMM_PACKAGES fmt openblas lapack armadillo) else () set(PMM_PACKAGES fmt) #sudo apt-get install libarmadillo-dev (VCPKG version is broken) @@ -59,6 +59,7 @@ pmm( # Find required packages for project, these are the cmake targets reported by vcpkg. find_package(fmt CONFIG REQUIRED) +find_package(OpenBLAS CONFIG REQUIRED) find_package(Armadillo REQUIRED) include_directories(${ARMADILLO_INCLUDE_DIRS}) From 8041f7d708c53d7b1c566836f347e1b26bb5a9a4 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 14:21:16 +0200 Subject: [PATCH 231/272] Update {{ cookiecutter.project_name }}.cpp --- .../{{ cookiecutter.project_name }}.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp index 7279d19..060e5f2 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp @@ -1,6 +1,7 @@ #include #include <{{ cookiecutter.project_name }}Utils.h> #include //packagemanager downloaded library. +#define ARMA_DONT_USE_WRAPPER #include //system wide installed package. using namespace std; From 380c35f8a450822130b899e30f01e41622f5fb4b Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 14:28:40 +0200 Subject: [PATCH 232/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 5bd0399..fa4d310 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -59,6 +59,7 @@ pmm( # Find required packages for project, these are the cmake targets reported by vcpkg. find_package(fmt CONFIG REQUIRED) +find_package(LAPACK) find_package(OpenBLAS CONFIG REQUIRED) find_package(Armadillo REQUIRED) From bcc23d4fa63d5b0d1898a5199c9a8b7a62ccb833 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 14:29:12 +0200 Subject: [PATCH 233/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index d7de9db..62b1baf 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -4,5 +4,6 @@ add_executable({{cookiecutter.repo_name}} {{cookiecutter.repo_name}}.cpp) set(DIRS fmt::fmt) list(APPEND DIRS ${ARMADILLO_LIBRARIES}) list(APPEND DIRS {{cookiecutter.repo_name}}Utils) +list(APPEND DIRS LAPACK::LAPACK) list(APPEND DIRS OpenBLAS::OpenBLAS) target_link_libraries({{cookiecutter.repo_name}} ${DIRS}) From 770c60f02ccd2dd0d760f69e3def7d02220e45ce Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 14:42:00 +0200 Subject: [PATCH 234/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index fa4d310..3b183e5 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -45,7 +45,7 @@ set(BUILD_SHARED_LIBS=false) if (MSVC) set(PMM_PACKAGES fmt openblas lapack armadillo) else () - set(PMM_PACKAGES fmt) + set(PMM_PACKAGES fmt openblas lapack armadillo) #sudo apt-get install libarmadillo-dev (VCPKG version is broken) endif () pmm( @@ -63,7 +63,7 @@ find_package(LAPACK) find_package(OpenBLAS CONFIG REQUIRED) find_package(Armadillo REQUIRED) -include_directories(${ARMADILLO_INCLUDE_DIRS}) +//include_directories(${ARMADILLO_INCLUDE_DIRS}) add_subdirectory(external) # Tell cmake where to look for *.h files. From 1c285d2a298ffe3e9ed154d0cda6f32637c1669d Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 14:44:42 +0200 Subject: [PATCH 235/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 3b183e5..371398f 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -63,7 +63,7 @@ find_package(LAPACK) find_package(OpenBLAS CONFIG REQUIRED) find_package(Armadillo REQUIRED) -//include_directories(${ARMADILLO_INCLUDE_DIRS}) +#include_directories(${ARMADILLO_INCLUDE_DIRS}) add_subdirectory(external) # Tell cmake where to look for *.h files. From d2f96559ea7ebcdac92093bf9bc14829b535348f Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 14:52:57 +0200 Subject: [PATCH 236/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 371398f..2caaf8e 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -22,7 +22,7 @@ endif() set (CMAKE_CXX_STANDARD 14) if (MSVC) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /WX /utf-8") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3 /utf-8") else () set(CMAKE_CXX_FLAGS_DEBUG "-g -O0") set(CMAKE_CXX_FLAGS_RELEASE "-O3") From c98b255c306552416fed1ec22945a377f88668b3 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 15:19:28 +0200 Subject: [PATCH 237/272] Update {{ cookiecutter.project_name }}.cpp --- .../{{ cookiecutter.project_name }}.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp index 060e5f2..eb2c9d8 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp @@ -2,6 +2,8 @@ #include <{{ cookiecutter.project_name }}Utils.h> #include //packagemanager downloaded library. #define ARMA_DONT_USE_WRAPPER +#define ARMA_USE_LAPACK +#define ARMA_USE_BLAS #include //system wide installed package. using namespace std; From e1b32f287c66fe419f705a71f3db15f99b893716 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 15:21:40 +0200 Subject: [PATCH 238/272] Update {{ cookiecutter.project_name }}.cpp --- .../{{ cookiecutter.project_name }}.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp index eb2c9d8..986948c 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp @@ -1,9 +1,9 @@ #include #include <{{ cookiecutter.project_name }}Utils.h> #include //packagemanager downloaded library. -#define ARMA_DONT_USE_WRAPPER -#define ARMA_USE_LAPACK -#define ARMA_USE_BLAS +//#define ARMA_DONT_USE_WRAPPER +//#define ARMA_USE_LAPACK +//#define ARMA_USE_BLAS #include //system wide installed package. using namespace std; From 91d73c3e1ea38634799e55ea594cbe912f2c54a8 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 16:24:57 +0200 Subject: [PATCH 239/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 62b1baf..552b887 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,8 +1,9 @@ add_library({{cookiecutter.repo_name}}Utils STATIC {{cookiecutter.repo_name}}Utils.cpp) -message(STATUS armalibs ${ARMADILLO_LIBRARIES}) +#message(STATUS armalibs ${ARMADILLO_LIBRARIES}) add_executable({{cookiecutter.repo_name}} {{cookiecutter.repo_name}}.cpp) set(DIRS fmt::fmt) -list(APPEND DIRS ${ARMADILLO_LIBRARIES}) +#list(APPEND DIRS ${ARMADILLO_LIBRARIES}) +list(APPEND -L\C:\external\armadillo-10.1.0\build\Debug\armadillo.lib) list(APPEND DIRS {{cookiecutter.repo_name}}Utils) list(APPEND DIRS LAPACK::LAPACK) list(APPEND DIRS OpenBLAS::OpenBLAS) From 03b38f3119476684180ea2822f8a050d993e3b19 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 16:25:14 +0200 Subject: [PATCH 240/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 552b887..f651b6e 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -3,7 +3,7 @@ add_library({{cookiecutter.repo_name}}Utils STATIC {{cookiecutter.repo_name}}Uti add_executable({{cookiecutter.repo_name}} {{cookiecutter.repo_name}}.cpp) set(DIRS fmt::fmt) #list(APPEND DIRS ${ARMADILLO_LIBRARIES}) -list(APPEND -L\C:\external\armadillo-10.1.0\build\Debug\armadillo.lib) +list(APPEND DIRS -L\C:\external\armadillo-10.1.0\build\Debug\armadillo.lib) list(APPEND DIRS {{cookiecutter.repo_name}}Utils) list(APPEND DIRS LAPACK::LAPACK) list(APPEND DIRS OpenBLAS::OpenBLAS) From 8d72a0a3d286c532f24e651c0b83a531754a9f5a Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 16:25:41 +0200 Subject: [PATCH 241/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index f651b6e..da63a76 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -3,7 +3,7 @@ add_library({{cookiecutter.repo_name}}Utils STATIC {{cookiecutter.repo_name}}Uti add_executable({{cookiecutter.repo_name}} {{cookiecutter.repo_name}}.cpp) set(DIRS fmt::fmt) #list(APPEND DIRS ${ARMADILLO_LIBRARIES}) -list(APPEND DIRS -L\C:\external\armadillo-10.1.0\build\Debug\armadillo.lib) +list(APPEND DIRS -LC:\external\armadillo-10.1.0\build\Debug\armadillo.lib) list(APPEND DIRS {{cookiecutter.repo_name}}Utils) list(APPEND DIRS LAPACK::LAPACK) list(APPEND DIRS OpenBLAS::OpenBLAS) From 13f495e012990cbd41c39968cd1daaa995a88426 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 16:27:46 +0200 Subject: [PATCH 242/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index da63a76..062a379 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -3,7 +3,7 @@ add_library({{cookiecutter.repo_name}}Utils STATIC {{cookiecutter.repo_name}}Uti add_executable({{cookiecutter.repo_name}} {{cookiecutter.repo_name}}.cpp) set(DIRS fmt::fmt) #list(APPEND DIRS ${ARMADILLO_LIBRARIES}) -list(APPEND DIRS -LC:\external\armadillo-10.1.0\build\Debug\armadillo.lib) +list(APPEND DIRS -LC:/external/armadillo-10.1.0/build/Debug/armadillo.lib) list(APPEND DIRS {{cookiecutter.repo_name}}Utils) list(APPEND DIRS LAPACK::LAPACK) list(APPEND DIRS OpenBLAS::OpenBLAS) From 8daca9a35dfc31715b56014373467f7ecb6a9d4a Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 16:30:09 +0200 Subject: [PATCH 243/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 062a379..d419381 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,9 +1,9 @@ add_library({{cookiecutter.repo_name}}Utils STATIC {{cookiecutter.repo_name}}Utils.cpp) -#message(STATUS armalibs ${ARMADILLO_LIBRARIES}) +message(STATUS armalibs ${ARMADILLO_LIBRARIES}) add_executable({{cookiecutter.repo_name}} {{cookiecutter.repo_name}}.cpp) set(DIRS fmt::fmt) -#list(APPEND DIRS ${ARMADILLO_LIBRARIES}) -list(APPEND DIRS -LC:/external/armadillo-10.1.0/build/Debug/armadillo.lib) +list(APPEND DIRS ${ARMADILLO_LIBRARIES}) +#list(APPEND DIRS -LC:/external/armadillo-10.1.0/build/Debug/armadillo.lib) list(APPEND DIRS {{cookiecutter.repo_name}}Utils) list(APPEND DIRS LAPACK::LAPACK) list(APPEND DIRS OpenBLAS::OpenBLAS) From 8324595883a5775363d42aa6f151f2d83ad4eaf7 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 16:30:44 +0200 Subject: [PATCH 244/272] Update {{ cookiecutter.project_name }}.cpp --- .../{{ cookiecutter.project_name }}.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp index 986948c..9f0119d 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp @@ -2,7 +2,7 @@ #include <{{ cookiecutter.project_name }}Utils.h> #include //packagemanager downloaded library. //#define ARMA_DONT_USE_WRAPPER -//#define ARMA_USE_LAPACK +#define ARMA_DONT_USE_LAPACK //#define ARMA_USE_BLAS #include //system wide installed package. From fa6f43b09a4238f0a4bd765de8394f637cfeb23f Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 16:33:00 +0200 Subject: [PATCH 245/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index d419381..062a379 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,9 +1,9 @@ add_library({{cookiecutter.repo_name}}Utils STATIC {{cookiecutter.repo_name}}Utils.cpp) -message(STATUS armalibs ${ARMADILLO_LIBRARIES}) +#message(STATUS armalibs ${ARMADILLO_LIBRARIES}) add_executable({{cookiecutter.repo_name}} {{cookiecutter.repo_name}}.cpp) set(DIRS fmt::fmt) -list(APPEND DIRS ${ARMADILLO_LIBRARIES}) -#list(APPEND DIRS -LC:/external/armadillo-10.1.0/build/Debug/armadillo.lib) +#list(APPEND DIRS ${ARMADILLO_LIBRARIES}) +list(APPEND DIRS -LC:/external/armadillo-10.1.0/build/Debug/armadillo.lib) list(APPEND DIRS {{cookiecutter.repo_name}}Utils) list(APPEND DIRS LAPACK::LAPACK) list(APPEND DIRS OpenBLAS::OpenBLAS) From ad50f374ec7b42f61c188be72f3cd29b80b4447d Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 16:41:58 +0200 Subject: [PATCH 246/272] Update {{ cookiecutter.project_name }}.cpp --- .../{{ cookiecutter.project_name }}.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp index 9f0119d..940ad88 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp @@ -1,7 +1,7 @@ #include #include <{{ cookiecutter.project_name }}Utils.h> #include //packagemanager downloaded library. -//#define ARMA_DONT_USE_WRAPPER +#define ARMA_DONT_USE_WRAPPER #define ARMA_DONT_USE_LAPACK //#define ARMA_USE_BLAS #include //system wide installed package. From 38d66413be870adea468a90e134e1b7bf6b6a249 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 16:48:15 +0200 Subject: [PATCH 247/272] Update CMakeLists.txt --- .../src/{{cookiecutter.repo_name}}/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt index 062a379..d419381 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -1,9 +1,9 @@ add_library({{cookiecutter.repo_name}}Utils STATIC {{cookiecutter.repo_name}}Utils.cpp) -#message(STATUS armalibs ${ARMADILLO_LIBRARIES}) +message(STATUS armalibs ${ARMADILLO_LIBRARIES}) add_executable({{cookiecutter.repo_name}} {{cookiecutter.repo_name}}.cpp) set(DIRS fmt::fmt) -#list(APPEND DIRS ${ARMADILLO_LIBRARIES}) -list(APPEND DIRS -LC:/external/armadillo-10.1.0/build/Debug/armadillo.lib) +list(APPEND DIRS ${ARMADILLO_LIBRARIES}) +#list(APPEND DIRS -LC:/external/armadillo-10.1.0/build/Debug/armadillo.lib) list(APPEND DIRS {{cookiecutter.repo_name}}Utils) list(APPEND DIRS LAPACK::LAPACK) list(APPEND DIRS OpenBLAS::OpenBLAS) From 0e05cdabaaae3e9a43844185ef267b2dc39a918f Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 16:48:55 +0200 Subject: [PATCH 248/272] Update {{ cookiecutter.project_name }}.cpp --- .../{{ cookiecutter.project_name }}.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp index 940ad88..b97f197 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp @@ -2,6 +2,7 @@ #include <{{ cookiecutter.project_name }}Utils.h> #include //packagemanager downloaded library. #define ARMA_DONT_USE_WRAPPER +#define ARMA DONT_USE_BLAS #define ARMA_DONT_USE_LAPACK //#define ARMA_USE_BLAS #include //system wide installed package. From 3dd81eb071b240697e3a03a7c991a885138e48c3 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 16:49:12 +0200 Subject: [PATCH 249/272] Update {{ cookiecutter.project_name }}.cpp --- .../{{ cookiecutter.project_name }}.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp index b97f197..0bf8896 100644 --- a/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp +++ b/{{cookiecutter.repo_name}}/src/{{cookiecutter.repo_name}}/{{ cookiecutter.project_name }}.cpp @@ -2,7 +2,7 @@ #include <{{ cookiecutter.project_name }}Utils.h> #include //packagemanager downloaded library. #define ARMA_DONT_USE_WRAPPER -#define ARMA DONT_USE_BLAS +#define ARMA_DONT_USE_BLAS #define ARMA_DONT_USE_LAPACK //#define ARMA_USE_BLAS #include //system wide installed package. From d7626ad4b3f702b9ec27c62dde4e32a537fd86de Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 16:59:30 +0200 Subject: [PATCH 250/272] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 6534097..28c01d1 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,9 @@ Boilerplate pmm project: https://github.com/ariveron/boilerplate-pmm-vcpkg-cmake CMake Example: https://github.com/dev-cafe/cmake-cookbook/blob/master/chapter-10/recipe-01/cxx-example/CMakeLists.txt +Note: currently the vcpkg version of armadillo is not compiled using any wrappers. Therefore they must be explicitly disabled in the scripts that use them. +instead vcpkg versions of openblas and lapack are linked explicitly. + Usage: ------ From 150ecaeccb3f8915acf238b34b4b70589f249a7e Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 16:59:54 +0200 Subject: [PATCH 251/272] Update README.md --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 28c01d1..b40ffd0 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,6 @@ cookiecutter-cpp ================ -PROBLEM!! -I don't get the Armadillo library installed from VCPKG working, while an apt install in linux of libarmadillo-dev works as a charm. The vcpkg version does not get properly linked. - - A test-driven C++ project template built on CMake and GoogleTest CMake is a fast and easy build tool. From 74abe698986fbd4a340ff60f98166b945cd2bd2d Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 17:01:05 +0200 Subject: [PATCH 252/272] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b40ffd0..623cf55 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ cookiecutter-cpp ================ -A test-driven C++ project template built on CMake and GoogleTest +A test-driven C++ project template built on CMake and GoogleTest, that uses Armadillo as an example. CMake is a fast and easy build tool. Use of GoogleTest test ensures robust code. @@ -15,8 +15,8 @@ Boilerplate pmm project: https://github.com/ariveron/boilerplate-pmm-vcpkg-cmake CMake Example: https://github.com/dev-cafe/cmake-cookbook/blob/master/chapter-10/recipe-01/cxx-example/CMakeLists.txt -Note: currently the vcpkg version of armadillo is not compiled using any wrappers. Therefore they must be explicitly disabled in the scripts that use them. -instead vcpkg versions of openblas and lapack are linked explicitly. +Note: currently the Vcpkg version of Armadillo is not compiled using any wrappers. Therefore they must be explicitly disabled in the scripts that use them. +instead Vcpkg versions of OpenBLAS and LAPACK are linked explicitly. Usage: ------ From a1b5d6c2649a3ee6ec209702451739e41fe523b4 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 17:02:23 +0200 Subject: [PATCH 253/272] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 623cf55..16e4199 100644 --- a/README.md +++ b/README.md @@ -30,5 +30,5 @@ Usage: $ ../bin/main $ make install - +This template is tested on Windows (using msvc compiler) and Linux (using clang) From 761057ec0470a53ac0ccdf343e880f69356471e3 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 17:06:38 +0200 Subject: [PATCH 254/272] Update README.md --- README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 16e4199..5871fa8 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ CMake Example: https://github.com/dev-cafe/cmake-cookbook/blob/master/chapter-10 Note: currently the Vcpkg version of Armadillo is not compiled using any wrappers. Therefore they must be explicitly disabled in the scripts that use them. instead Vcpkg versions of OpenBLAS and LAPACK are linked explicitly. -Usage: +Linux: ------ $ pip install cookiecutter @@ -29,6 +29,13 @@ Usage: $ ctest -vv $ ../bin/main $ make install - + +Windows: +------ + $ pip install cookiecutter + $ python -m cookiecutter gh:reinout91/cookiecutter-cpp + $ cd {project dir}/build + $ cmake .. + $ cmake --build . This template is tested on Windows (using msvc compiler) and Linux (using clang) - + From 465a68eca88a3def4edbade1f084d57f1cfa9924 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 18:14:39 +0200 Subject: [PATCH 255/272] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5871fa8..6e05e58 100644 --- a/README.md +++ b/README.md @@ -31,11 +31,14 @@ Linux: $ make install Windows: +note: add C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin (or similar) to PATH (edit environment settings) + ------ $ pip install cookiecutter $ python -m cookiecutter gh:reinout91/cookiecutter-cpp $ cd {project dir}/build $ cmake .. - $ cmake --build . + $ MSBuild.exe {project name}.sln /property:Configuration=Debug + This template is tested on Windows (using msvc compiler) and Linux (using clang) From a66adbffaf838b9d3ab7492a470ddd5f5d69fe3b Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 18:16:03 +0200 Subject: [PATCH 256/272] Delete README.md --- {{cookiecutter.repo_name}}/README.md | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 {{cookiecutter.repo_name}}/README.md diff --git a/{{cookiecutter.repo_name}}/README.md b/{{cookiecutter.repo_name}}/README.md deleted file mode 100644 index e604702..0000000 --- a/{{cookiecutter.repo_name}}/README.md +++ /dev/null @@ -1,7 +0,0 @@ -{{ cookiecutter.project_name }} -{{ '=' * cookiecutter.project_name | length }} -{{ cookiecutter.description }} - -[![Build Status] - (https://travis-ci.org/{{ cookiecutter.username }}/{{ cookiecutter.repo_name }}.svg)] - (https://travis-ci.org/{{ cookiecutter.username }}/{{ cookiecutter.repo_name }}) From c8fdb9befeac9f989bf08a94762709a3b59a1f61 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 18:16:52 +0200 Subject: [PATCH 257/272] Delete lib.txt --- {{cookiecutter.repo_name}}/lib/lib.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 {{cookiecutter.repo_name}}/lib/lib.txt diff --git a/{{cookiecutter.repo_name}}/lib/lib.txt b/{{cookiecutter.repo_name}}/lib/lib.txt deleted file mode 100644 index 4670f82..0000000 --- a/{{cookiecutter.repo_name}}/lib/lib.txt +++ /dev/null @@ -1 +0,0 @@ -This is the lib folder From 10ffb600b5497cbf040ace098e91d4ad6375784e Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 18:17:07 +0200 Subject: [PATCH 258/272] Delete bin.txt --- {{cookiecutter.repo_name}}/bin/bin.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 {{cookiecutter.repo_name}}/bin/bin.txt diff --git a/{{cookiecutter.repo_name}}/bin/bin.txt b/{{cookiecutter.repo_name}}/bin/bin.txt deleted file mode 100644 index 13aef47..0000000 --- a/{{cookiecutter.repo_name}}/bin/bin.txt +++ /dev/null @@ -1 +0,0 @@ -application folder From 781041936fb95f85d57b085b5ee976b9703c66c5 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 18:18:33 +0200 Subject: [PATCH 259/272] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6e05e58..febf71f 100644 --- a/README.md +++ b/README.md @@ -31,9 +31,9 @@ Linux: $ make install Windows: +------ note: add C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin (or similar) to PATH (edit environment settings) ------- $ pip install cookiecutter $ python -m cookiecutter gh:reinout91/cookiecutter-cpp $ cd {project dir}/build From ef3443876996aea9eb8e478429318b0d4d91be46 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 18:19:27 +0200 Subject: [PATCH 260/272] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index febf71f..2f02a31 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,7 @@ Boilerplate pmm project: https://github.com/ariveron/boilerplate-pmm-vcpkg-cmake CMake Example: https://github.com/dev-cafe/cmake-cookbook/blob/master/chapter-10/recipe-01/cxx-example/CMakeLists.txt -Note: currently the Vcpkg version of Armadillo is not compiled using any wrappers. Therefore they must be explicitly disabled in the scripts that use them. -instead Vcpkg versions of OpenBLAS and LAPACK are linked explicitly. +Note: currently the Vcpkg version of Armadillo is not compiled using any wrappers. Therefore they must be explicitly disabled in the scripts that use them. Vcpkg versions of OpenBLAS and LAPACK are linked explicitly. Linux: ------ From db304962d6f313f6cbb3911de7f2c54756d80c07 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 18:24:46 +0200 Subject: [PATCH 261/272] Update gtest.cmake --- {{cookiecutter.repo_name}}/external/gtest.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/external/gtest.cmake b/{{cookiecutter.repo_name}}/external/gtest.cmake index f28bc56..58737fd 100644 --- a/{{cookiecutter.repo_name}}/external/gtest.cmake +++ b/{{cookiecutter.repo_name}}/external/gtest.cmake @@ -7,8 +7,8 @@ include(ExternalProject) # Fetch GoogleTest remotely ExternalProject_Add( gtest - URL https://github.com/google/googletest/archive/release-1.7.0.zip - URL_MD5 ef5e700c8a0f3ee123e2e0209b8b4961 + URL https://github.com/google/googletest/archive/release-1.10.0.zip + URL_MD5 703bd9caab50b139428cea1aaff9974ebee5742e PREFIX ${CMAKE_CURRENT_BINARY_DIR} # Disable INSTALL INSTALL_COMMAND "" From 98f0480301e9acbb564d7cecc9c799a09066aee2 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 18:31:34 +0200 Subject: [PATCH 262/272] Update gtest.cmake --- {{cookiecutter.repo_name}}/external/gtest.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.repo_name}}/external/gtest.cmake b/{{cookiecutter.repo_name}}/external/gtest.cmake index 58737fd..a0b033e 100644 --- a/{{cookiecutter.repo_name}}/external/gtest.cmake +++ b/{{cookiecutter.repo_name}}/external/gtest.cmake @@ -8,7 +8,7 @@ include(ExternalProject) ExternalProject_Add( gtest URL https://github.com/google/googletest/archive/release-1.10.0.zip - URL_MD5 703bd9caab50b139428cea1aaff9974ebee5742e + URL_MD5 82358affdd7ab94854c8ee73a180fc53 PREFIX ${CMAKE_CURRENT_BINARY_DIR} # Disable INSTALL INSTALL_COMMAND "" From ccbf50aca31cbdf4ddfd7870344c9e3bdb43a8ff Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 19:32:45 +0200 Subject: [PATCH 263/272] Update CMakeLists.txt --- {{cookiecutter.repo_name}}/CMakeLists.txt | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.repo_name}}/CMakeLists.txt b/{{cookiecutter.repo_name}}/CMakeLists.txt index 2caaf8e..e81aa69 100644 --- a/{{cookiecutter.repo_name}}/CMakeLists.txt +++ b/{{cookiecutter.repo_name}}/CMakeLists.txt @@ -70,10 +70,17 @@ add_subdirectory(external) include_directories(${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/src/{{cookiecutter.project_name}} ) # Outsource the actual processing to folders. add_subdirectory(src) + # Must be in the top-most CMakeLists.txt file. -enable_testing() -# Outsource tests to another folder. -add_subdirectory(test) +# testing +enable_testing () +option ({{ cookiecutter.project_name|upper }}_BUILD_TESTS "Build test programs" ON) +if ({{ cookiecutter.project_name|upper }}_BUILD_TESTS) + add_subdirectory (test) +endif () + + + add_subdirectory(doc) # Prepare RPATH From 42651ba1857e55765cb97272c749fad26edff191 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 20:31:48 +0200 Subject: [PATCH 264/272] FIXED googletest issues due to update to new version --- {{cookiecutter.repo_name}}/external/gtest.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/{{cookiecutter.repo_name}}/external/gtest.cmake b/{{cookiecutter.repo_name}}/external/gtest.cmake index a0b033e..1ea0d8a 100644 --- a/{{cookiecutter.repo_name}}/external/gtest.cmake +++ b/{{cookiecutter.repo_name}}/external/gtest.cmake @@ -1,6 +1,6 @@ # GoogleTest (gtest) # A unit testing library for C/C++ -# Creates a libgtest target packaged with the required include driectories +# Creates a libgtest target packaged with the required include directories find_package(Threads REQUIRED) include(ExternalProject) @@ -18,9 +18,9 @@ add_dependencies(libgtest gtest) # Setup the build tree and package the target ExternalProject_Get_Property(gtest SOURCE_DIR BINARY_DIR) -file(MAKE_DIRECTORY ${SOURCE_DIR}/include) +file(MAKE_DIRECTORY ${SOURCE_DIR}/googletest/include) set_target_properties(libgtest PROPERTIES - "IMPORTED_LOCATION" "${BINARY_DIR}/libgtest.a" + "IMPORTED_LOCATION" "${BINARY_DIR}/lib/libgtest.a" "IMPORTED_LINK_INTERFACE_LIBRARIES" "${CMAKE_THREAD_LIBS_INIT}" - "INTERFACE_INCLUDE_DIRECTORIES" "${SOURCE_DIR}/include" + "INTERFACE_INCLUDE_DIRECTORIES" "${SOURCE_DIR}/googletest/include" ) From 491023b0862c3ec70d7907d6c0f9d4a1d55213a4 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 15 Oct 2020 21:36:10 +0200 Subject: [PATCH 265/272] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2f02a31..df7b117 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Linux: $ ../bin/main $ make install -Windows: +Windows: (TESTS DON'T COMPILE YET!) ------ note: add C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin (or similar) to PATH (edit environment settings) From 9198649070b6654fb6995b65a01b3dea13025fb4 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 3 Jan 2021 14:20:49 +0100 Subject: [PATCH 266/272] Update README.md --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index df7b117..481c7c1 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,13 @@ CMake Example: https://github.com/dev-cafe/cmake-cookbook/blob/master/chapter-10 Note: currently the Vcpkg version of Armadillo is not compiled using any wrappers. Therefore they must be explicitly disabled in the scripts that use them. Vcpkg versions of OpenBLAS and LAPACK are linked explicitly. +```cpp +#define ARMA_DONT_USE_WRAPPER +#define ARMA_DONT_USE_BLAS +#define ARMA_DONT_USE_LAPACK +//#define ARMA_USE_BLAS +#include //system wide installed package. + Linux: ------ From 1cdd529a6e3e8e0a61e51315c5a8dd4759c591ef Mon Sep 17 00:00:00 2001 From: reinout91 Date: Sun, 3 Jan 2021 14:21:05 +0100 Subject: [PATCH 267/272] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 481c7c1..d292631 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ Note: currently the Vcpkg version of Armadillo is not compiled using any wrapper #define ARMA_DONT_USE_LAPACK //#define ARMA_USE_BLAS #include //system wide installed package. +``` Linux: ------ From c6be71ce374ad032ff661ceec77ddfce19aa93b9 Mon Sep 17 00:00:00 2001 From: reinout91 Date: Thu, 18 Feb 2021 19:43:59 +0100 Subject: [PATCH 268/272] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d292631..531be48 100644 --- a/README.md +++ b/README.md @@ -47,5 +47,5 @@ note: add C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\ $ cmake .. $ MSBuild.exe {project name}.sln /property:Configuration=Debug -This template is tested on Windows (using msvc compiler) and Linux (using clang) +This template was tested on Windows (using msvc compiler) and Linux (using clang) From 4b35ff81802d80c10a3348faa0b6166ca4982312 Mon Sep 17 00:00:00 2001 From: Reinout Holtrup Date: Wed, 10 Jun 2026 13:28:56 +0200 Subject: [PATCH 269/272] add lb --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 531be48..ca14ce4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ cookiecutter-cpp ================ + A test-driven C++ project template built on CMake and GoogleTest, that uses Armadillo as an example. CMake is a fast and easy build tool. From 36bc5eedbe8746fb87e520f89d9672e531a4e56b Mon Sep 17 00:00:00 2001 From: Reinout Holtrup Date: Wed, 10 Jun 2026 13:30:30 +0200 Subject: [PATCH 270/272] remove lb --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index ca14ce4..531be48 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ cookiecutter-cpp ================ - A test-driven C++ project template built on CMake and GoogleTest, that uses Armadillo as an example. CMake is a fast and easy build tool. From 1d4f83538ceff62f0568296a59c14a2c9793c855 Mon Sep 17 00:00:00 2001 From: Reinout Holtrup Date: Wed, 10 Jun 2026 13:42:58 +0200 Subject: [PATCH 271/272] add two lbs --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 531be48..f5f10cb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ cookiecutter-cpp ================ + + A test-driven C++ project template built on CMake and GoogleTest, that uses Armadillo as an example. CMake is a fast and easy build tool. From b6a88ff370f6987f9373998efac3fe1ee08dc9fe Mon Sep 17 00:00:00 2001 From: Reinout Holtrup Date: Wed, 10 Jun 2026 14:14:22 +0200 Subject: [PATCH 272/272] add lb again --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f5f10cb..11850b7 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ cookiecutter-cpp + A test-driven C++ project template built on CMake and GoogleTest, that uses Armadillo as an example. CMake is a fast and easy build tool.