Fix compiling test cases on Debian

This commit is contained in:
Sebastian Messmer 2016-02-14 18:17:37 +01:00
parent b324ec5221
commit 63d0b2b29d
5 changed files with 3 additions and 18 deletions

View File

@ -35,11 +35,6 @@ set(SOURCES
add_library(${PROJECT_NAME} STATIC ${SOURCES})
# This is needed by boost thread
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_link_libraries(${PROJECT_NAME} PUBLIC rt)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
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().

View File

@ -3,7 +3,7 @@
#include "../../testutils/BlockStoreTest.h"
#include "../../testutils/BlockStoreWithRandomKeysTest.h"
#include <gtest/gtest.h>
#include <cpp-utils/pointer/unique_ref_boost_optional_gtest_workaround.h>
using blockstore::BlockStore;
using blockstore::BlockStoreWithRandomKeys;

View File

@ -53,10 +53,5 @@ add_executable(${PROJECT_NAME} ${SOURCES})
target_link_libraries(${PROJECT_NAME} googletest cpp-utils)
add_test(${PROJECT_NAME} ${PROJECT_NAME})
# This is needed by boost thread
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_link_libraries(${PROJECT_NAME} PUBLIC rt)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_enable_style_warnings(${PROJECT_NAME})
target_activate_cpp14(${PROJECT_NAME})

View File

@ -106,10 +106,5 @@ add_executable(${PROJECT_NAME} ${SOURCES})
target_link_libraries(${PROJECT_NAME} googletest fspp)
add_test(${PROJECT_NAME} ${PROJECT_NAME})
# This is needed by boost thread
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_link_libraries(${PROJECT_NAME} PUBLIC rt)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
target_enable_style_warnings(${PROJECT_NAME})
target_activate_cpp14(${PROJECT_NAME})

View File

@ -45,7 +45,7 @@ function(target_add_boost TARGET)
REQUIRED
COMPONENTS ${ARGN})
target_include_directories(${TARGET} SYSTEM PRIVATE ${Boost_INCLUDE_DIRS})
target_link_libraries(${TARGET} PUBLIC ${Boost_LIBRARIES})
target_link_libraries(${TARGET} PUBLIC ${Boost_LIBRARIES} rt) # Also link to rt, because boost thread needs that.
endfunction(target_add_boost)
##################################################
@ -102,4 +102,4 @@ function(find_library_with_path OUTPUT_VARIABLE LIBRARY_NAME PATH_VARIABLE)
message(STATUS "Found ${LIBRARY_NAME} in system location")
endif(${OUTPUT_VARIABLE} MATCHES NOTFOUND)
endif(${PATH_VARIABLE})
endfunction(find_library_with_path)
endfunction(find_library_with_path)