I am working on the integration of paho.mqtt.cpp and thus also paho.mqtt.c in a CMAKE project where the libraries are not installed locally but built within the workspace of the project (config time). The resulting installation directories are simply added to the CMAKE_PREFIX_PATH within the root CMakeLists.txt file.
This is working nicely under Linux, but under Windows I'm having troubles with the runtime selection: I am building both libraries using an execute_process call which invokes CMAKE within the corresponding repository (e.g., this repository). However, such a call does not seem to pass on the /MD or /MT` selection that can be performed, e.g., using the below instruction, resulting in the paho libs always being built for the dynamically linked runtime lib.
I am also using Google's protobuffer, where a compile-time flag is available to select the runtime. The same concept could be applied to the CMakeLists.txt of this repository (and a matching update for the paho.mqtt.c lib), e.g., using the following:
Then any project could also select the runtime lib using a flag. This is working nicely with patched CMakeLists.txt. I just wanted to ask if this is of any interest then I'd open a PR.
Hi,
I am working on the integration of
paho.mqtt.cpp
and thus alsopaho.mqtt.c
in a CMAKE project where the libraries are not installed locally but built within the workspace of the project (config time). The resulting installation directories are simply added to theCMAKE_PREFIX_PATH
within the rootCMakeLists.txt
file.This is working nicely under Linux, but under Windows I'm having troubles with the runtime selection: I am building both libraries using an
execute_process
call which invokes CMAKE within the corresponding repository (e.g., this repository). However, such a call does not seem to pass on the/MD
or /MT` selection that can be performed, e.g., using the below instruction, resulting in the paho libs always being built for the dynamically linked runtime lib.I am also using Google's protobuffer, where a compile-time flag is available to select the runtime. The same concept could be applied to the
CMakeLists.txt
of this repository (and a matching update for thepaho.mqtt.c
lib), e.g., using the following:Then any project could also select the runtime lib using a flag. This is working nicely with patched
CMakeLists.txt
. I just wanted to ask if this is of any interest then I'd open a PR.