This repository was archived by the owner on Aug 29, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ set(CMAKE_AUTOMOC ON)
66set (CMAKE_AUTORCC ON )
77set (CMAKE_AUTOUIC ON )
88
9+
910set (PROJECT_NAME UniDeskCppExt)
1011set (MODULE_VERSION_MAJOR 0)
1112set (MODULE_VERSION_MINOR 0)
@@ -25,6 +26,7 @@ set(CMAKE_CXX_STANDARD 17)
2526set (CMAKE_CXX_STANDARD_REQUIRED ON )
2627# if(MSVC)
2728# add_compile_options(/Zc:__cplusplus)
29+ # add_compile_options(/permissive-)
2830# endif()
2931
3032
@@ -100,12 +102,13 @@ message(STATUS "CMake Config install directory:" "${CMAKECONFIG_INSTALL_DIR}")
100102
101103
102104
103- add_subdirectory (src )
104105
105106add_subdirectory (pybind11 )
106107pybind11_add_module (UDFrameless src/UDFrameless.cpp )
108+ # target_link_libraries(UDFrameless PRIVATE Qt6::Core)
107109
108110
111+ add_subdirectory (src )
109112# EXAMPLE_VERSION_INFO is defined by setup.py and passed into the C++ code as a
110113# define (VERSION_INFO) here.
111114target_compile_definitions (UDFrameless
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ def build_extension(self, ext: CMakeExtension) -> None:
5050 f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={ extdir } { os .sep } " ,
5151 f"-DPYTHON_EXECUTABLE={ sys .executable } " ,
5252 f"-DCMAKE_BUILD_TYPE={ cfg } " , # not used on MSVC, but no harm
53+ "-C "
5354 ]
5455 build_args = []
5556 # Adding CMake arguments set as environment variable
@@ -59,7 +60,7 @@ def build_extension(self, ext: CMakeExtension) -> None:
5960
6061 # In this example, we pass in the version to C++. You might not need to.
6162 cmake_args += [f"-DEXAMPLE_VERSION_INFO={ self .distribution .get_version ()} " ]
62-
63+
6364 if self .compiler .compiler_type != "msvc" :
6465 # Using Ninja-build since it a) is available as a wheel and b)
6566 # multithreads automatically. MSVC would require all variables be
Original file line number Diff line number Diff line change 1+ #pragma once
2+
3+ /* *
4+ * @brief The Singleton class
5+ */
6+ template <typename T>
7+ class Singleton {
8+ public:
9+ static T* getInstance ();
10+ };
11+
12+ template <typename T>
13+ T* Singleton<T>::getInstance()
14+ {
15+ static T* instance = new T ();
16+ return instance;
17+ }
18+
19+ #define SINGLETON (Class ) \
20+ private: \
21+ friend class Singleton <Class>; \
22+ \
23+ public: \
24+ static Class* getInstance () \
25+ { \
26+ return Singleton<Class>::getInstance (); \
27+ }
You can’t perform that action at this time.
0 commit comments