cppiniter 1.0.7__tar.gz → 1.1.0__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 (35) hide show
  1. {cppiniter-1.0.7/cppiniter.egg-info → cppiniter-1.1.0}/PKG-INFO +1 -1
  2. {cppiniter-1.0.7 → cppiniter-1.1.0}/README.md +8 -2
  3. {cppiniter-1.0.7 → cppiniter-1.1.0}/cppiniter/cppiniter.py +19 -6
  4. {cppiniter-1.0.7 → cppiniter-1.1.0}/cppiniter/files/.clang-tidy +3 -0
  5. {cppiniter-1.0.7 → cppiniter-1.1.0}/cppiniter/files/CMakeLists.txt +41 -11
  6. {cppiniter-1.0.7 → cppiniter-1.1.0}/cppiniter/files/conanfile.py +17 -4
  7. cppiniter-1.1.0/cppiniter/files/example/CMakeLists.txt +15 -0
  8. {cppiniter-1.0.7/cppiniter/files/src → cppiniter-1.1.0/cppiniter/files/example}/main.cpp +1 -4
  9. cppiniter-1.1.0/cppiniter/files/src/CMakeLists.txt +43 -0
  10. cppiniter-1.1.0/cppiniter/files/src/main.cpp +14 -0
  11. cppiniter-1.1.0/cppiniter/files/src/project_name/export.h +36 -0
  12. cppiniter-1.1.0/cppiniter/files/src/project_name/project_name.cpp +0 -0
  13. cppiniter-1.1.0/cppiniter/files/src/project_name/project_name.h +0 -0
  14. cppiniter-1.1.0/cppiniter/files/src/project_name/version.h.in +11 -0
  15. cppiniter-1.1.0/cppiniter/files/src/version.h.in +11 -0
  16. {cppiniter-1.0.7 → cppiniter-1.1.0/cppiniter.egg-info}/PKG-INFO +1 -1
  17. {cppiniter-1.0.7 → cppiniter-1.1.0}/cppiniter.egg-info/SOURCES.txt +7 -0
  18. {cppiniter-1.0.7 → cppiniter-1.1.0}/setup.py +1 -1
  19. cppiniter-1.0.7/cppiniter/files/src/CMakeLists.txt +0 -30
  20. {cppiniter-1.0.7 → cppiniter-1.1.0}/LICENSE +0 -0
  21. {cppiniter-1.0.7 → cppiniter-1.1.0}/MANIFEST.in +0 -0
  22. {cppiniter-1.0.7 → cppiniter-1.1.0}/cppiniter/__init__.py +0 -0
  23. {cppiniter-1.0.7 → cppiniter-1.1.0}/cppiniter/files/.clang-format +0 -0
  24. {cppiniter-1.0.7 → cppiniter-1.1.0}/cppiniter/files/.gitignore +0 -0
  25. {cppiniter-1.0.7 → cppiniter-1.1.0}/cppiniter/files/.pre-commit-config.yaml +0 -0
  26. {cppiniter-1.0.7 → cppiniter-1.1.0}/cppiniter/files/CMakeSettings.json +0 -0
  27. {cppiniter-1.0.7 → cppiniter-1.1.0}/cppiniter/files/README.md +0 -0
  28. {cppiniter-1.0.7 → cppiniter-1.1.0}/cppiniter/files/test/CMakeLists.txt +0 -0
  29. {cppiniter-1.0.7 → cppiniter-1.1.0}/cppiniter/files/test/main.cpp +0 -0
  30. {cppiniter-1.0.7 → cppiniter-1.1.0}/cppiniter/files/version.properties +0 -0
  31. {cppiniter-1.0.7 → cppiniter-1.1.0}/cppiniter.egg-info/dependency_links.txt +0 -0
  32. {cppiniter-1.0.7 → cppiniter-1.1.0}/cppiniter.egg-info/entry_points.txt +0 -0
  33. {cppiniter-1.0.7 → cppiniter-1.1.0}/cppiniter.egg-info/requires.txt +0 -0
  34. {cppiniter-1.0.7 → cppiniter-1.1.0}/cppiniter.egg-info/top_level.txt +0 -0
  35. {cppiniter-1.0.7 → cppiniter-1.1.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cppiniter
3
- Version: 1.0.7
3
+ Version: 1.1.0
4
4
  Summary: C++项目脚手架
5
5
  Home-page: https://github.com/xyz1001/cppiniter
6
6
  Author: xyz1001
@@ -21,12 +21,12 @@ pip3 install cppiniter
21
21
 
22
22
  ```
23
23
  Usage:
24
- cppiniter [<dir>] [--name=<name>] [--lib]
24
+ cppiniter [<dir>] [--name=<name>] [--exe]
25
25
 
26
26
  Options:
27
27
  <dir> 项目目录,默认为当前目录
28
28
  --name=<name> 项目名,默认为项目目录名
29
- --lib 项目目标为C++库
29
+ --exe 项目目标为C++应用程序,默认为库
30
30
  ```
31
31
 
32
32
  ## 目录结构
@@ -60,6 +60,12 @@ project
60
60
  │ │
61
61
  │   └── main.cpp # 加快doctest的编译速度
62
62
 
63
+ ├── example # 所有的示例程序文件应该放在这个目录下面
64
+ │ │
65
+ │   ├── CMakeLists.txt
66
+ │ │
67
+ │   └── main.cpp
68
+
63
69
  ├── doc # 文档保存目录
64
70
 
65
71
  └── build # 我们应该保持一棵干净的源码树,所有编译动作应该单独在这个目录进行。这个目录应加入gitignore
@@ -4,12 +4,12 @@
4
4
  """cppiniter init a cpp project struction
5
5
 
6
6
  Usage:
7
- cppiniter [<dir>] [--name=<name>] [--lib]
7
+ cppiniter [<dir>] [--name=<name>] [--exe]
8
8
 
9
9
  Options:
10
10
  <dir> 项目目录,默认为当前目录
11
11
  --name=<name> 项目名,默认为项目目录名
12
- --lib 项目目标为C++库
12
+ --exe 项目目标为C++应用程序,默认为库
13
13
  """
14
14
 
15
15
  import os
@@ -24,12 +24,15 @@ from datetime import datetime
24
24
 
25
25
  IGNORE_FILES = set([".git", "LICENSE"])
26
26
  EMPTY_DIR = ("build", "doc")
27
+ RENAME_FILES = {"src/project_name/project_name.h": "src/project_name/{{project_name}}.h", "src/project_name/project_name.cpp": "src/project_name/{{project_name}}.cpp", "src/project_name": "src/{{project_name}}"}
27
28
 
28
29
 
29
30
  def install(args):
30
31
  ignores = ["*.pyc", "__pycache__"]
31
- if args["is_lib"]:
32
- ignores.append("src/main.cpp")
32
+
33
+ if args["is_exe"]:
34
+ ignores.append("example")
35
+ ignores.append("test")
33
36
 
34
37
  dir = os.path.dirname(os.path.realpath(__file__))
35
38
  shutil.copytree(os.path.join(dir, "files"),
@@ -38,6 +41,16 @@ def install(args):
38
41
  dirs_exist_ok=True)
39
42
  for i in EMPTY_DIR:
40
43
  os.mkdir(os.path.join(args["project_dir"], i))
44
+ for key, value in RENAME_FILES.items():
45
+ src_path = os.path.join(args["project_dir"], key)
46
+ dst_path = os.path.join(args["project_dir"], pystache.render(value, args))
47
+ os.rename(src_path, dst_path)
48
+
49
+ if args["is_exe"]:
50
+ shutil.rmtree(os.path.join(args["project_dir"], "src", args["project_name"]))
51
+ else:
52
+ os.remove(os.path.join(args["project_dir"], "src", "main.cpp"))
53
+ os.remove(os.path.join(args["project_dir"], "src", "version.h.in"))
41
54
 
42
55
 
43
56
  def render(dir, args):
@@ -56,7 +69,7 @@ def render(dir, args):
56
69
  def preprocess(args):
57
70
  project_dir = args["<dir>"]
58
71
  project_name = args["--name"]
59
- is_lib = args["--lib"]
72
+ is_exe = args["--exe"]
60
73
  author = subprocess.check_output(["git", "config", "--get", "user.name"]
61
74
  ).decode(sys.stdout.encoding).strip()
62
75
  email = subprocess.check_output(["git", "config", "--get", "user.email"]
@@ -84,7 +97,7 @@ def preprocess(args):
84
97
 
85
98
  project_name_uppercase = project_name.upper()
86
99
  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}
100
+ return {"project_name": project_name, "project_name_uppercase": project_name_uppercase, "project_name_camelcase": project_name_camelcase, "project_dir": project_dir, "is_exe": is_exe, "date_time": date_time, "author": author, "email": email}
88
101
 
89
102
 
90
103
  def execute(dir):
@@ -10,6 +10,9 @@ Checks: "*,
10
10
  -hicpp-special-member-functions,
11
11
  -readability-identifier-length,
12
12
  -misc-no-recursion,
13
+ -hicpp-no-array-decay,
14
+ -cppcoreguidelines-pro-bounds-array-to-pointer-decay,
15
+ -llvm-include-order,
13
16
  "
14
17
  WarningsAsErrors: ''
15
18
  HeaderFilterRegex: ''
@@ -2,7 +2,7 @@
2
2
  # Automatically generated by cppiniter {{{date_time}}}
3
3
  ######################################################################
4
4
 
5
- cmake_minimum_required (VERSION 3.23)
5
+ cmake_minimum_required (VERSION 3.25)
6
6
  project ({{{project_name}}})
7
7
 
8
8
  include(GNUInstallDirs)
@@ -21,6 +21,9 @@ if(NOT DEFINED VERSION_NAME)
21
21
 
22
22
  set(VERSION_NAME "T.${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}.0")
23
23
  endif()
24
+ if(DEFINED ENV{GIT_COMMIT})
25
+ set(VERSION_NAME "${VERSION_NAME}-$ENV{GIT_COMMIT}")
26
+ endif()
24
27
  message(STATUS "${PROJECT_NAME} version ${VERSION_NAME}")
25
28
  add_definitions(-DVERSION_NAME="${VERSION_NAME}")
26
29
 
@@ -35,6 +38,8 @@ set(CMAKE_C_VISIBILITY_PRESET hidden)
35
38
  set(CMAKE_CXX_VISIBILITY_PRESET hidden)
36
39
  set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
37
40
 
41
+ set(CMAKE_COMPILE_WARNING_AS_ERROR ON)
42
+
38
43
  if(WIN32)
39
44
  add_definitions(-DWINVER=0x0601)
40
45
  add_definitions(-D_WIN32_WINNT=0x0601)
@@ -42,35 +47,60 @@ endif()
42
47
 
43
48
 
44
49
  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")
50
+ set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_DEBUG} -Og -g3 -Wall -Wextra -Wno-sign-compare")
46
51
  set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_RELEASE} -O2")
47
52
  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")
53
+ set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_DEBUG} -Og -g3 -Wall -Wextra -Wno-sign-compare")
49
54
  set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_RELEASE} -O2")
55
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--exclude-libs,ALL")
50
56
  elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
51
57
  add_definitions(-D_SCL_SECURE_NO_WARNINGS=1)
52
58
  add_definitions(-D_CRT_SECURE_NO_WARNINGS=1)
53
59
 
54
- set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD TRUE)
55
-
56
60
  string (REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
57
61
  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")
62
+ set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_DEBUG} /wd4244 /wd4018 /wd4267 /wd4307")
63
+ if (BUILD_SHARED_LIBS)
64
+ set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_RELEASE} /Zi")
65
+ else()
66
+ string (REGEX REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
67
+ set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_RELEASE} /Z7")
68
+ endif()
69
+
60
70
 
61
71
  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
62
72
  set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
63
73
  endif()
64
74
 
65
75
  if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
66
- set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/build/install/ CACHE PATH "default install prefix" FORCE)
76
+ set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install/ CACHE PATH "default install prefix" FORCE)
67
77
  endif()
68
78
 
69
- option(BUILD_TEST "build tests" OFF)
79
+ {{^is_exe}}
80
+ option(BUILD_TEST "build test" OFF)
81
+ option(BUILD_EXAMPLE "build example" OFF)
82
+ {{/is_exe}}
70
83
 
71
84
  add_subdirectory(src)
72
- {{#is_lib}}
85
+ {{^is_exe}}
73
86
  if(BUILD_TEST)
74
87
  add_subdirectory (test)
75
88
  endif()
76
- {{/is_lib}}
89
+
90
+ if(BUILD_EXAMPLE)
91
+ add_subdirectory (example)
92
+ endif()
93
+
94
+ if (BUILD_EXAMPLE OR BUILD_TEST)
95
+ if (WIN32)
96
+ set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
97
+ set(CMAKE_INSTALL_DEBUG_LIBRARIES TRUE)
98
+
99
+ file(GLOB DLLS ${CMAKE_BINARY_DIR}/*.dll)
100
+ INSTALL(FILES ${DLLS} DESTINATION bin)
101
+ elseif(APPLE)
102
+ file(GLOB DYLIBS ${CMAKE_BINARY_DIR}/*.dylib)
103
+ INSTALL(FILES ${DYLIBS} DESTINATION lib)
104
+ endif()
105
+ endif()
106
+ {{/is_exe}}
@@ -1,7 +1,7 @@
1
1
  from conan import ConanFile
2
2
  from conan.tools.cmake import CMake, cmake_layout, CMakeToolchain, CMakeDeps
3
3
  from conan.tools.scm import Git
4
- from conan.tools.files import update_conandata
4
+ from conan.tools.files import update_conandata, copy
5
5
  import os
6
6
 
7
7
 
@@ -17,7 +17,8 @@ class {{{project_name_camelcase}}}Conan(ConanFile):
17
17
  options = {"shared": [True, False], "test": [True, False]}
18
18
  default_options = {"shared": True, "test": False}
19
19
 
20
- def _make_version(self):
20
+ @property
21
+ def version_name(self):
21
22
  type_dict = {"stable": "R", "snapshot": "D", "testing": "T"}
22
23
  type = type_dict.get(self.channel, "S")
23
24
  hash = os.getenv("GIT_COMMIT", "")[:6]
@@ -46,14 +47,26 @@ class {{{project_name_camelcase}}}Conan(ConanFile):
46
47
  cmake_layout(self)
47
48
 
48
49
  def generate(self):
49
- tc = CMakeToolchain(self)
50
- tc.variables["VERSION_NAME"] = self._make_version()
50
+ if self.settings.os == "Windows":
51
+ tc = CMakeToolchain(self, generator="Ninja")
52
+ else:
53
+ tc = CMakeToolchain(self)
54
+
55
+ if self.version:
56
+ tc.variables["VERSION_NAME"] = self.version_name
51
57
  tc.variables["BUILD_TEST"] = self.options.test
52
58
  tc.generate()
53
59
 
54
60
  deps = CMakeDeps(self)
55
61
  deps.generate()
56
62
 
63
+ if self.settings.os == "Windows":
64
+ for dep in self.dependencies.values():
65
+ for bindir in dep.cpp_info.bindirs:
66
+ copy(self, "*.dll", bindir, self.build_folder)
67
+ copy(self, "*.dylib", bindir, self.build_folder)
68
+
69
+
57
70
  def build(self):
58
71
  cmake = CMake(self)
59
72
  cmake.configure()
@@ -0,0 +1,15 @@
1
+ ######################################################################
2
+ # Automatically generated by cppiniter {{{date_time}}}
3
+ ######################################################################
4
+
5
+ add_executable(example)
6
+
7
+ target_include_directories(example INTERFACE ${CMAKE_CURRENT_LIST_DIR})
8
+
9
+ file(GLOB SRC "*/*.h"
10
+ "*/*.cpp"
11
+ "*.hpp"
12
+ "*.cpp")
13
+ target_sources(example PRIVATE ${SRC})
14
+
15
+ target_link_libraries(${TARGET} PRIVATE {{{project_name}}})
@@ -4,9 +4,6 @@
4
4
  * coding: utf-8
5
5
  */
6
6
 
7
- #include <iostream>
8
-
9
- int main() {
10
-
7
+ int main(int argc, char *argv[]) {
11
8
  return 0;
12
9
  }
@@ -0,0 +1,43 @@
1
+ ######################################################################
2
+ # Automatically generated by cppiniter {{{date_time}}}
3
+ ######################################################################
4
+
5
+ {{#is_exe}}
6
+ add_executable({{{project_name}}})
7
+ {{/is_exe}}
8
+ {{^is_exe}}
9
+ add_library({{{project_name}}})
10
+
11
+ if(BUILD_SHARED_LIBS)
12
+ target_compile_definitions({{{project_name}}} PRIVATE {{{project_name_uppercase}} {{{project_name_uppercase}}_EXPORTS)
13
+ endif()
14
+ {{/is_exe}}
15
+
16
+ target_include_directories({{{project_name}}} PUBLIC ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_BINARY_DIR})
17
+
18
+ {{#is_exe}}
19
+ configure_file(${CMAKE_CURRENT_LIST_DIR}/version.h.in ${CMAKE_BINARY_DIR}/version.h)
20
+ {{/is_exe}}
21
+ {{^is_exe}}
22
+ configure_file(${CMAKE_CURRENT_LIST_DIR}/{{{project_name}}}/version.h.in ${CMAKE_BINARY_DIR}/version.h)
23
+ {{/is_exe}}
24
+ list(APPEND SRC ${CMAKE_CURRENT_LIST_DIR}/{{{project_name}}}/version.cpp)
25
+
26
+ file(GLOB SRC "*/*.h"
27
+ "*/*.cpp"
28
+ "*.hpp"
29
+ "*.cpp")
30
+ target_sources({{{project_name}}} PRIVATE ${SRC})
31
+
32
+ find_package(fmt REQUIRED CONFIG)
33
+
34
+ target_link_libraries(${TARGET} fmt::fmt)
35
+
36
+ INSTALL(TARGETS {{{project_name}}}
37
+ RUNTIME DESTINATION bin
38
+ LIBRARY DESTINATION lib
39
+ ARCHIVE DESTINATION lib)
40
+
41
+ if(MSVC AND BUILD_SHARED_LIBS)
42
+ install(FILES $<TARGET_PDB_FILE:{{{project_name}}}> DESTINATION lib)
43
+ endif()
@@ -0,0 +1,14 @@
1
+ /*
2
+ * author: {{{author}}} <{{{email}}}>
3
+ * created at: {{{date_time}}}
4
+ * coding: utf-8
5
+ */
6
+
7
+ #include <iostream>
8
+
9
+ #include "version.h"
10
+
11
+ int main() {
12
+ std::cout << kVersionName << std::endl;
13
+ return 0;
14
+ }
@@ -0,0 +1,36 @@
1
+ #pragma once
2
+
3
+ // clang-format off
4
+ // Generic helper definitions for shared library support
5
+ #if defined _WIN32 || defined __CYGWIN__
6
+ #define {{{project_name_uppercase}}}_HELPER_DLL_IMPORT __declspec(dllimport)
7
+ #define {{{project_name_uppercase}}}_HELPER_DLL_EXPORT __declspec(dllexport)
8
+ #define {{{project_name_uppercase}}}_HELPER_DLL_LOCAL
9
+ #else
10
+ #if __GNUC__ >= 4
11
+ #define {{{project_name_uppercase}}}_HELPER_DLL_IMPORT __attribute__ ((visibility ("default")))
12
+ #define {{{project_name_uppercase}}}_HELPER_DLL_EXPORT __attribute__ ((visibility ("default")))
13
+ #define {{{project_name_uppercase}}}_HELPER_DLL_LOCAL __attribute__ ((visibility ("hidden")))
14
+ #else
15
+ #define {{{project_name_uppercase}}}_HELPER_DLL_IMPORT
16
+ #define {{{project_name_uppercase}}}_HELPER_DLL_EXPORT
17
+ #define {{{project_name_uppercase}}}_HELPER_DLL_LOCAL
18
+ #endif
19
+ #endif
20
+
21
+ // Now we use the generic helper definitions above to define {{{project_name_uppercase}}}_API and {{{project_name_uppercase}}}_LOCAL.
22
+ // {{{project_name_uppercase}}}_API is used for the public API symbols. It either DLL imports or DLL exports (or does nothing for static build)
23
+ // {{{project_name_uppercase}}}_LOCAL is used for non-api symbols.
24
+
25
+ #ifdef {{{project_name_uppercase}}}_DLL // defined if {{{project_name_uppercase}}} is compiled as a DLL
26
+ #ifdef {{{project_name_uppercase}}}_DLL_EXPORTS // defined if we are building the {{{project_name_uppercase}}} DLL (instead of using it)
27
+ #define {{{project_name_uppercase}}}_API {{{project_name_uppercase}}}_HELPER_DLL_EXPORT
28
+ #else
29
+ #define {{{project_name_uppercase}}}_API {{{project_name_uppercase}}}_HELPER_DLL_IMPORT
30
+ #endif // {{{project_name_uppercase}}}_DLL_EXPORTS
31
+ #define {{{project_name_uppercase}}}_LOCAL {{{project_name_uppercase}}}_HELPER_DLL_LOCAL
32
+ #else // {{{project_name_uppercase}}}_DLL is not defined: this means {{{project_name_uppercase}}} is a static lib.
33
+ #define {{{project_name_uppercase}}}_API
34
+ #define {{{project_name_uppercase}}}_LOCAL
35
+ #endif // {{{project_name_uppercase}}}_DLL
36
+ // clang-format on
@@ -0,0 +1,11 @@
1
+ /*
2
+ * author: {{{author}}} <{{{email}}}>
3
+ * created at: {{{date_time}}}
4
+ * coding: utf-8
5
+ */
6
+
7
+ #pragma once
8
+
9
+ #include <string>
10
+
11
+ constexpr const char *kVersionName = "@VERSION_NAME@";
@@ -0,0 +1,11 @@
1
+ /*
2
+ * author: {{{author}}} <{{{email}}}>
3
+ * created at: {{{date_time}}}
4
+ * coding: utf-8
5
+ */
6
+
7
+ #pragma once
8
+
9
+ #include <string>
10
+
11
+ constexpr const char *kVersionName = "@VERSION_NAME@";
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cppiniter
3
- Version: 1.0.7
3
+ Version: 1.1.0
4
4
  Summary: C++项目脚手架
5
5
  Home-page: https://github.com/xyz1001/cppiniter
6
6
  Author: xyz1001
@@ -19,7 +19,14 @@ cppiniter/files/CMakeSettings.json
19
19
  cppiniter/files/README.md
20
20
  cppiniter/files/conanfile.py
21
21
  cppiniter/files/version.properties
22
+ cppiniter/files/example/CMakeLists.txt
23
+ cppiniter/files/example/main.cpp
22
24
  cppiniter/files/src/CMakeLists.txt
23
25
  cppiniter/files/src/main.cpp
26
+ cppiniter/files/src/version.h.in
27
+ cppiniter/files/src/project_name/export.h
28
+ cppiniter/files/src/project_name/project_name.cpp
29
+ cppiniter/files/src/project_name/project_name.h
30
+ cppiniter/files/src/project_name/version.h.in
24
31
  cppiniter/files/test/CMakeLists.txt
25
32
  cppiniter/files/test/main.cpp
@@ -5,7 +5,7 @@ from setuptools import setup
5
5
 
6
6
  setup(
7
7
  name='cppiniter',
8
- version="1.0.7",
8
+ version="1.1.0",
9
9
  description="C++项目脚手架",
10
10
  long_description="""用于提供C++项目开发环境的初始化""",
11
11
  keywords='c++ scaffolding',
@@ -1,30 +0,0 @@
1
- ######################################################################
2
- # Automatically generated by cppiniter {{{date_time}}}
3
- ######################################################################
4
-
5
- {{#is_lib}}
6
- add_library({{{project_name}}})
7
- {{/is_lib}}
8
- {{^is_lib}}
9
- add_executable({{{project_name}}})
10
- {{/is_lib}}
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
-
24
- target_link_libraries({{{project_name}}} ${CONAN_LIBS})
25
-
26
- # install
27
- INSTALL(TARGETS {{{project_name}}}
28
- RUNTIME DESTINATION bin
29
- LIBRARY DESTINATION lib
30
- ARCHIVE DESTINATION lib)
File without changes
File without changes
File without changes