Skip to content

Commit

Permalink
[#28] Fixed cpprest usage for Linux in CI/CD
Browse files Browse the repository at this point in the history
Signed-off-by: Clovis Durand <cd.clovel19@gmail.com>
  • Loading branch information
Clovel committed Apr 5, 2020
1 parent b5361a4 commit 3b7c863
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion generator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ if(OPENSSL_FOUND)
message(STATUS "OpenSSL Version: ${OPENSSL_VERSION} ${OPENSSL_INCLUDE_DIR} ${OPENSSL_LIBRARIES}")
endif(APPLE)
endif(OPENSSL_FOUND)
find_package(cpprestsdk REQUIRED)
if(UNIX AND NOT APPLE)
set(cpprestsdk_DIR /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/cmake/)
endif(UNIX AND NOT APPLE)
find_package(cpprestsdk REQUIRED NAMES cpprestsdk cpprest)

#------------------------------------------------------------------------------
# pkg-config dependencies
Expand Down
8 changes: 5 additions & 3 deletions generator/src/rest/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ list(REMOVE_ITEM SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp)
add_library(cpprest-api SHARED
${SOURCES}
)
target_link_libraries(cpprest-api
target_link_libraries(cpprest-api PRIVATE
cpprestsdk::cpprest
)
set_target_properties(cpprest-api PROPERTIES
Expand All @@ -48,10 +48,12 @@ add_executable(cpprest-api-test
add_dependencies(cpprest-api-test
cpprest-api
)
target_link_libraries(cpprest-api-test
cpprestsdk::cpprest
target_link_libraries(cpprest-api-test PUBLIC
cpprest-api
)
target_link_libraries(cpprest-api-test PRIVATE
cpprestsdk::cpprest
)

#----------------------------------------------------------------------------
# The installation is prepended by the CMAKE_INSTALL_PREFIX variable
Expand Down

0 comments on commit 3b7c863

Please sign in to comment.