Skip to content

Commit 93b7531

Browse files
committed
adrv9009: generate package
Signed-off-by: IonutMuthi <[email protected]>
1 parent 6f7add6 commit 93b7531

File tree

14 files changed

+496
-0
lines changed

14 files changed

+496
-0
lines changed

packages/adrv9009/CMakeLists.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
cmake_minimum_required(VERSION 3.9)
2+
3+
set(SCOPY_MODULE adrv9009)
4+
set(CURRENT_PKG_PATH ${CMAKE_CURRENT_SOURCE_DIR})
5+
set(PACKAGE_NAME ${SCOPY_MODULE})
6+
7+
message(STATUS "building package: " ${SCOPY_MODULE})
8+
9+
project(scopy-package-${SCOPY_MODULE} VERSION 0.1 LANGUAGES CXX)
10+
11+
configure_file(manifest.json.cmakein ${SCOPY_PACKAGE_BUILD_PATH}/${SCOPY_MODULE}/MANIFEST.json @ONLY)
12+
message("Generate pkg style")
13+
14+
include_emu_xml(${CMAKE_CURRENT_SOURCE_DIR}/emu-xml ${SCOPY_PACKAGE_BUILD_PATH}/${SCOPY_MODULE}/emu-xml)
15+
include_resources(${CMAKE_CURRENT_SOURCE_DIR}/resources ${SCOPY_PACKAGE_BUILD_PATH}/${SCOPY_MODULE}/resources)
16+
message("Including plugins")
17+
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/plugins)
18+
add_plugins(${CMAKE_CURRENT_SOURCE_DIR}/plugins ${SCOPY_PACKAGE_BUILD_PATH}/${SCOPY_MODULE}/plugins)
19+
install_plugins(
20+
${SCOPY_PACKAGE_BUILD_PATH}/${SCOPY_MODULE}/plugins
21+
${SCOPY_PACKAGE_INSTALL_PATH}/${SCOPY_MODULE}/plugins "scopy"
22+
)
23+
endif()
24+
install_pkg(${SCOPY_PACKAGE_BUILD_PATH}/${SCOPY_MODULE} ${SCOPY_PACKAGE_INSTALL_PATH}/${SCOPY_MODULE})

packages/adrv9009/emu-xml/adrv9009.xml

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[
2+
{
3+
"device": "adrv9009-phy",
4+
"xml_path": "adrv9009.xml",
5+
"uri": "ip:127.0.0.1"
6+
}
7+
]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"id": "adrv9009",
3+
"title": "ADRV9009 Package",
4+
"version": "@PROJECT_VERSION@",
5+
"description": "ADRV9009 RF Transceiver control package for Scopy",
6+
"license": "GPL-3.0",
7+
"author": "Analog Devices Inc.",
8+
"download_link": "",
9+
"zip_checksum": "",
10+
"scopy_compatibility": ["@CMAKE_PROJECT_VERSION@"],
11+
"category": ["iio"]
12+
}
13+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include/adrv9009plugin/scopy-adrv9009plugin_export.h
2+
include/adrv9009plugin/scopy-adrv9009plugin_config.h
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
cmake_minimum_required(VERSION 3.9)
2+
3+
set(SCOPY_MODULE adrv9009plugin)
4+
5+
message(STATUS "building plugin: " ${SCOPY_MODULE})
6+
7+
project(scopy-${SCOPY_MODULE} VERSION 0.1 LANGUAGES CXX)
8+
9+
set(PLUGIN_DISPLAY_NAME ADRV9009)
10+
set(PLUGIN_DESCRIPTION
11+
ADRV9009
12+
RF
13+
TRANSCEIVER
14+
CONTROL
15+
AND
16+
CONFIGURATION
17+
PLUGIN
18+
)
19+
20+
include(GenerateExportHeader)
21+
22+
# TODO: split stylesheet/resources and add here TODO: export header files correctly
23+
24+
set(CMAKE_CXX_STANDARD 17)
25+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
26+
27+
set(CMAKE_AUTOUIC_SEARCH_PATHS ${CMAKE_CURRENT_SOURCE_DIR}/ui)
28+
set(CMAKE_AUTOUIC ON)
29+
set(CMAKE_AUTOMOC ON)
30+
set(CMAKE_AUTORCC ON)
31+
32+
set(CMAKE_INCLUDE_CURRENT_DIR ON)
33+
34+
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
35+
set(CMAKE_VISIBILITY_INLINES_HIDDEN TRUE)
36+
37+
file(GLOB SRC_LIST src/*.cpp src/*.cc)
38+
file(GLOB HEADER_LIST include/${SCOPY_MODULE}/*.h include/${SCOPY_MODULE}/*.hpp)
39+
file(GLOB UI_LIST ui/*.ui)
40+
41+
set(ENABLE_TESTING ON)
42+
if(ENABLE_TESTING)
43+
add_subdirectory(test)
44+
endif()
45+
46+
set(PROJECT_SOURCES ${SRC_LIST} ${HEADER_LIST} ${UI_LIST})
47+
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS REQUIRED Widgets Core)
48+
49+
qt_add_resources(PROJECT_RESOURCES res/resources.qrc)
50+
add_library(${PROJECT_NAME} SHARED ${PROJECT_SOURCES} ${PROJECT_RESOURCES})
51+
52+
generate_export_header(
53+
${PROJECT_NAME} EXPORT_FILE_NAME ${CMAKE_CURRENT_SOURCE_DIR}/include/${SCOPY_MODULE}/${PROJECT_NAME}_export.h
54+
)
55+
56+
configure_file(
57+
include/${SCOPY_MODULE}/scopy-${SCOPY_MODULE}_config.h.cmakein
58+
${CMAKE_CURRENT_SOURCE_DIR}/include/${SCOPY_MODULE}/scopy-${SCOPY_MODULE}_config.h @ONLY
59+
)
60+
61+
target_include_directories(${PROJECT_NAME} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include)
62+
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/${SCOPY_MODULE})
63+
64+
target_include_directories(${PROJECT_NAME} PUBLIC ${CURRENT_PKG_PATH}/include)
65+
target_include_directories(${PROJECT_NAME} PUBLIC scopy-pluginbase scopy-gui scopy-iioutil scopy-iio-widgets)
66+
67+
target_link_libraries(
68+
${PROJECT_NAME}
69+
PUBLIC Qt::Widgets
70+
Qt::Core
71+
scopy-pluginbase
72+
scopy-gui
73+
scopy-iioutil
74+
scopy-iio-widgets
75+
)
76+
77+
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
78+
configureinstallersettings(${SCOPY_MODULE} ${PLUGIN_DESCRIPTION} FALSE)
79+
endif()
80+
81+
set(ADRV9009PLUGIN_TARGET_NAME ${PROJECT_NAME} PARENT_SCOPE)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#ifndef ADRV9009_H
2+
#define ADRV9009_H
3+
4+
#include "scopy-adrv9009plugin_export.h"
5+
#include <QWidget>
6+
#include <iio.h>
7+
8+
namespace scopy::adrv9009 {
9+
class SCOPY_ADRV9009PLUGIN_EXPORT Adrv9009 : public QWidget
10+
{
11+
Q_OBJECT
12+
public:
13+
Adrv9009(iio_context *ctx, QWidget *parent = nullptr);
14+
~Adrv9009();
15+
16+
private:
17+
iio_context *m_ctx = nullptr;
18+
iio_device *m_iio_dev = nullptr;
19+
};
20+
} // namespace scopy::adrv9009
21+
#endif // ADRV9009_H
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#ifndef ADRV9009PLUGIN_H
2+
#define ADRV9009PLUGIN_H
3+
4+
#define SCOPY_PLUGIN_NAME Adrv9009Plugin
5+
6+
#include "scopy-adrv9009plugin_export.h"
7+
#include <QObject>
8+
#include <pluginbase/plugin.h>
9+
#include <pluginbase/pluginbase.h>
10+
11+
namespace scopy::adrv9009 {
12+
class SCOPY_ADRV9009PLUGIN_EXPORT Adrv9009Plugin : public QObject, public PluginBase
13+
{
14+
Q_OBJECT
15+
SCOPY_PLUGIN;
16+
17+
public:
18+
bool compatible(QString m_param, QString category) override;
19+
bool loadPage() override;
20+
bool loadIcon() override;
21+
void loadToolList() override;
22+
void unload() override;
23+
void initMetadata() override;
24+
QString description() override;
25+
26+
public Q_SLOTS:
27+
bool onConnect() override;
28+
bool onDisconnect() override;
29+
};
30+
} // namespace scopy::adrv9009
31+
#endif // ADRV9009PLUGIN_H
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#ifndef SCOPY_ADRV9009PLUGIN_CONFIG_H_CMAKEIN
2+
#define SCOPY_ADRV9009PLUGIN_CONFIG_H_CMAKEIN
3+
4+
#define ADRV9009PLUGIN_PLUGIN_DISPLAY_NAME "@PLUGIN_DISPLAY_NAME@"
5+
#define ADRV9009PLUGIN_PLUGIN_SCOPY_MODULE "@SCOPY_MODULE@"
6+
#define ADRV9009PLUGIN_PLUGIN_DESCRIPTION "@PLUGIN_DESCRIPTION@"
7+
8+
#cmakedefine ENABLE_SCOPYJS
9+
10+
#endif // SCOPY_ADRV9009PLUGIN_CONFIG_H_CMAKEIN
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<!DOCTYPE RCC>
2+
<RCC version="1.0"/>

0 commit comments

Comments
 (0)