Skip to content

Commit

Permalink
Merge pull request #120 from skalenetwork/enchancement/dependency-lin…
Browse files Browse the repository at this point in the history
…k-fix

dependency-link-fix resolved problem with not found libs by cmake
  • Loading branch information
sergiy-skalelabs authored Mar 23, 2021
2 parents 785b7ab + 506f74e commit 8724cb4
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions threshold_encryption/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ if(BUILD_TESTS)
enable_testing()
endif()

find_library( PBC_LIBRARY NAMES "pbc" PATHS "${DEPS_INSTALL_ROOT}/lib" )

set(sources
threshold_encryption.cpp
TEDecryptSet.cpp
Expand Down Expand Up @@ -56,24 +54,46 @@ link_directories(${CMAKE_BINARY_DIR}/deps/lib)

target_include_directories(te PRIVATE ${PBC_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${THIRD_PARTY_DIR})
target_link_libraries(te PRIVATE ${PBC_LIBRARY})
target_link_libraries(
te
PRIVATE
pbc
)

if (BUILD_TESTS)
add_executable(dkg_te_unit_test ../test/unit_tests_dkg_te.cpp)
target_include_directories(dkg_te_unit_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${TEST_DIR})
target_link_libraries(dkg_te_unit_test PRIVATE te ${PBC_LIBRARY} ${GMP_LIBRARY} ${GMPXX_LIBRARY})
target_link_libraries(dkg_te_unit_test
PRIVATE
te
pbc
${GMP_LIBRARY}
${GMPXX_LIBRARY}
)

add_test(NAME dkg_te_tests COMMAND dkg_te_unit_test)

add_executable(te_unit_test ../test/unit_tests_te.cpp)
target_include_directories(te_unit_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${THIRD_PARTY_DIR})
target_link_libraries(te_unit_test PRIVATE te ${PBC_LIBRARY} ${GMP_LIBRARY} ${GMPXX_LIBRARY})
target_link_libraries(te_unit_test
PRIVATE
te
pbc
${GMP_LIBRARY}
${GMPXX_LIBRARY}
)

add_test(NAME te_tests COMMAND te_unit_test)

add_executable(te_test ../test/test_TE_wrappers.cpp)
target_include_directories(te_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${THIRD_PARTY_DIR})
target_link_libraries(te_test PRIVATE te ${PBC_LIBRARY} ${GMP_LIBRARY} ${GMPXX_LIBRARY})
target_link_libraries(te_test
PRIVATE
te
pbc
${GMP_LIBRARY}
${GMPXX_LIBRARY}
)

add_test(NAME te_wrap_tests COMMAND te_unit_test)

Expand Down

0 comments on commit 8724cb4

Please sign in to comment.