File tree Expand file tree Collapse file tree 5 files changed +55
-3
lines changed Expand file tree Collapse file tree 5 files changed +55
-3
lines changed Original file line number Diff line number Diff line change 1
1
cmake_minimum_required (VERSION 3.10 )
2
2
3
3
# set the project name
4
- project (mrc VERSION 1.3.1 )
4
+ project (mrc VERSION 1.3.2 )
5
5
6
6
enable_testing ()
7
7
@@ -60,12 +60,12 @@ set(PACKAGE_STRING "${PROJECT_NAME} ${PROJECT_VERSION}")
60
60
61
61
configure_file (${PROJECT_SOURCE_DIR} /mrc.h.in mrc.h )
62
62
63
- install (TARGETS mrc CONFIGURATIONS Release )
63
+ install (TARGETS mrc )
64
64
65
65
if (WIN32 )
66
66
install (FILES mrc-config.cmake DESTINATION cmake )
67
67
install (FILES mrc-manual.pdf DESTINATION doc )
68
68
else ()
69
69
install (FILES mrc-config.cmake DESTINATION share/mrc/cmake )
70
- install (FILES mrc-manual.pdf DESTINATION share/doc/mrc )
70
+ install (FILES mrc.1 DESTINATION share/man/man1 )
71
71
endif ()
Original file line number Diff line number Diff line change
1
+ Version 1.3.2
2
+ - Fix install rules in CMakeLists.txt
3
+ - Added example code
4
+
1
5
Version 1.3.1
2
6
- Fix writing header to specified output instead of stdout
3
7
- Added a cmake config file, for easy configuration
Original file line number Diff line number Diff line change
1
+ cmake_minimum_required (VERSION 3.16 )
2
+
3
+ # set the project name
4
+ project (mrc-user VERSION 1.0.0 LANGUAGES CXX )
5
+
6
+ # Locate the mrc executable and load the mrc_* functions
7
+ find_package (mrc )
8
+
9
+ # Write out an mrsrc.hpp file and make sure the compiler finds it
10
+ mrc_write_header (${CMAKE_CURRENT_BINARY_DIR} /mrsrc.hpp )
11
+ include_directories (${CMAKE_CURRENT_BINARY_DIR} )
12
+
13
+ # The executable to create
14
+ add_executable (mrc-user ${CMAKE_CURRENT_SOURCE_DIR} /mrc-user.cpp )
15
+
16
+ # Add the hello.txt file as a resource, more files and/or directories
17
+ # can be specified here
18
+ mrc_target_resources (mrc-user ${CMAKE_CURRENT_SOURCE_DIR} /hello.txt )
Original file line number Diff line number Diff line change
1
+ Hello, world!
Original file line number Diff line number Diff line change
1
+ /*
2
+ Example of the use of resources created with mrc in a C++ application
3
+ */
4
+
5
+ #include < iostream>
6
+
7
+ // Include the generated header file
8
+ #include " mrsrc.hpp"
9
+
10
+ int main ()
11
+ {
12
+ try
13
+ {
14
+ mrsrc::rsrc res (" hello.txt" );
15
+ if (not res)
16
+ throw std::runtime_error (" Resource not found" );
17
+
18
+ std::cout.write (res.data (), res.size ());
19
+ std::cout << std::endl;
20
+ }
21
+ catch (const std::exception& e)
22
+ {
23
+ std::cerr << e.what () << ' \n ' ;
24
+ exit (1 );
25
+ }
26
+
27
+ return 0 ;
28
+ }
29
+
You can’t perform that action at this time.
0 commit comments