CMake <3.19 does not support interface targets with sources.
For better IDE integrations we still can add the config.h using the
`target_sources` command.
Signed-off-by: Kai Buschulte <kai.buschulte@cedalo.com>
Use `ctest` or `make test` to run all tests.
With this it's also possible to run tests on a Mac.
Relative paths used in tests become absolute ones to make tests
executable from any build folder.
Also fixed race condition in
test/broker/11-persistent-subscription-no-local.py
Signed-off-by: Kai Buschulte <kai.buschulte@cedalo.com>
This is an interface cmake target which specifies include directories
required by the config.h places in the root of the project.
This header is a "public" header visible to plugins linking the
mosquitto exports.
Signed-off-by: Kai Buschulte <kai.buschulte@cedalo.com>
Core symbols needed by plugins are now properly linked to their objects
* Remove link_directories() call:
This specification is not necessary for our own libraries as cmake
shares this information over the targets.
If needed they should be specified target specific, like done for
the external DLT library.
Signed-off-by: Kai Buschulte <kai.buschulte@cedalo.com>
CMake >= 3.14 comes with a preinstalled FindSQLite3 module, which now
replaces the self-written one.
Signed-off-by: Kai Buschulte <kai.buschulte@cedalo.com>
When using cmake to build the project, cJson discovery
should only be performed if WITH_CJSON=ON.
Closes#2026.
Signed-off-by: Boris Feinstein <madhat1@gmail.com>
The code would simply append the folder with no separator, resulting in an invalid path if the variable was not empty.
Now properly append it.
Signed-off-by: Pierre Hallot <hallotpierre@gmail.com>
https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html
"Note Call the cmake_minimum_required() command at the beginning of the top-level CMakeLists.txt file even before calling the project() command. It is important to establish version and policy settings before invoking other commands whose behavior they may affect."
Signed-off-by: Pierre Hallot <hallotpierre@gmail.com>
According to this from the mailing list, it is no longer required since the minimum cmake required is 3.0.
https://cmake.org/pipermail/cmake/2014-July/058048.html
"The code that emits the warning is run by "project()". Since you do not have an explicit project() call in your top-level CMakeLists.txt CMake adds one to the top implicitly. [1]
A project file that explicitly calls project() after requiring CMake >= 2.8.4 should make the warning go away."
Signed-off-by: Pierre Hallot <hallotpierre@gmail.com>
Some client/app code also optionally use cJSON, however it won't be found if plugins are disabled.
Signed-off-by: Pierre Hallot <hallotpierre@gmail.com>