From 0286f36cf676451358cfef0e18c753a0320fe390 Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Sun, 14 Feb 2016 03:13:50 +0100 Subject: [PATCH] Allow setting library locations using CMake parameters --- README.md | 6 ++++++ src/cpp-utils/CMakeLists.txt | 2 +- src/fspp/CMakeLists.txt | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ae004df0..832a99a5 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,12 @@ Build & Install 3. Install $ sudo make install + +You can pass the following variables to CMake (using *-Dvariablename=value*): + - **CMAKE_BUILD_TYPE**=[Release|Debug]: Whether to run code optimization or add debug symbols + - **BUILD_TESTING**=[on|off]: Whether to build the test cases (can take a long time) + - **FUSE_LIB_PATH**=[path]: Path to the directory containing the fuse library (or osxfuse library on Mac) + - **CRYPTOPP_LIB_PATH**=[path]: Path to the directory containing the Crypto++ library Creating .deb packages diff --git a/src/cpp-utils/CMakeLists.txt b/src/cpp-utils/CMakeLists.txt index 859f5131..f4abfd41 100644 --- a/src/cpp-utils/CMakeLists.txt +++ b/src/cpp-utils/CMakeLists.txt @@ -43,7 +43,7 @@ endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") target_link_libraries(${PROJECT_NAME} PRIVATE pthread curl) # TODO From Crypto++ 5.7 on, it should support cmake with find_package() instead of find_library(). -find_library(CryptoPP cryptopp) +find_library(CryptoPP cryptopp $ENV{CRYPTOPP_LIB_PATH}) target_link_libraries(${PROJECT_NAME} PUBLIC ${CryptoPP} scrypt spdlog) target_add_boost(${PROJECT_NAME} filesystem system thread) diff --git a/src/fspp/CMakeLists.txt b/src/fspp/CMakeLists.txt index 38f28ff5..1510893e 100644 --- a/src/fspp/CMakeLists.txt +++ b/src/fspp/CMakeLists.txt @@ -21,9 +21,9 @@ target_enable_style_warnings(${PROJECT_NAME}) target_activate_cpp14(${PROJECT_NAME}) if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - find_library(FUSE osxfuse) + find_library(FUSE osxfuse $ENV{FUSE_LIB_PATH}) else(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - find_library(FUSE fuse) + find_library(FUSE fuse $ENV{FUSE_LIB_PATH}) endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") target_link_libraries(${PROJECT_NAME} PRIVATE ${FUSE})