Fix compile on Debian 8 (link it to a library it wants)

This commit is contained in:
Sebastian Messmer 2016-02-14 16:54:29 +01:00
parent 31bf927e07
commit e44c44334f
5 changed files with 3 additions and 17 deletions

View File

@ -18,10 +18,6 @@ set(SOURCES
add_library(${PROJECT_NAME} STATIC ${SOURCES}) add_library(${PROJECT_NAME} STATIC ${SOURCES})
# This is needed by boost thread
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_link_libraries(${PROJECT_NAME} PRIVATE rt)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_link_libraries(${PROJECT_NAME} PUBLIC cpp-utils blockstore) target_link_libraries(${PROJECT_NAME} PUBLIC cpp-utils blockstore)
target_add_boost(${PROJECT_NAME} filesystem system thread) target_add_boost(${PROJECT_NAME} filesystem system thread)

View File

@ -31,11 +31,6 @@ set(SOURCES
add_library(${PROJECT_NAME} STATIC ${SOURCES}) add_library(${PROJECT_NAME} STATIC ${SOURCES})
# This is needed by boost thread
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_link_libraries(${PROJECT_NAME} PRIVATE rt)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_link_libraries(${PROJECT_NAME} PUBLIC cpp-utils) target_link_libraries(${PROJECT_NAME} PUBLIC cpp-utils)
target_add_boost(${PROJECT_NAME} filesystem system thread) target_add_boost(${PROJECT_NAME} filesystem system thread)

View File

@ -37,10 +37,10 @@ add_library(${PROJECT_NAME} STATIC ${SOURCES})
# This is needed by boost thread # This is needed by boost thread
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_link_libraries(${PROJECT_NAME} PRIVATE rt) target_link_libraries(${PROJECT_NAME} PUBLIC rt)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_link_libraries(${PROJECT_NAME} PRIVATE pthread curl) target_link_libraries(${PROJECT_NAME} PUBLIC pthread curl)
# TODO From Crypto++ 5.7 on, it should support cmake with find_package() instead of find_library(). # TODO From Crypto++ 5.7 on, it should support cmake with find_package() instead of find_library().
find_library_with_path(CryptoPP cryptopp CRYPTOPP_LIB_PATH) find_library_with_path(CryptoPP cryptopp CRYPTOPP_LIB_PATH)

View File

@ -8,11 +8,6 @@ set(SOURCES
add_library(${PROJECT_NAME} STATIC ${SOURCES}) add_library(${PROJECT_NAME} STATIC ${SOURCES})
# This is needed by boost thread
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_link_libraries(${PROJECT_NAME} PRIVATE rt)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_compile_definitions(${PROJECT_NAME} PUBLIC _FILE_OFFSET_BITS=64) target_compile_definitions(${PROJECT_NAME} PUBLIC _FILE_OFFSET_BITS=64)
target_link_libraries(${PROJECT_NAME} PUBLIC cpp-utils) target_link_libraries(${PROJECT_NAME} PUBLIC cpp-utils)

View File

@ -45,7 +45,7 @@ function(target_add_boost TARGET)
REQUIRED REQUIRED
COMPONENTS ${ARGN}) COMPONENTS ${ARGN})
target_include_directories(${TARGET} SYSTEM PRIVATE ${Boost_INCLUDE_DIRS}) target_include_directories(${TARGET} SYSTEM PRIVATE ${Boost_INCLUDE_DIRS})
target_link_libraries(${TARGET} PRIVATE ${Boost_LIBRARIES}) target_link_libraries(${TARGET} PUBLIC ${Boost_LIBRARIES})
endfunction(target_add_boost) endfunction(target_add_boost)
################################################## ##################################################