Allow setting library locations using CMake parameters

This commit is contained in:
Sebastian Messmer 2016-02-14 03:13:50 +01:00
parent b3dc0e9b58
commit 0286f36cf6
3 changed files with 9 additions and 3 deletions

View File

@ -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

View File

@ -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)

View File

@ -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})