Configurable drogon_ctl location#2453
Configurable drogon_ctl location#2453gav2xlin wants to merge 1 commit intodrogonframework:masterfrom
Conversation
|
I've tested my change, but I use Conan
conan install -r conancenter --update . --build=missingconan install . --build=missingand cmake --preset conan-release -DCMAKE_VERBOSE_MAKEFILE=ON The first command prints this from this project https://github.com/PacktPublishing/Software-Architecture-with-Cpp-2E/tree/ch12-drogon-ctl/Chapter12/customer Chapter12/customer/src/customer/CMakeLists.txt build/Release/generators/CMakePresets.json drogon_ctl is compiled and installed here In your tests and builds, find_program(DROGON_CTL drogon_ctl REQUIRED) is called before the drogon_ctl command is built and installed 🤔 |
Hello. Please make the location of the drogon_ctl command configurable from CMake scripts directly.
https://cmake.org/cmake/help/latest/command/find_program.html
https://cmake.org/cmake/help/latest/variable/CMAKE_PROGRAM_PATH.html
The Drogon library is not always installed on the system so that the path to the
drogon_ctlcommand globally set in thePATHenvironment variable. At the same time, the CMAKE_PROGRAM_PATH variable is configurable from CMake scripts.https://github.com/drogonframework/drogon/blob/master/cmake/DrogonUtilities.cmake
I'm considering a scenario where the Drogon library is installed by package managers such as Conan which creates its own environment.
From my system:
~/.conan2$ find . -iname 'drogon_ctl' ./p/b/drogoa449f6147cb12/p/bin/drogon_ctl ./p/b/drogoa449f6147cb12/b/build/Release/drogon_ctl ./p/b/drogoa449f6147cb12/b/build/Release/drogon_ctl/drogon_ctl ./p/b/drogoa449f6147cb12/b/src/drogon_ctl ./p/b/drogo79535e018a23d/p/bin/drogon_ctl ./p/b/drogo79535e018a23d/b/build/Debug/drogon_ctl ./p/b/drogo79535e018a23d/b/build/Debug/drogon_ctl/drogon_ctl ./p/b/drogo79535e018a23d/b/src/drogon_ctl ./p/drogo60067c88c49b2/s/src/drogon_ctlThis has been fixed. Hence, this script is included automatically in the builds, but the drogon_create_views() function still does not work because it is impossible to configure the path to this command anywhere 🤔