I need to port an RTP library to a new platform (the Espressif ESP32). I pulled a copy of ortp from github. It depends on bctoolbox (from the same author), which in turn depends on mbedtls.
The bctoolbox path is (Windows) C:\esp32-projects\ortp.
The mbedtls (furnished by Espressif) path for source is C:\esp-idf\components\mbedtls.
The mbedls path for the binary is C:\esp32-projects\ortp\build\esp-idf\mbedtls.
So I’ve looked at the documentation, and found the add_library command. Is this the appropriate way to make bctoolbox “aware” of this library? It seems like the right command, but it also seems kind of odd that I’d have to list all the source files in this directory structure.
It’s not 100% clear (to me) what you are trying to do.
If, what you are saying is that you want to build these tools using CMake (and they don’t already support it), then there are two different things you need to do.
The first is, you need to build your library dependencies. So, for example, in your ortp\CMakeLists.txt file you would have add_library. While it is possible to specify the files in the library using a glob pattern, the best practice is to list all the files. If you want full IDE support, you might want to list all the headers too.
The second is, you need to tell your project about your library. If you build them as a single “super project” then CMake knows about it already. If you built it as an independent project, you will need to support find_package.
FWIW, I’m still looking for a good tutorial on the second topic.
Thanks for answering. In this case, both ortp and bctoolbox appear to use CMake. When I attempt to build bctoolbox, I get this error:
– Could NOT find Decaf (missing: Decaf_DIR)
– DTLS SRTP not available
CMake Error at CMakeLists.txt:121 (find_package):
Could not find a package configuration file provided by “BcUnit” with any
of the following names:
BcUnitConfig.cmake
bcunit-config.cmake
Add the installation prefix of “BcUnit” to CMAKE_PREFIX_PATH or set
“BcUnit_DIR” to a directory containing one of the above files. If “BcUnit”
provides a separate development package or SDK, be sure it has been
installed.
So, it looks like I have two issues:
I don’t have this decaf thing
CMake can’t find BcUnit (for that matter, neither can I).
I don’t really know that this is a CMake problem at this point, but…do you have any insight into either of these problems?
So, this is progress. Now I’m getting this:
CMake Error at C:/Qt/Tools/CMake_32/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
Could NOT find Threads (missing: Threads_FOUND)
A brief search within the bctoolbox structure didn’t reveal anything by the name “threads,” and it’s not mentioned in the README. Any ideas on this one?
I think this is where the exercise is going to become more difficult, and it’s not a CMake issue. I was intending to build the ortp library for an ESP32, which runs FreeRTOS (and not the version with the POSIX stuff). Espressif does supply a pthread library in their IDF, but it appears to be proprietary: ESP-IDF pthread header file
So, I’m probably out of luck.
Thank you for the help with CMake, though…it’s been educational.
EDIT:
I suppose there’s no harm in trying. So, if the path to the pthread directory is “C:\esp-idf\components\pthread,” what is the CMake construct that I use to tell the bctoolbox build to look here?