Skip to content

Commit 5825ec6

Browse files
Metrol 1145:move lookup and async example to master (#918)
* Addition of Generatorshowcase plugin sample * modified interfaces path * Renaming Sample_interfaces as examples in interface and updating the same here * Updated interface path * renamed examples to example_interfaces --------- Co-authored-by: MFransen69 <39826971+MFransen69@users.noreply.github.com>
1 parent 2c0b320 commit 5825ec6

File tree

9 files changed

+3734
-0
lines changed

9 files changed

+3734
-0
lines changed

examples/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ option(EXAMPLE_DYNAMICLOADING "Include dynamic loading examples" OFF)
3737
option(EXAMPLE_SIMPLECOMRPC_TEST "Include Simple COMRPC test client" OFF)
3838
option(EXAMPLE_PLUGINSMARTINTERFACETYPE_EXAMPLE "Include PluginSmartInterfaceType examples" OFF)
3939
option(EXAMPLE_DYNAMICJSONRPCERRORMESSAGE_EXAMPLE "Include DynamicJSONRPCErrorMessage example" OFF)
40+
option(EXAMPLE_GENERATORSHOWCASE_EXAMPLE "Include GeneratorShowCase example" OFF)
4041

4142
if(EXAMPLE_COMRPCCLIENT)
4243
add_subdirectory(COMRPCClient)
@@ -95,3 +96,6 @@ if (EXAMPLE_DYNAMICJSONRPCERRORMESSAGE_EXAMPLE)
9596
add_subdirectory(DynamicJSONRPCErrorMessage)
9697
endif()
9798

99+
if (EXAMPLE_GENERATORSHOWCASE_EXAMPLE)
100+
add_subdirectory(GeneratorShowcase)
101+
endif()
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# If not stated otherwise in this file or this component's LICENSE file the
2+
# following copyright and licenses apply:
3+
#
4+
# Copyright 2024 Metrological
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
18+
project(GeneratorShowcase)
19+
20+
cmake_minimum_required(VERSION 3.15)
21+
22+
find_package(Thunder)
23+
24+
project_version(1.0.0)
25+
26+
set(MODULE_NAME ${NAMESPACE}${PROJECT_NAME})
27+
28+
message("Setup ${MODULE_NAME} v${PROJECT_VERSION}")
29+
30+
find_package(${NAMESPACE}Core REQUIRED)
31+
find_package(${NAMESPACE}Plugins REQUIRED)
32+
find_package(${NAMESPACE}Definitions REQUIRED)
33+
find_package(${NAMESPACE}Messaging REQUIRED)
34+
find_package(CompileSettingsDebug REQUIRED)
35+
36+
set(PLUGIN_GENERATORSHOWCASE_STARTMODE "Activated" CACHE STRING "Automatically start the plugin")
37+
38+
add_library(${MODULE_NAME} SHARED
39+
GeneratorShowcase.cpp
40+
Module.cpp)
41+
42+
target_include_directories(${MODULE_NAME} SYSTEM
43+
PRIVATE
44+
".")
45+
46+
target_link_libraries(${MODULE_NAME}
47+
PRIVATE
48+
${NAMESPACE}Core::${NAMESPACE}Core
49+
${NAMESPACE}Plugins::${NAMESPACE}Plugins
50+
${NAMESPACE}Definitions::${NAMESPACE}Definitions
51+
${NAMESPACE}Messaging::${NAMESPACE}Messaging
52+
CompileSettingsDebug::CompileSettingsDebug)
53+
54+
55+
# Library installation section
56+
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/${STORAGE_DIRECTORY}/plugins COMPONENT ${NAMESPACE}_Runtime)
57+
58+
write_config()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
startmode = "@PLUGIN_GENERATORSHOWCASE_STARTMODE@"
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* If not stated otherwise in this file or this component's LICENSE file the
3+
* following copyright and licenses apply:
4+
*
5+
* Copyright 2022 Metrological
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
20+
#include "Module.h"
21+
#include "GeneratorShowcase.h"
22+
23+
namespace Thunder {
24+
25+
namespace Plugin {
26+
27+
namespace {
28+
static Metadata<GeneratorShowcase> metadata(
29+
// Version
30+
1, 0, 0,
31+
// Preconditions
32+
{ },
33+
// Terminations
34+
{ },
35+
// Controls
36+
{ }
37+
);
38+
}
39+
40+
41+
} // namespace Plugin
42+
43+
}

0 commit comments

Comments
 (0)