Created by: SanjayMarreddi
Hi,
This fixes the generated CMakeLists.txt when used with cpprestsdk framework (see the details below).
The generated CMakeFiles.txt contains the following issues (tested with the latest cpprestsdk version available: 2.10.18
):
-
The public dependency on CppRestSDK is not matching the one from the generated CMake config files on Unix, but is correct for Windows. Name mismatch:
cpprest
instead ofcpprestsdk::cpprest
. -
The library links against the whole Boost libraries (usage of
Boost_LIBRARIES
) whereas it only needsboost/algorithm/*.hpp
andboost/uuid/*.hpp
which are headers-only. Boost CMake finder provides different targets (see more details in https://cmake.org/cmake/help/latest/module/FindBoost.html). The one for the headers isBoost::headers
. -
The project does not provide an option to build either a dynamic or static library. When compiling as shared libraries,
crypto
for Unix (andbcrypt
for Windows) are not needed. Those are dependencies of CppRestSDK and should not even be here. -
Regarding 3), in my experience, dynamic libraries are the most common way to distribute C++ libraries. I would recommend to set the default build to a shared library instead of a static one. Please let me know if you think that could be an issue, and why.
Testing:
I tested the build of a OpenAPI C++ client with the dynamic and static configuration, and it succeeded without any error.
PR checklist
-
Read the contribution guidelines. -
Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community. -
Run the following to build the project and update samples: ./mvnw clean package ./bin/generate-samples.sh ./bin/utils/export_docs_generators.sh
./bin/generate-samples.sh bin/configs/java*
. For Windows users, please run the script in Git BASH. -
File the PR against the correct branch: master
(6.1.0) (minor release - breaking changes with fallbacks),7.0.x
(breaking changes without fallbacks) -
If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.
Kindly review it! @ravinikam @stkrwork @etherealjoy @MartinDelille @muttleyxd
Regards, Sanjay