Closed samueldaniel closed 4 months ago
I am pulling cpr into my project in what seems to be a standard manner:
set(CPR_ENABLE_SSL ON) set(CPR_BUILD_TESTS OFF) set(CPR_BUILD_TESTS_SSL OFF) include(FetchContent) FetchContent_Declare(cpr GIT_REPOSITORY https://github.com/libcpr/cpr.git GIT_TAG 340acc5cdad624b9398827eec2832fe2fd05f966) FetchContent_MakeAvailable(cpr)
After building the project successfully, I try to install it to some prefix:
$ cmake --install build/x86_64-linux-gnu/ --prefix /home/sam/repos/project/install
And the installation fails trying to copy libz.a to /usr/local/lib:
libz.a
/usr/local/lib
CMake Error at build/x86_64-linux-gnu/_deps/zlib-build/cmake_install.cmake:54 (file): file INSTALL cannot copy file "/home/sam/repos/project/build/x86_64-linux-gnu/_deps/zlib-build/libz.a" to "/usr/local/lib/libz.a": Permission denied. Call Stack (most recent call first): build/x86_64-linux-gnu/_deps/cpr-build/cmake_install.cmake:47 (include) build/x86_64-linux-gnu/extern/cmake_install.cmake:47 (include) build/x86_64-linux-gnu/cmake_install.cmake:52 (include)
Use cpr as an external dependency and try to install it (and your project) to some non-standard prefix.
No response
GitHub (branch e.g. master)
This is only a problem with zlib enabled. If I set set(CURL_ZLIB OFF) then this problem does not occur.
set(CURL_ZLIB OFF)
nevermind - I cannot reproduce this
This seems to be a known issue with zlib itself:
Description
I am pulling cpr into my project in what seems to be a standard manner:
After building the project successfully, I try to install it to some prefix:
And the installation fails trying to copy
libz.a
to/usr/local/lib
:Example/How to Reproduce
Use cpr as an external dependency and try to install it (and your project) to some non-standard prefix.
Possible Fix
No response
Where did you get it from?
GitHub (branch e.g. master)
Additional Context/Your Environment