File tree 3 files changed +40
-1
lines changed
include/scratchcpp-render
3 files changed +40
-1
lines changed Original file line number Diff line number Diff line change 1
1
cmake_minimum_required (VERSION 3.14)
2
2
3
- project (scratchcpp-render VERSION 1.0 .0 LANGUAGES CXX)
3
+ project (scratchcpp-render VERSION 0.5 .0 LANGUAGES CXX)
4
4
5
5
set (CMAKE_INCLUDE_CURRENT_DIR ON )
6
6
set (CMAKE_AUTOUIC ON )
@@ -17,6 +17,10 @@ qt_standard_project_setup(REQUIRES 6.6)
17
17
add_subdirectory (src)
18
18
19
19
target_compile_definitions (scratchcpp-render PRIVATE SCRATCHCPPRENDER_LIBRARY)
20
+ target_compile_definitions (scratchcpp-render PRIVATE SCRATCHCPPRENDER_VERSION="${PROJECT_VERSION} " )
21
+ target_compile_definitions (scratchcpp-render PRIVATE SCRATCHCPPRENDER_VERSION_MAJOR=${PROJECT_VERSION_MAJOR} )
22
+ target_compile_definitions (scratchcpp-render PRIVATE SCRATCHCPPRENDER_VERSION_MINOR=${PROJECT_VERSION_MINOR} )
23
+ target_compile_definitions (scratchcpp-render PRIVATE SCRATCHCPPRENDER_VERSION_PATCH=${PROJECT_VERSION_PATCH} )
20
24
21
25
linkQt(scratchcpp-render)
22
26
Original file line number Diff line number Diff line change 2
2
3
3
#pragma once
4
4
5
+ #include < string>
6
+
5
7
/* ! \brief The main namespace of the library. */
6
8
namespace scratchcpprender
7
9
{
8
10
9
11
/* ! Initializes the library. Call this from main before constructing your Q(Gui)Application object. */
10
12
void init ();
11
13
14
+ /* ! Returns the version string of the library. */
15
+ const std::string &version ();
16
+
17
+ /* ! Returns the major version of the library. */
18
+ int majorVersion ();
19
+
20
+ /* ! Returns the minor version of the library. */
21
+ int minorVersion ();
22
+
23
+ /* ! Returns the patch version of the library. */
24
+ int patchVersion ();
25
+
12
26
} // namespace scratchcpprender
Original file line number Diff line number Diff line change @@ -8,3 +8,24 @@ void scratchcpprender::init()
8
8
qputenv (" QSG_RENDER_LOOP" , " basic" );
9
9
QQuickWindow::setGraphicsApi (QSGRendererInterface::OpenGL);
10
10
}
11
+
12
+ const std::string &scratchcpprender::version ()
13
+ {
14
+ static const std::string ret = SCRATCHCPPRENDER_VERSION;
15
+ return ret;
16
+ }
17
+
18
+ int scratchcpprender::majorVersion ()
19
+ {
20
+ return SCRATCHCPPRENDER_VERSION_MAJOR;
21
+ }
22
+
23
+ int scratchcpprender::minorVersion ()
24
+ {
25
+ return SCRATCHCPPRENDER_VERSION_MINOR;
26
+ }
27
+
28
+ int scratchcpprender::patchVersion ()
29
+ {
30
+ return SCRATCHCPPRENDER_VERSION_PATCH;
31
+ }
You can’t perform that action at this time.
0 commit comments