cppzmq icon indicating copy to clipboard operation
cppzmq copied to clipboard

Build of project not possible

Open Raffro opened this issue 3 years ago • 3 comments

Hi, I am using cmake 3.21 vs 2017 checked out cppzmq-4.8.1 checked out zeromq-4.3.4 as per build instructions I built zeromq and after that cppzmq.

I am currently working on a service plugin for the Automotive Data and Time-Triggered Framework (ADTF). The code I write is written in c++. I generate the project with cmake and I built the projekt mostly manually via visual studio. I needed to implement a zmq socket, because of other modules. The generation of the .sln works but as I am building the plugin it says Result code '-20 '(ERR_NOT_FOUND) - Could not load plugin "...\recording_service\install\bin\debug\recording_service.adtfplugin" which is weird, because obviously the file is in the exact place.

Here is my cmakelists.txt:

cmake_minimum_required(VERSION 3.10.0)

include(CMakeListsSettings.txt)

find_package(ADTF REQUIRED COMPONENTS filtersdk ui)
find_package(ADTF_DEVICE_TOOLBOX REQUIRED COMPONENTS sdk)

message(STATUS "ADTF_VERSION: ${ADTF_VERSION}")
message(STATUS "ADTF_DEVICE_TOOLBOX: ${ADTF_DEVICE_TOOLBOX_VERSION}")

project(recording_service)


find_package(cppzmq)
# enable folders
set_property(GLOBAL PROPERTY USE_FOLDERS TRUE)

adtf_create_environment(
    NAME 
        recording_service
    VERSION 
        1.0.0
    DIRECTORY_MACRO 
        RECORDING_SERVICE_DIR
    OUTPUT 
        ${CMAKE_CURRENT_BINARY_DIR}/recording_service.adtfenvironment
    PLUGIN_DIRECTORIES 
        bin
        bin/debug
)

set (PROJECT_TARGETNAME     recording_service)
set (PROJECT_CATEGORY       services/${PROJECT_TARGETNAME})
set (PROJECT_INSTALL_SUFFIX bin)
set (AUTOGEN_BUILD_DIR bin)

set (PROJECT_SOURCES                    headers/... ---> removed due to compliance
							headers/...
							headers/recording_service.h
							headers...
							headers/...
							headers/...
							headers/...
							headers/ZMQSender.h
							sources/...
							sources/...
							sources/...
							sources/...
							sources/recording_service.cpp
							sources/...
							sources/...
							sources/...
							sources/...
	)

adtf_add_system_service(${PROJECT_TARGETNAME} ${PROJECT_SOURCES})
adtf_use_qt(Network Core)
adtf_create_plugindescription(TARGET ${PROJECT_TARGETNAME} PLUGIN_SUBDIR ${PROJECT_INSTALL_SUFFIX})


set_target_properties(${PROJECT_TARGETNAME} PROPERTIES AUTOMOC ON)

target_include_directories(${PROJECT_NAME}
	PUBLIC
	${PROJECT_SOURCE_DIR}/headers
)

target_link_libraries(${PROJECT_TARGETNAME}
	PUBLIC
	cppzmq
	adtf::ui Qt5::Network
	adtf::ui Qt5::Core
	adtf::devicetb::sdk
)

### install(FILES ${CMAKE_CURRENT_BINARY_DIR}/recording_service.adtfenvironment DESTINATION .)

I have an additional CMakeSettings.txt where I set the paths to the both zmq source code folders:

set(cppzmq_DIR "C:/Work/03_Git/cppzmq-4.8.1/build")
set(ZeroMQ_DIR "C:/Work/03_Git/zeromq-4.3.4/build")
  1. Can you help me out what is probably going wrong?
  2. What is the minimum of files I need to include into my project, so that I can make use of the zmq (cppzmq) library?

Raffro avatar Nov 11 '21 06:11 Raffro

If you have successfully build libzmq and cppzmq then this looks like a problem with ADTF.

gummif avatar Nov 12 '21 11:11 gummif

Thank you, I will keep this ticket updated when I receive feedback from the ADTF support.

On the other hand: what minimum artifacts do I need to include cppzmq to my project?

  • I know that there is a release of libzmq which contains the dll, but how can I implement this within my cmakelists?
  • As for cppzmq: is the zmq.hpp sufficient or is anythin else needed?

Raffro avatar Nov 12 '21 16:11 Raffro

Hi @gummif : It was an error by not specifying the 3rd party library.

But is it possible that I just link the libzmq.dll and the zmq.hpp file? How do I need to configure cmake, so that my plugin can be build without having everybody to have the zmq repos checked out...? Can you give me an example?

Raffro avatar Nov 24 '21 15:11 Raffro