#============================================================================ # # # Copyright 2023 by: # # Commonwealth Scientific and Industrial Research Organisation (CSIRO) # # This file is licensed by CSIRO under the copy of the CSIRO Binary # License Agreement included with the file when downloaded or obtained # from CSIRO (including any Supplementary License). If no copy was # included, you must obtain a new copy of the Software from CSIRO before # any use is permitted. # # For further information, contact: workspace@csiro.au # # This copyright notice must be included with all copies of the source code. # #============================================================================ project(IMPORTDATATYPEPLUGIN) if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) find_path(WORKSPACE_CMAKE_ROOT Workspace_CMake_Root.txt HINTS ${CMAKE_SOURCE_DIR} ENV WORKSPACE_CMAKE_ROOT DOC "Directory containing the Workspace_CMake_Root.txt file") if (NOT WORKSPACE_CMAKE_ROOT) message(FATAL_ERROR "Please set WORKSPACE_CMAKE_ROOT to the directory containing the file Workspace_CMake_Root.txt") endif() include( ${WORKSPACE_CMAKE_ROOT}/CMakeLists.txt NO_POLICY_SCOPE ) endif() cmake_minimum_required(VERSION 3.0) include_directories(${IMPORTDATATYPEPLUGIN_SOURCE_DIR}) if (NOT ${IMPORTDATATYPEPLUGIN_SOURCE_DIR} STREQUAL ${IMPORTDATATYPEPLUGIN_BINARY_DIR}) include_directories(${IMPORTDATATYPEPLUGIN_BINARY_DIR}) endif() set(IMPORTDATATYPEPLUGIN_VERSION 0.1.0) string(REGEX MATCH "^[0-9]+" IMPORTDATATYPEPLUGIN_SOVERSION ${IMPORTDATATYPEPLUGIN_VERSION}) # Add other Qt modules as required by your plugin - eg. QtNetwork, QtOpenGL, QtSql find_package(Qt5Core) find_package(Qt5Widgets) find_package(Qt5SerialPort) set(QT_LIBRARIES Qt5::Core;Qt5::Widgets;Qt5::SerialPort) set(CMAKE_AUTOMOC ON) set(HEADERS ${IMPORTDATATYPEPLUGIN_SOURCE_DIR}/importdatatypeplugin_api.h ${IMPORTDATATYPEPLUGIN_SOURCE_DIR}/importdatatypeplugin.h ${IMPORTDATATYPEPLUGIN_SOURCE_DIR}/serialport.h ${IMPORTDATATYPEPLUGIN_SOURCE_DIR}/stltype.h ) set(INSTALL_HEADERS ${IMPORTDATATYPEPLUGIN_SOURCE_DIR}/importdatatypeplugin_api.h ${IMPORTDATATYPEPLUGIN_SOURCE_DIR}/importdatatypeplugin.h ${IMPORTDATATYPEPLUGIN_SOURCE_DIR}/serialport.h ${IMPORTDATATYPEPLUGIN_SOURCE_DIR}/stltype.h ) set(MOC_HEADERS ) set(SOURCES ${IMPORTDATATYPEPLUGIN_SOURCE_DIR}/importdatatypeplugin.cpp ${IMPORTDATATYPEPLUGIN_SOURCE_DIR}/serialport.cpp ${IMPORTDATATYPEPLUGIN_SOURCE_DIR}/stltype.cpp ) set(UI_SOURCES ) add_definitions(-DIMPORTDATATYPEPLUGIN_VERSION=${IMPORTDATATYPEPLUGIN_VERSION}) # The next line is used by the simple application generator wizard # add_subdirectory(${IMPORTDATATYPEPLUGIN_SOURCE_DIR}/Application) # The below line can be used to import sub-directories # include( ${IMPORTDATATYPEPLUGIN_SOURCE_DIR}/SubDir/CMakeLists.txt ) # qtx macros are defined in the ${WORKSPACE_CMAKE_ROOT}/CMakeLists.txt included at the top of this file # to support both Qt4 and Qt5 builds. qtx_wrap_ui(UIC_SOURCES ${UI_SOURCES}) qtx_add_resources(RES_SOURCES ${RESOURCES}) add_library(importdatatypeplugin ${SOURCES} ${HEADERS} ${MOC_SOURCES} ${UIC_SOURCES} ${RES_SOURCES}) target_link_libraries(importdatatypeplugin workspace ${QT_LIBRARIES}) set(IMPORTDATATYPEPLUGIN_INTERFACE_INCLUDE_DIRECTORIES "include/ImportDataTypePlugin") target_include_directories(importdatatypeplugin INTERFACE "${CSIRO_INSTALL_AREA}/${IMPORTDATATYPEPLUGIN_INTERFACE_INCLUDE_DIRECTORIES}") set_target_properties(importdatatypeplugin PROPERTIES DEFINE_SYMBOL IMPORTDATATYPEPLUGIN_EXPORT VERSION ${IMPORTDATATYPEPLUGIN_VERSION} SOVERSION ${IMPORTDATATYPEPLUGIN_SOVERSION} ) setTargetOutputDirectory(importdatatypeplugin ${CSIRO_INSTALL_AREA}/lib/Plugins) configure_file(pkg-importdatatypeplugin.cmake ${CSIRO_INSTALL_AREA}/cmake/Exports/pkg-importdatatypeplugin.cmake @ONLY) # If your plugin is dependent on any other dynamic libraries you can add the root path # of that library (the path above the lib, bin and include) to the following EXTRA_INSTALL_AREAS variable set_install_area_file(importdatatypeplugin "${CSIRO_INSTALL_AREA}" ${EXTRA_INSTALL_AREAS}) # Copy our install headers into the install directory so that others can build against our plugin. foreach(inFile ${INSTALL_HEADERS}) string(REGEX REPLACE "(${IMPORTDATATYPEPLUGIN_SOURCE_DIR}/)(.*)" "${CSIRO_INSTALL_AREA}/${IMPORTDATATYPEPLUGIN_INTERFACE_INCLUDE_DIRECTORIES}/\\2" outFile "${inFile}") configure_file(${inFile} ${outFile} COPYONLY) endforeach(inFile) add_subdirectory(Designer)