admin管理员组文章数量:1312931
Stil in the learning CMake phase, I want to move the build of an existing APR based application to this build system. But, in the same time I want to use APR and APR-Util libraries as Git submodules. The folder structure is simple and it looks like this:
adsp
|
---- build
|
---- deps
| |
| ---- apr ---> [email protected]:apache/apr.git
| |
| ---- apr-util ---> [email protected]:apache/apr-util.git
|
---- distro
|
CMakeLists.txt
main.c
The CMakeLists.txt
cmake_minimum_required(VERSION 3.31)
project(adsp C)
set(CMAKE_C_STANDARD 11)
set(APR_MINIMAL_BUILD "ON")
set(INSTALL_PDB "OFF")
set(CMAKE_INSTALL_PREFIX "../distro")
add_subdirectory(deps/apr)
after execution of the commands
cmake -S . -B build && cmake --build build --target install -j6
produces a successful build and the APR library is installed into the distro
folder.
But, when I add the APR-Util library to the CMakeLists.list
...
add_subdirectory(deps/apr-util)
...
it fails:
CMake Error at deps/apr-util/CMakeLists.txt:32 (FIND_PACKAGE):
By not providing "FindAPR.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "APR", but
CMake did not find one.
Could not find a package configuration file provided by "APR" with any of
the following names:
APRConfig.cmake
apr-config.cmake
Add the installation prefix of "APR" to CMAKE_PREFIX_PATH or set "APR_DIR"
to a directory containing one of the above files. If "APR" provides a
separate development package or SDK, be sure it has been installed.
I tried to introduce the dependency, but I got the same error:
target_link_libraries(APR-Util PUBLIC APR)
As the error suggested, I defined this variable
set(APR_DIR "../distro/lib/cmake/apr")
but even so, I got the same error.
What else could I do, to get APR-Util built?
KI
本文标签: aprFailing CMake buildGit submodules as dependenciesStack Overflow
版权声明:本文标题:apr - Failing CMake build - Git submodules as dependencies - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741896741a2403619.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论