cppiniter 1.0.4__tar.gz → 1.0.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. {cppiniter-1.0.4 → cppiniter-1.0.6}/LICENSE +1 -1
  2. {cppiniter-1.0.4/cppiniter.egg-info → cppiniter-1.0.6}/PKG-INFO +1 -3
  3. {cppiniter-1.0.4 → cppiniter-1.0.6}/README.md +13 -7
  4. {cppiniter-1.0.4 → cppiniter-1.0.6}/cppiniter/cppiniter.py +11 -3
  5. {cppiniter-1.0.4 → cppiniter-1.0.6}/cppiniter/files/.clang-format +5 -2
  6. cppiniter-1.0.6/cppiniter/files/.clang-tidy +16 -0
  7. cppiniter-1.0.6/cppiniter/files/.gitignore +92 -0
  8. cppiniter-1.0.6/cppiniter/files/CMakeLists.txt +76 -0
  9. cppiniter-1.0.6/cppiniter/files/CMakeSettings.json +48 -0
  10. cppiniter-1.0.6/cppiniter/files/conanfile.py +70 -0
  11. {cppiniter-1.0.4 → cppiniter-1.0.6}/cppiniter/files/src/CMakeLists.txt +14 -6
  12. cppiniter-1.0.6/cppiniter/files/test/CMakeLists.txt +17 -0
  13. cppiniter-1.0.4/cppiniter/files/test/main_cpp → cppiniter-1.0.6/cppiniter/files/test/main.cpp +2 -2
  14. cppiniter-1.0.6/cppiniter/files/version.properties +4 -0
  15. {cppiniter-1.0.4 → cppiniter-1.0.6/cppiniter.egg-info}/PKG-INFO +1 -3
  16. {cppiniter-1.0.4 → cppiniter-1.0.6}/cppiniter.egg-info/SOURCES.txt +5 -2
  17. {cppiniter-1.0.4 → cppiniter-1.0.6}/cppiniter.egg-info/entry_points.txt +0 -1
  18. {cppiniter-1.0.4 → cppiniter-1.0.6}/setup.py +1 -1
  19. cppiniter-1.0.4/cppiniter/files/.gitignore +0 -589
  20. cppiniter-1.0.4/cppiniter/files/CMakeLists.txt +0 -55
  21. cppiniter-1.0.4/cppiniter/files/conanfile.txt +0 -5
  22. cppiniter-1.0.4/cppiniter/files/test/CMakeLists.txt +0 -16
  23. {cppiniter-1.0.4 → cppiniter-1.0.6}/MANIFEST.in +0 -0
  24. {cppiniter-1.0.4 → cppiniter-1.0.6}/cppiniter/__init__.py +0 -0
  25. {cppiniter-1.0.4 → cppiniter-1.0.6}/cppiniter/files/README.md +0 -0
  26. {cppiniter-1.0.4 → cppiniter-1.0.6}/cppiniter/files/src/main.cpp +0 -0
  27. {cppiniter-1.0.4 → cppiniter-1.0.6}/cppiniter.egg-info/dependency_links.txt +0 -0
  28. {cppiniter-1.0.4 → cppiniter-1.0.6}/cppiniter.egg-info/requires.txt +0 -0
  29. {cppiniter-1.0.4 → cppiniter-1.0.6}/cppiniter.egg-info/top_level.txt +0 -0
  30. {cppiniter-1.0.4 → cppiniter-1.0.6}/setup.cfg +0 -0
@@ -1,4 +1,4 @@
1
- Copyright (c) 2020 xyz1001
1
+ Copyright (c) 2022 xyz1001
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
@@ -1,16 +1,14 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cppiniter
3
- Version: 1.0.4
3
+ Version: 1.0.6
4
4
  Summary: C++项目脚手架
5
5
  Home-page: https://github.com/xyz1001/cppiniter
6
6
  Author: xyz1001
7
7
  Author-email: zgzf1001@gmail.com
8
8
  License: MIT
9
9
  Keywords: c++ scaffolding
10
- Platform: UNKNOWN
11
10
  Classifier: License :: OSI Approved :: MIT License
12
11
  Classifier: Programming Language :: Python :: 3
13
12
  License-File: LICENSE
14
13
 
15
14
  用于提供C++项目开发环境的初始化
16
-
@@ -3,9 +3,11 @@
3
3
  该项目用于提供C++项目开发环境的初始化。特点为:
4
4
 
5
5
  1. 使用 cmake 构建
6
- 2. 使用 conan 进行包管理
6
+ 2. 使用 conan2 进行包管理
7
7
  3. 使用 google 编码规范
8
- 4. 使用 catch2 作为单元测试
8
+ 4. 使用 doctest 作为单元测试
9
+ 4. 使用 clang-format 作为格式化工具
10
+ 4. 使用 clang-tidy 作为静态代码检查工具
9
11
 
10
12
  何为脚手架?见[脚手架是什么?](https://stackoverflow.com/questions/235018/what-is-scaffolding-is-it-a-term-for-a-particular-platform)
11
13
 
@@ -32,13 +34,17 @@ Options:
32
34
  ```
33
35
  project
34
36
 
35
- ├── .clang-format # clang format 格式化配置
37
+ ├── .clang-format # clang-format 格式化配置
38
+
39
+ ├── .clang-tidy # clang-tidy 静态代码检查配置
36
40
 
37
41
  ├── .gitignore # git 忽略文件
38
42
 
39
43
  ├── CMakeLists.txt # 顶层 CMake 构建脚本
40
44
 
41
- ├── conanfile.txt # conan 包依赖配置
45
+ ├── CMakeSettings.json # Visual Studio CMake 配置
46
+
47
+ ├── conanfile.py # conan 包依赖配置
42
48
 
43
49
  ├── README.md # 用来介绍这个项目
44
50
 
@@ -48,14 +54,14 @@ project
48
54
  │ │
49
55
  │   └── main.cpp
50
56
 
51
- ├── test # 所有的测试文件应该放在这个目录下面
57
+ ├── test # 所有的单元测试文件应该放在这个目录下面
52
58
  │ │
53
59
  │   ├── CMakeLists.txt
54
60
  │ │
55
- │   └── main_cpp # 加快catch2的编译速度
61
+ │   └── main.cpp # 加快doctest的编译速度
56
62
 
57
63
  ├── doc # 文档保存目录
58
64
 
59
65
  └── build # 我们应该保持一棵干净的源码树,所有编译动作应该单独在这个目录进行。这个目录应加入gitignore
60
66
 
61
- └── out # 在没有指定安装目录时默认安装目录,避免安装到系统目录。
67
+ └── install # 在没有指定安装目录时默认安装目录,避免安装到系统目录。
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env python3
2
2
  # -*- coding: utf-8 -*-
3
+
3
4
  """cppiniter init a cpp project struction
4
5
 
5
6
  Usage:
@@ -17,6 +18,7 @@ import shutil
17
18
  import inquirer
18
19
  import pystache
19
20
  import subprocess
21
+ import platform
20
22
  from docopt import docopt
21
23
  from datetime import datetime
22
24
 
@@ -79,12 +81,18 @@ def preprocess(args):
79
81
  os.mkdir(project_dir)
80
82
  else:
81
83
  exit(-1)
82
- return {"project_name": project_name, "project_dir": project_dir, "is_lib": is_lib, "date_time": date_time, "author": author, "email": email}
84
+
85
+ project_name_uppercase = project_name.upper()
86
+ project_name_camelcase = ''.join(project_name.title() for word in project_name.split('_'))
87
+ return {"project_name": project_name, "project_name_uppercase": project_name_uppercase, "project_name_camelcase": project_name_camelcase, "project_dir": project_dir, "is_lib": is_lib, "date_time": date_time, "author": author, "email": email}
83
88
 
84
89
 
85
90
  def execute(dir):
86
- subprocess.run(["conan", "install", ".."], cwd=os.path.join(dir, "build"))
87
- subprocess.run(["cmake", ".."], cwd=os.path.join(dir, "build"))
91
+ subprocess.run(["conan", "install", "..", "-s:h", "build_type=Debug", "--build", "missing"], cwd=os.path.join(dir, "build"))
92
+ if platform.system() == "Windows":
93
+ subprocess.run(["cmake","--preset=conan-default"], cwd=dir)
94
+ else:
95
+ subprocess.run(["cmake","--preset=conan-debug"], cwd=dir)
88
96
 
89
97
 
90
98
  def main():
@@ -1,5 +1,4 @@
1
1
  ---
2
- Language: Cpp
3
2
  BasedOnStyle: Google
4
3
  AccessModifierOffset: -4
5
4
  AlignAfterOpenBracket: true
@@ -9,7 +8,7 @@ AlignEscapedNewlinesLeft: true
9
8
  AlignOperands: true
10
9
  AlignTrailingComments: true
11
10
  AllowAllParametersOfDeclarationOnNextLine: false
12
- AllowShortBlocksOnASingleLine: true
11
+ AllowShortBlocksOnASingleLine: false
13
12
  AllowShortCaseLabelsOnASingleLine: false
14
13
  AllowShortFunctionsOnASingleLine: Empty
15
14
  AllowShortIfStatementsOnASingleLine: true
@@ -65,5 +64,9 @@ Standard: Auto
65
64
  TabWidth: 8
66
65
  UseTab: Never
67
66
  IncludeBlocks: Preserve
67
+ ---
68
+ Language: Cpp
69
+ ---
70
+ Language: ObjC
68
71
  ...
69
72
 
@@ -0,0 +1,16 @@
1
+ Checks: "*,
2
+ -abseil-*,
3
+ -altera-*,
4
+ -android-*,
5
+ -fuchsia-*,
6
+ -zircon-*,
7
+ -llvmlibc-*,
8
+ -modernize-use-trailing-return-type,
9
+ -readability-redundant-access-specifiers,
10
+ -hicpp-special-member-functions,
11
+ -readability-identifier-length,
12
+ -misc-no-recursion,
13
+ "
14
+ WarningsAsErrors: ''
15
+ HeaderFilterRegex: ''
16
+ FormatStyle: file
@@ -0,0 +1,92 @@
1
+ # CMake files
2
+ CMakeCache.txt
3
+ CMakeFiles
4
+ CMakeScripts
5
+ Testing
6
+ Makefile
7
+ cmake_install.cmake
8
+ install_manifest.txt
9
+ compile_commands.json
10
+ CTestTestfile.cmake
11
+ CMakeUserPresets.json
12
+
13
+ # Prerequisites
14
+ *.d
15
+
16
+ # Compiled Object files
17
+ *.slo
18
+ *.lo
19
+ *.o
20
+ *.obj
21
+
22
+ # Precompiled Headers
23
+ *.gch
24
+ *.pch
25
+
26
+ # Compiled Dynamic libraries
27
+ *.so
28
+ *.dylib
29
+ *.dll
30
+
31
+ # Fortran module files
32
+ *.mod
33
+ *.smod
34
+
35
+ # Compiled Static libraries
36
+ *.lai
37
+ *.la
38
+ *.a
39
+ *.lib
40
+
41
+ # Executables
42
+ *.exe
43
+ *.out
44
+ *.app
45
+
46
+ # Qt-es
47
+
48
+ /.qmake.cache
49
+ /.qmake.stash
50
+ *.pro.user
51
+ *.pro.user.*
52
+ *.qbs.user
53
+ *.qbs.user.*
54
+ *.moc
55
+ moc_*.cpp
56
+ moc_*.h
57
+ qrc_*.cpp
58
+ ui_*.h
59
+ Makefile*
60
+ *build-*
61
+ build/
62
+
63
+ # QtCreator
64
+
65
+ *.autosave
66
+
67
+ # QtCtreator Qml
68
+ *.qmlproject.user
69
+ *.qmlproject.user.*
70
+
71
+ # QtCtreator CMake
72
+ CMakeLists.txt.user*
73
+
74
+ # vim
75
+ *.swp
76
+ *.swn
77
+ *.swo
78
+
79
+ # some backup file
80
+ *~
81
+
82
+ # output dir
83
+ out/
84
+
85
+ # vs
86
+ .VsCodeCounter/
87
+ .vs/
88
+ .vscode/
89
+ enc_temp_folder/
90
+
91
+ # clang
92
+ .cache/
@@ -0,0 +1,76 @@
1
+ ######################################################################
2
+ # Automatically generated by cppiniter {{{date_time}}}
3
+ ######################################################################
4
+
5
+ cmake_minimum_required (VERSION 3.23)
6
+ project ({{{project_name}}})
7
+
8
+ include(GNUInstallDirs)
9
+
10
+ if(NOT DEFINED VERSION_NAME)
11
+ file(READ "version.properties" versions)
12
+
13
+ string(REGEX MATCH "MAJOR_VERSION=([0-9]*)" _ ${versions})
14
+ set(MAJOR_VERSION ${CMAKE_MATCH_1})
15
+
16
+ string(REGEX MATCH "MINOR_VERSION=([0-9]*)" _ ${versions})
17
+ set(MINOR_VERSION ${CMAKE_MATCH_1})
18
+
19
+ string(REGEX MATCH "PATCH_VERSION=([0-9]*)" _ ${versions})
20
+ set(PATCH_VERSION ${CMAKE_MATCH_1})
21
+
22
+ set(VERSION_NAME "T.${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}.0")
23
+ endif()
24
+ message(STATUS "${PROJECT_NAME} version ${VERSION_NAME}")
25
+ add_definitions(-DVERSION_NAME="${VERSION_NAME}")
26
+
27
+ set(CMAKE_CXX_STANDARD 17)
28
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
29
+ set(CMAKE_CXX_EXTENSIONS OFF)
30
+
31
+ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
32
+ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
33
+
34
+ set(CMAKE_C_VISIBILITY_PRESET hidden)
35
+ set(CMAKE_CXX_VISIBILITY_PRESET hidden)
36
+ set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
37
+
38
+ if(WIN32)
39
+ add_definitions(-DWINVER=0x0601)
40
+ add_definitions(-D_WIN32_WINNT=0x0601)
41
+ endif()
42
+
43
+
44
+ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
45
+ set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_DEBUG} -Og -g3 -Werror -Wall -Wextra -Wno-sign-compare")
46
+ set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_RELEASE} -O2")
47
+ elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
48
+ set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_DEBUG} -Og -g3 -Werror -Wall -Wextra -Wno-sign-compare")
49
+ set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_RELEASE} -O2")
50
+ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
51
+ add_definitions(-D_SCL_SECURE_NO_WARNINGS=1)
52
+ add_definitions(-D_CRT_SECURE_NO_WARNINGS=1)
53
+
54
+ set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD TRUE)
55
+
56
+ string (REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
57
+ set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS} /EHsc /utf-8 /MP /Zc:__cplusplus")
58
+ set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_DEBUG} /WX /wd4244 /wd4018 /wd4267 /wd4307")
59
+ set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_RELEASE} /Zi")
60
+
61
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
62
+ set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
63
+ endif()
64
+
65
+ if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
66
+ set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/build/install/ CACHE PATH "default install prefix" FORCE)
67
+ endif()
68
+
69
+ option(BUILD_TEST "build tests" OFF)
70
+
71
+ add_subdirectory(src)
72
+ {{#is_lib}}
73
+ if(BUILD_TEST)
74
+ add_subdirectory (test)
75
+ endif()
76
+ {{/is_lib}}
@@ -0,0 +1,48 @@
1
+ {
2
+ "configurations": [
3
+ {
4
+ "name": "x86-Debug",
5
+ "generator": "Ninja",
6
+ "configurationType": "Debug",
7
+ "inheritEnvironments": ["msvc_x86"],
8
+ "buildRoot": "${workspaceRoot}\\build",
9
+ "installRoot": "${workspaceRoot}\\build\\bin",
10
+ "cmakeCommandArgs": "",
11
+ "buildCommandArgs": "-v",
12
+ "ctestCommandArgs": ""
13
+ },
14
+ {
15
+ "name": "x86-Release",
16
+ "generator": "Ninja",
17
+ "configurationType": "Release",
18
+ "inheritEnvironments": ["msvc_x86"],
19
+ "buildRoot": "${workspaceRoot}\\build",
20
+ "installRoot": "${workspaceRoot}\\build\\bin",
21
+ "cmakeCommandArgs": "",
22
+ "buildCommandArgs": "-v",
23
+ "ctestCommandArgs": ""
24
+ },
25
+ {
26
+ "name": "x64-Debug",
27
+ "generator": "Ninja",
28
+ "configurationType": "Debug",
29
+ "inheritEnvironments": ["msvc_x64"],
30
+ "buildRoot": "${workspaceRoot}\\build",
31
+ "installRoot": "${workspaceRoot}\\build\\bin",
32
+ "cmakeCommandArgs": "",
33
+ "buildCommandArgs": "-v",
34
+ "ctestCommandArgs": ""
35
+ },
36
+ {
37
+ "name": "x64-Release",
38
+ "generator": "Ninja",
39
+ "configurationType": "Release",
40
+ "inheritEnvironments": ["msvc_x64"],
41
+ "buildRoot": "${workspaceRoot}\\build",
42
+ "installRoot": "${workspaceRoot}\\build\\bin",
43
+ "cmakeCommandArgs": "",
44
+ "buildCommandArgs": "-v",
45
+ "ctestCommandArgs": ""
46
+ }
47
+ ]
48
+ }
@@ -0,0 +1,70 @@
1
+ from conan import ConanFile
2
+ from conan.tools.cmake import CMake, cmake_layout, CMakeToolchain, CMakeDeps
3
+ from conan.tools.scm import Git
4
+ from conan.tools.files import update_conandata
5
+ import os
6
+
7
+
8
+ class {{{project_name_camelcase}}}Conan(ConanFile):
9
+ name = "{{{project_name}}}"
10
+ default_user = "bytelloshare"
11
+ package_type = "library"
12
+ author = "{{{author}}} {{{email}}}"
13
+ url = ""
14
+ description = ""
15
+ topics = ("bytelloshare")
16
+ settings = "os", "compiler", "build_type", "arch"
17
+ options = {"shared": [True, False], "test": [True, False]}
18
+ default_options = {"shared": True, "test": False}
19
+
20
+ def _make_version(self):
21
+ type_dict = {"stable": "R", "snapshot": "D", "testing": "T"}
22
+ type = type_dict.get(self.channel, "S")
23
+ hash = os.getenv("GIT_COMMIT", "")[:6]
24
+ return "%s.%s-%s" % (type, self.version, hash)
25
+
26
+ def export(self):
27
+ git = Git(self, self.recipe_folder)
28
+ scm_url, scm_commit = git.get_url_and_commit()
29
+ update_conandata(self, {"sources": {"commit": scm_commit, "url": scm_url}})
30
+
31
+ def source(self):
32
+ git = Git(self)
33
+ sources = self.conan_data["sources"]
34
+ git.clone(url=sources["url"], target=".")
35
+ git.checkout(commit=sources["commit"])
36
+
37
+ def requirements(self):
38
+ self.requires("fmt/10.2.1")
39
+ if self.options.test:
40
+ self.test_requires("doctest/2.4.11")
41
+
42
+ def configure(self):
43
+ pass
44
+
45
+ def layout(self):
46
+ cmake_layout(self)
47
+
48
+ def generate(self):
49
+ tc = CMakeToolchain(self)
50
+ tc.variables["VERSION_NAME"] = self._make_version()
51
+ tc.variables["BUILD_TEST"] = self.options.test
52
+ tc.generate()
53
+
54
+ deps = CMakeDeps(self)
55
+ deps.generate()
56
+
57
+ def build(self):
58
+ cmake = CMake(self)
59
+ cmake.configure()
60
+ cmake.build()
61
+
62
+ def package(self):
63
+ cmake = CMake(self)
64
+ cmake.install()
65
+
66
+ def package_info(self):
67
+ self.cpp_info.libs = ["{{{project_name}}}"]
68
+
69
+ if self.options.shared:
70
+ self.cpp_info.defines = ["{{{project_name_uppercase}}}_DLL"]
@@ -2,17 +2,25 @@
2
2
  # Automatically generated by cppiniter {{{date_time}}}
3
3
  ######################################################################
4
4
 
5
- # source files
6
- aux_source_directory(. SRC)
7
-
8
- # target
9
5
  {{#is_lib}}
10
- add_library({{{project_name}}} SHARED ${SRC})
6
+ add_library({{{project_name}}})
11
7
  {{/is_lib}}
12
8
  {{^is_lib}}
13
- add_executable ({{{project_name}}} ${SRC})
9
+ add_executable({{{project_name}}})
14
10
  {{/is_lib}}
15
11
 
12
+ target_include_directories({{{project_name}}} INTERFACE ${CMAKE_CURRENT_LIST_DIR})
13
+
14
+ file(GLOB SRC "*/*.h"
15
+ "*/*.cpp"
16
+ "*.hpp"
17
+ "*.cpp")
18
+ target_sources({{{project_name}}} PRIVATE ${SRC})
19
+
20
+ find_package(fmt REQUIRED CONFIG)
21
+
22
+ target_link_libraries(${TARGET} fmt::fmt)
23
+
16
24
  target_link_libraries({{{project_name}}} ${CONAN_LIBS})
17
25
 
18
26
  # install
@@ -0,0 +1,17 @@
1
+ ######################################################################
2
+ # Automatically generated by cppiniter {{{date_time}}}
3
+ ######################################################################
4
+
5
+ add_executable(unittest)
6
+
7
+ target_include_directories(unittest INTERFACE ${CMAKE_CURRENT_LIST_DIR})
8
+
9
+ file(GLOB SRC "*/*.h"
10
+ "*/*.cpp"
11
+ "*.hpp"
12
+ "*.cpp")
13
+ target_sources(unittest PRIVATE ${SRC})
14
+
15
+ find_package(doctest REQUIRED CONFIG)
16
+
17
+ target_link_libraries(${TARGET} PRIVATE doctest::doctest {{{project_name}}})
@@ -4,5 +4,5 @@
4
4
  * coding: utf-8
5
5
  */
6
6
 
7
- #define CATCH_CONFIG_MAIN
8
- #include "catch/catch.hpp"
7
+ #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
8
+ #include "doctest/doctest.h"
@@ -0,0 +1,4 @@
1
+ MAJOR_VERSION=0
2
+ MINOR_VERSION=0
3
+ PATCH_VERSION=0
4
+
@@ -1,16 +1,14 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cppiniter
3
- Version: 1.0.4
3
+ Version: 1.0.6
4
4
  Summary: C++项目脚手架
5
5
  Home-page: https://github.com/xyz1001/cppiniter
6
6
  Author: xyz1001
7
7
  Author-email: zgzf1001@gmail.com
8
8
  License: MIT
9
9
  Keywords: c++ scaffolding
10
- Platform: UNKNOWN
11
10
  Classifier: License :: OSI Approved :: MIT License
12
11
  Classifier: Programming Language :: Python :: 3
13
12
  License-File: LICENSE
14
13
 
15
14
  用于提供C++项目开发环境的初始化
16
-
@@ -11,11 +11,14 @@ cppiniter.egg-info/entry_points.txt
11
11
  cppiniter.egg-info/requires.txt
12
12
  cppiniter.egg-info/top_level.txt
13
13
  cppiniter/files/.clang-format
14
+ cppiniter/files/.clang-tidy
14
15
  cppiniter/files/.gitignore
15
16
  cppiniter/files/CMakeLists.txt
17
+ cppiniter/files/CMakeSettings.json
16
18
  cppiniter/files/README.md
17
- cppiniter/files/conanfile.txt
19
+ cppiniter/files/conanfile.py
20
+ cppiniter/files/version.properties
18
21
  cppiniter/files/src/CMakeLists.txt
19
22
  cppiniter/files/src/main.cpp
20
23
  cppiniter/files/test/CMakeLists.txt
21
- cppiniter/files/test/main_cpp
24
+ cppiniter/files/test/main.cpp
@@ -1,3 +1,2 @@
1
1
  [console_scripts]
2
2
  cppiniter = cppiniter.cppiniter:main
3
-
@@ -5,7 +5,7 @@ from setuptools import setup
5
5
 
6
6
  setup(
7
7
  name='cppiniter',
8
- version="1.0.4",
8
+ version="1.0.6",
9
9
  description="C++项目脚手架",
10
10
  long_description="""用于提供C++项目开发环境的初始化""",
11
11
  keywords='c++ scaffolding',
@@ -1,589 +0,0 @@
1
- # CMake files
2
- CMakeCache.txt
3
- CMakeFiles
4
- CMakeScripts
5
- Testing
6
- Makefile
7
- cmake_install.cmake
8
- install_manifest.txt
9
- compile_commands.json
10
- CTestTestfile.cmake
11
-
12
- # Prerequisites
13
- *.d
14
-
15
- # Compiled Object files
16
- *.slo
17
- *.lo
18
- *.o
19
- *.obj
20
-
21
- # Precompiled Headers
22
- *.gch
23
- *.pch
24
-
25
- # Compiled Dynamic libraries
26
- *.so
27
- *.dylib
28
- *.dll
29
-
30
- # Fortran module files
31
- *.mod
32
- *.smod
33
-
34
- # Compiled Static libraries
35
- *.lai
36
- *.la
37
- *.a
38
- *.lib
39
-
40
- # Executables
41
- *.exe
42
- *.out
43
- *.app
44
-
45
- # Qt-es
46
-
47
- /.qmake.cache
48
- /.qmake.stash
49
- *.pro.user
50
- *.pro.user.*
51
- *.qbs.user
52
- *.qbs.user.*
53
- *.moc
54
- moc_*.cpp
55
- moc_*.h
56
- qrc_*.cpp
57
- ui_*.h
58
- Makefile*
59
- *build-*
60
- build/
61
-
62
- # QtCreator
63
-
64
- *.autosave
65
-
66
- # QtCtreator Qml
67
- *.qmlproject.user
68
- *.qmlproject.user.*
69
-
70
- # QtCtreator CMake
71
- CMakeLists.txt.user*
72
-
73
- # vim
74
- *.swp
75
- *.swn
76
- *.swo
77
-
78
- # some backup file
79
- *~
80
-
81
- # Created by https://www.toptal.com/developers/gitignore/api/cmake,c++,vim
82
- # Edit at https://www.toptal.com/developers/gitignore?templates=cmake,c++,vim
83
-
84
- ### C++ ###
85
- # Prerequisites
86
- *.d
87
-
88
- # Compiled Object files
89
- *.slo
90
- *.lo
91
- *.o
92
- *.obj
93
-
94
- # Precompiled Headers
95
- *.gch
96
- *.pch
97
-
98
- # Compiled Dynamic libraries
99
- *.so
100
- *.dylib
101
- *.dll
102
-
103
- # Fortran module files
104
- *.mod
105
- *.smod
106
-
107
- # Compiled Static libraries
108
- *.lai
109
- *.la
110
- *.a
111
- *.lib
112
-
113
- # Executables
114
- *.exe
115
- *.out
116
- *.app
117
-
118
- ### CMake ###
119
- CMakeLists.txt.user
120
- CMakeCache.txt
121
- CMakeFiles
122
- CMakeScripts
123
- Testing
124
- Makefile
125
- cmake_install.cmake
126
- install_manifest.txt
127
- compile_commands.json
128
- CTestTestfile.cmake
129
- _deps
130
-
131
- ### CMake Patch ###
132
- # External projects
133
- *-prefix/
134
-
135
- ### Vim ###
136
- # Swap
137
- [._]*.s[a-v][a-z]
138
- !*.svg # comment out if you don't need vector files
139
- [._]*.sw[a-p]
140
- [._]s[a-rt-v][a-z]
141
- [._]ss[a-gi-z]
142
- [._]sw[a-p]
143
-
144
- # Session
145
- Session.vim
146
- Sessionx.vim
147
-
148
- # Temporary
149
- .netrwhist
150
- *~
151
- # Auto-generated tag files
152
- tags
153
- # Persistent undo
154
- [._]*.un~
155
-
156
- # End of https://www.toptal.com/developers/gitignore/api/cmake,c++,vim
157
- n
158
- # Created by https://www.toptal.com/developers/gitignore/api/cmake,c++,vim,visualstudio
159
- # Edit at https://www.toptal.com/developers/gitignore?templates=cmake,c++,vim,visualstudio
160
-
161
- ### C++ ###
162
- # Prerequisites
163
- *.d
164
-
165
- # Compiled Object files
166
- *.slo
167
- *.lo
168
- *.o
169
- *.obj
170
-
171
- # Precompiled Headers
172
- *.gch
173
- *.pch
174
-
175
- # Compiled Dynamic libraries
176
- *.so
177
- *.dylib
178
- *.dll
179
-
180
- # Fortran module files
181
- *.mod
182
- *.smod
183
-
184
- # Compiled Static libraries
185
- *.lai
186
- *.la
187
- *.a
188
- *.lib
189
-
190
- # Executables
191
- *.exe
192
- *.out
193
- *.app
194
-
195
- ### CMake ###
196
- CMakeLists.txt.user
197
- CMakeCache.txt
198
- CMakeFiles
199
- CMakeScripts
200
- Testing
201
- Makefile
202
- cmake_install.cmake
203
- install_manifest.txt
204
- compile_commands.json
205
- CTestTestfile.cmake
206
- _deps
207
-
208
- ### CMake Patch ###
209
- # External projects
210
- *-prefix/
211
-
212
- ### Vim ###
213
- # Swap
214
- [._]*.s[a-v][a-z]
215
- !*.svg # comment out if you don't need vector files
216
- [._]*.sw[a-p]
217
- [._]s[a-rt-v][a-z]
218
- [._]ss[a-gi-z]
219
- [._]sw[a-p]
220
-
221
- # Session
222
- Session.vim
223
- Sessionx.vim
224
-
225
- # Temporary
226
- .netrwhist
227
- *~
228
- # Auto-generated tag files
229
- tags
230
- # Persistent undo
231
- [._]*.un~
232
-
233
- ### VisualStudio ###
234
- ## Ignore Visual Studio temporary files, build results, and
235
- ## files generated by popular Visual Studio add-ons.
236
- ##
237
- ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
238
-
239
- # User-specific files
240
- *.rsuser
241
- *.suo
242
- *.user
243
- *.userosscache
244
- *.sln.docstates
245
-
246
- # User-specific files (MonoDevelop/Xamarin Studio)
247
- *.userprefs
248
-
249
- # Mono auto generated files
250
- mono_crash.*
251
-
252
- # Build results
253
- [Dd]ebug/
254
- [Dd]ebugPublic/
255
- [Rr]elease/
256
- [Rr]eleases/
257
- x64/
258
- x86/
259
- [Aa][Rr][Mm]/
260
- [Aa][Rr][Mm]64/
261
- bld/
262
- [Bb]in/
263
- [Oo]bj/
264
- [Ll]og/
265
- [Ll]ogs/
266
-
267
- # Visual Studio 2015/2017 cache/options directory
268
- .vs/
269
- # Uncomment if you have tasks that create the project's static files in wwwroot
270
- #wwwroot/
271
-
272
- # Visual Studio 2017 auto generated files
273
- Generated\ Files/
274
-
275
- # MSTest test Results
276
- [Tt]est[Rr]esult*/
277
- [Bb]uild[Ll]og.*
278
-
279
- # NUnit
280
- *.VisualState.xml
281
- TestResult.xml
282
- nunit-*.xml
283
-
284
- # Build Results of an ATL Project
285
- [Dd]ebugPS/
286
- [Rr]eleasePS/
287
- dlldata.c
288
-
289
- # Benchmark Results
290
- BenchmarkDotNet.Artifacts/
291
-
292
- # .NET Core
293
- project.lock.json
294
- project.fragment.lock.json
295
- artifacts/
296
-
297
- # StyleCop
298
- StyleCopReport.xml
299
-
300
- # Files built by Visual Studio
301
- *_i.c
302
- *_p.c
303
- *_h.h
304
- *.ilk
305
- *.meta
306
- *.iobj
307
- *.pdb
308
- *.ipdb
309
- *.pgc
310
- *.pgd
311
- *.rsp
312
- *.sbr
313
- *.tlb
314
- *.tli
315
- *.tlh
316
- *.tmp
317
- *.tmp_proj
318
- *_wpftmp.csproj
319
- *.log
320
- *.vspscc
321
- *.vssscc
322
- .builds
323
- *.pidb
324
- *.svclog
325
- *.scc
326
-
327
- # Chutzpah Test files
328
- _Chutzpah*
329
-
330
- # Visual C++ cache files
331
- ipch/
332
- *.aps
333
- *.ncb
334
- *.opendb
335
- *.opensdf
336
- *.sdf
337
- *.cachefile
338
- *.VC.db
339
- *.VC.VC.opendb
340
-
341
- # Visual Studio profiler
342
- *.psess
343
- *.vsp
344
- *.vspx
345
- *.sap
346
-
347
- # Visual Studio Trace Files
348
- *.e2e
349
-
350
- # TFS 2012 Local Workspace
351
- $tf/
352
-
353
- # Guidance Automation Toolkit
354
- *.gpState
355
-
356
- # ReSharper is a .NET coding add-in
357
- _ReSharper*/
358
- *.[Rr]e[Ss]harper
359
- *.DotSettings.user
360
-
361
- # TeamCity is a build add-in
362
- _TeamCity*
363
-
364
- # DotCover is a Code Coverage Tool
365
- *.dotCover
366
-
367
- # AxoCover is a Code Coverage Tool
368
- .axoCover/*
369
- !.axoCover/settings.json
370
-
371
- # Coverlet is a free, cross platform Code Coverage Tool
372
- coverage*[.json, .xml, .info]
373
-
374
- # Visual Studio code coverage results
375
- *.coverage
376
- *.coveragexml
377
-
378
- # NCrunch
379
- _NCrunch_*
380
- .*crunch*.local.xml
381
- nCrunchTemp_*
382
-
383
- # MightyMoose
384
- *.mm.*
385
- AutoTest.Net/
386
-
387
- # Web workbench (sass)
388
- .sass-cache/
389
-
390
- # Installshield output folder
391
- [Ee]xpress/
392
-
393
- # DocProject is a documentation generator add-in
394
- DocProject/buildhelp/
395
- DocProject/Help/*.HxT
396
- DocProject/Help/*.HxC
397
- DocProject/Help/*.hhc
398
- DocProject/Help/*.hhk
399
- DocProject/Help/*.hhp
400
- DocProject/Help/Html2
401
- DocProject/Help/html
402
-
403
- # Click-Once directory
404
- publish/
405
-
406
- # Publish Web Output
407
- *.[Pp]ublish.xml
408
- *.azurePubxml
409
- # Note: Comment the next line if you want to checkin your web deploy settings,
410
- # but database connection strings (with potential passwords) will be unencrypted
411
- *.pubxml
412
- *.publishproj
413
-
414
- # Microsoft Azure Web App publish settings. Comment the next line if you want to
415
- # checkin your Azure Web App publish settings, but sensitive information contained
416
- # in these scripts will be unencrypted
417
- PublishScripts/
418
-
419
- # NuGet Packages
420
- *.nupkg
421
- # NuGet Symbol Packages
422
- *.snupkg
423
- # The packages folder can be ignored because of Package Restore
424
- **/[Pp]ackages/*
425
- # except build/, which is used as an MSBuild target.
426
- !**/[Pp]ackages/build/
427
- # Uncomment if necessary however generally it will be regenerated when needed
428
- #!**/[Pp]ackages/repositories.config
429
- # NuGet v3's project.json files produces more ignorable files
430
- *.nuget.props
431
- *.nuget.targets
432
-
433
- # Microsoft Azure Build Output
434
- csx/
435
- *.build.csdef
436
-
437
- # Microsoft Azure Emulator
438
- ecf/
439
- rcf/
440
-
441
- # Windows Store app package directories and files
442
- AppPackages/
443
- BundleArtifacts/
444
- Package.StoreAssociation.xml
445
- _pkginfo.txt
446
- *.appx
447
- *.appxbundle
448
- *.appxupload
449
-
450
- # Visual Studio cache files
451
- # files ending in .cache can be ignored
452
- *.[Cc]ache
453
- # but keep track of directories ending in .cache
454
- !?*.[Cc]ache/
455
-
456
- # Others
457
- ClientBin/
458
- ~$*
459
- *.dbmdl
460
- *.dbproj.schemaview
461
- *.jfm
462
- *.pfx
463
- *.publishsettings
464
- orleans.codegen.cs
465
-
466
- # Including strong name files can present a security risk
467
- # (https://github.com/github/gitignore/pull/2483#issue-259490424)
468
- #*.snk
469
-
470
- # Since there are multiple workflows, uncomment next line to ignore bower_components
471
- # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
472
- #bower_components/
473
-
474
- # RIA/Silverlight projects
475
- Generated_Code/
476
-
477
- # Backup & report files from converting an old project file
478
- # to a newer Visual Studio version. Backup files are not needed,
479
- # because we have git ;-)
480
- _UpgradeReport_Files/
481
- Backup*/
482
- UpgradeLog*.XML
483
- UpgradeLog*.htm
484
- ServiceFabricBackup/
485
- *.rptproj.bak
486
-
487
- # SQL Server files
488
- *.mdf
489
- *.ldf
490
- *.ndf
491
-
492
- # Business Intelligence projects
493
- *.rdl.data
494
- *.bim.layout
495
- *.bim_*.settings
496
- *.rptproj.rsuser
497
- *- [Bb]ackup.rdl
498
- *- [Bb]ackup ([0-9]).rdl
499
- *- [Bb]ackup ([0-9][0-9]).rdl
500
-
501
- # Microsoft Fakes
502
- FakesAssemblies/
503
-
504
- # GhostDoc plugin setting file
505
- *.GhostDoc.xml
506
-
507
- # Node.js Tools for Visual Studio
508
- .ntvs_analysis.dat
509
- node_modules/
510
-
511
- # Visual Studio 6 build log
512
- *.plg
513
-
514
- # Visual Studio 6 workspace options file
515
- *.opt
516
-
517
- # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
518
- *.vbw
519
-
520
- # Visual Studio LightSwitch build output
521
- **/*.HTMLClient/GeneratedArtifacts
522
- **/*.DesktopClient/GeneratedArtifacts
523
- **/*.DesktopClient/ModelManifest.xml
524
- **/*.Server/GeneratedArtifacts
525
- **/*.Server/ModelManifest.xml
526
- _Pvt_Extensions
527
-
528
- # Paket dependency manager
529
- .paket/paket.exe
530
- paket-files/
531
-
532
- # FAKE - F# Make
533
- .fake/
534
-
535
- # CodeRush personal settings
536
- .cr/personal
537
-
538
- # Python Tools for Visual Studio (PTVS)
539
- __pycache__/
540
- *.pyc
541
-
542
- # Cake - Uncomment if you are using it
543
- # tools/**
544
- # !tools/packages.config
545
-
546
- # Tabs Studio
547
- *.tss
548
-
549
- # Telerik's JustMock configuration file
550
- *.jmconfig
551
-
552
- # BizTalk build output
553
- *.btp.cs
554
- *.btm.cs
555
- *.odx.cs
556
- *.xsd.cs
557
-
558
- # OpenCover UI analysis results
559
- OpenCover/
560
-
561
- # Azure Stream Analytics local run output
562
- ASALocalRun/
563
-
564
- # MSBuild Binary and Structured Log
565
- *.binlog
566
-
567
- # NVidia Nsight GPU debugger configuration file
568
- *.nvuser
569
-
570
- # MFractors (Xamarin productivity tool) working folder
571
- .mfractor/
572
-
573
- # Local History for Visual Studio
574
- .localhistory/
575
-
576
- # BeatPulse healthcheck temp database
577
- healthchecksdb
578
-
579
- # Backup folder for Package Reference Convert tool in Visual Studio 2017
580
- MigrationBackup/
581
-
582
- # Ionide (cross platform F# VS Code tools) working folder
583
- .ionide/
584
-
585
- # End of https://www.toptal.com/developers/gitignore/api/cmake,c++,vim,visualstudio
586
- n
587
-
588
- build/
589
- out/
@@ -1,55 +0,0 @@
1
- ######################################################################
2
- # Automatically generated by cppiniter {{{date_time}}}
3
- ######################################################################
4
-
5
- cmake_minimum_required(VERSION 3.6)
6
- project ({{{project_name}}})
7
-
8
- if(EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
9
- include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
10
- else()
11
- include(${PROJECT_SOURCE_DIR}/build/conanbuildinfo.cmake)
12
- endif()
13
- conan_basic_setup()
14
-
15
- # include header
16
- include_directories(${PROJECT_SOURCE_DIR}/src)
17
- include_directories(${PROJECT_SOURCE_DIR}/test)
18
-
19
- # c++11
20
- set(CMAKE_CXX_STANDARD 14)
21
- set(CMAKE_CXX_STANDARD_REQUIRED ON)
22
- set(CMAKE_CXX_EXTENSIONS OFF)
23
-
24
- set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
25
-
26
- if(UNIX AND NOT ANDROID AND NOT APPLE)
27
- set(LINUX true)
28
- endif()
29
-
30
- if(MSVC)
31
- add_definitions (-D_SCL_SECURE_NO_WARNINGS=1)
32
- add_definitions (-D_CRT_SECURE_NO_WARNINGS=1)
33
-
34
- set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
35
- set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1)
36
-
37
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /utf-8 /MP")
38
- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
39
- set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
40
- elseif(LINUX)
41
- set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror")
42
- set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_DEBUG} -O0 -Wall -g2 -ggdb")
43
- set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")
44
- endif()
45
-
46
- if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
47
- set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/out CACHE PATH "default install prefix" FORCE)
48
- endif()
49
-
50
- add_subdirectory(src)
51
- {{#is_lib}}
52
- if(BUILD_TEST)
53
- add_subdirectory (test)
54
- endif()
55
- {{/is_lib}}
@@ -1,5 +0,0 @@
1
- [requires]
2
- catch2/2.11.3
3
-
4
- [generators]
5
- cmake
@@ -1,16 +0,0 @@
1
- ######################################################################
2
- # Automatically generated by cppiniter {{{date_time}}}
3
- ######################################################################
4
-
5
- # source files
6
- aux_source_directory(. SRC)
7
-
8
- # target
9
- add_executable (catch ${SRC})
10
-
11
- # link
12
- target_link_libraries(catch {{{project_name}}})
13
-
14
- # install
15
- INSTALL(TARGETS catch
16
- RUNTIME DESTINATION bin)
File without changes
File without changes