Can't build against Casablanca in "atypical" location
gri6507 opened this issue · 1 comments
I have Casablanca (cpprest SDK) built locally and installed in /usr/lib/x86_64-linux-gnu/libcpprest.so
. When I run
git clone https://github.com/Azure/azure-storage-cpp.git
cd azure-storage-cpp
git checkout v7.5.0
git submodule update --init
cd Microsoft.WindowsAzure.Storage
mkdir build.release
cd build.release
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DBUILD_SAMPLES=OFF
this correctly finds Casablanca in the path shown above. However, when I then run cmake --build .
I get the following error:
[ 98%] Building CXX object src/CMakeFiles/azurestorage.dir/crc64.cpp.o
make[2]: *** No rule to make target '/usr/lib/x86_64-linux-gnu/libcpprest.so', needed by 'Binaries/libazurestorage.so.7.5'. Stop.
CMakeFiles/Makefile2:85: recipe for target 'src/CMakeFiles/azurestorage.dir/all' failed
make[1]: *** [src/CMakeFiles/azurestorage.dir/all] Error 2
Why did CMake create a target for /usr/lib/x86_64-linux-gnu/libcpprest.so
? What is the right way to build? Even though https://github.com/Azure/azure-storage-cpp#getting-started-on-linux has some instructions for specifying CASABLANCA_DIR
to point to a custom directory, that still assumes a structure within that directory which I do not have.
For sake of completeness, this is on Ubuntu 18.04 system and I actually have /usr/lib/x86_64-linux-gnu/cmake/cpprestsdk/
with *.cmake
files from my cpprest build.
This looks to be due to an error on my part because /usr/lib/x86_64-linux-gnu/libcpprest.so
was a symlink to a non-existent file. Once I properly updated the symlink, CMake works fine.
I wish CMake was clearer about errors like this :-(