When compiling the project with cmake withing a ROS1 environment, the compiler termites with an error about "CMake Error at CMakeLists.txt:21 (set_target_properties): set_target_properties called with incorrect number of arguments".
Fixed by inserting cmake variables within double quotes.
Primary changes are:
- Versioning integrated in cmake build system with library for version usage in end user programs
- New minimum CMAke required version is 3.14
- Created install capabilities. Allows uvgRTP to be used in different scenarios for win and lin (mac-os still missing)
- Added testing environment with automatically fetched google test and some example test code.
- Added packaging capabilities (and some placeholders that have to be changed)
- Create Shared library with -DBUILD_SHARED_LIBS=TRUE
I think it is better to have all code belonging to a single class be
included in one code file. If the code file gets too large, then the
probably the class itself has too many responsibilities.
Although it is possible to separate a class implementation to different
files, I would consider this class too large instead. It is somewhat
confusing having to look for implementations from different files. I
would try to make the class smaller instead by dividing it on class
level.
The 2.0.0 release of uvgRTP fails to build on CentOS7, because :
- the gcc-c++ compiler doesn't support the c++17 standard, which is
required to compile the crypto.hh file
- the getrandom() function isn't available in the libc
This pull request adds CentOS7 build support.
The modified files are :
- CMakeLists.txt : the availability of the getrandom() function is checked.
If it exists, the HAVE_GETRANDOM preprocessor definition is added
- src/random.cc : if HAVE_GETRANDOM isn't defined, a syscall equivalent to
the getrandom() functions is called
- include/crypto.hh : the c++17 code is replaced by a code that compiles with
the CentOS7 compiler (c++11)
The solution in 1f26987bf0 does not work, since
the add_compile_options must be set before defining library. Reverted to
previous solution with improvements. Now also the standard is set at the
beginning of the file just to make sure it takes effect in time.
I'm still learning to use CMake.
This way, if we want to support lower c++ version, setting the standard should
automatically set the highest standard supported.
Also update the way compiler options are set.
Add new H26x files to QtCreator and CMake build files and remove
Visual Studio project files as they are too painful to maintain
manually and they can be generated very easily using CMake
Add all new source and header files to Visual Studio, CMake and
QtCreator project files.
Rename rtcp/runner.cc and zrtp/receiver.cc files because they
caused linking problems with QtCreator