diff --git a/README.md b/README.md index 00e97a44..ada4e69d 100644 --- a/README.md +++ b/README.md @@ -88,10 +88,13 @@ Build & Install $ sudo make install -You can pass the following variables to CMake (using *-Dvariablename=value*): +You can pass the following variables to the *cmake* command (using *-Dvariablename=value*): - -D**CMAKE_BUILD_TYPE**=[Release|Debug]: Whether to run code optimization or add debug symbols. Default: Release - -D**BUILD_TESTING**=[on|off]: Whether to build the test cases (can take a long time). Default: off +Troubleshooting +--------------- + On most systems, CMake should find the libraries automatically. If this doesn't work for you, you can use the following CMake variables: - -D**FUSE_LIB_PATH**=[path]: Path to the directory containing the fuse library (or osxfuse library on Mac) diff --git a/src/fspp/CMakeLists.txt b/src/fspp/CMakeLists.txt index 45a25865..51352bc0 100644 --- a/src/fspp/CMakeLists.txt +++ b/src/fspp/CMakeLists.txt @@ -18,7 +18,9 @@ target_activate_cpp14(${PROJECT_NAME}) if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(CMAKE_FIND_FRAMEWORK LAST) set(FUSE_LIB_NAME "osxfuse") -else(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + # Add a default location for homebrew-installed openssl on Mac OS X to include search path + target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC /usr/local/include/osxfuse) +elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(FUSE_LIB_NAME "fuse") endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") diff --git a/utils.cmake b/utils.cmake index 15ba2be6..9c037dd7 100644 --- a/utils.cmake +++ b/utils.cmake @@ -45,7 +45,11 @@ function(target_add_boost TARGET) REQUIRED COMPONENTS ${ARGN}) target_include_directories(${TARGET} SYSTEM PRIVATE ${Boost_INCLUDE_DIRS}) - target_link_libraries(${TARGET} PUBLIC ${Boost_LIBRARIES} rt) # Also link to rt, because boost thread needs that. + target_link_libraries(${TARGET} PUBLIC ${Boost_LIBRARIES}) + if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + # Also link to rt, because boost thread needs that. + target_link_libraries(${TARGET} PUBLIC rt) + endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") endfunction(target_add_boost) ################################################## diff --git a/vendor/scrypt/CMakeLists.txt b/vendor/scrypt/CMakeLists.txt index ff5d91cd..bea2e0bc 100644 --- a/vendor/scrypt/CMakeLists.txt +++ b/vendor/scrypt/CMakeLists.txt @@ -7,6 +7,12 @@ project (scrypt C) string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILDTYPE) set(SCRYPT_CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${BUILDTYPE}}") set(SCRYPT_CPPFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${BUILDTYPE}}") + +# Add a default location for homebrew-installed openssl on Mac OS X to include search path +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set(SCRYPT_CFLAGS "${SCRYPT_CFLAGS} -I/usr/local/opt/openssl/include") +endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + ExternalProject_Add(scrypt_original SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/scrypt-1.2.0/scrypt CONFIGURE_COMMAND /usr/bin/env CC=${CMAKE_C_COMPILER} CFLAGS=${SCRYPT_CFLAGS} CPPFLAGS=${SCRYPT_CPPFLAGS} ${CMAKE_CURRENT_SOURCE_DIR}/scrypt-1.2.0/scrypt/configure --prefix=${CMAKE_BINARY_DIR}/vendor/scrypt/