Skip to content

Update cmake for SignalR C++ client on Mac OS X #8669

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/SignalR/clients/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ include
"${CPPREST_INCLUDE_DIR}")

find_library(CPPREST_SO NAMES "cpprest" PATHS ${CPPREST_LIB_DIR} REQUIRED)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
find_package(Boost COMPONENTS chrono thread REQUIRED)
endif()

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)

add_subdirectory(src/signalrclient)
add_subdirectory(test)
#add_subdirectory(test)
set_property(TARGET signalrclient PROPERTY MACOSX_RPATH ON)
6 changes: 5 additions & 1 deletion src/SignalR/clients/cpp/src/signalrclient/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@ set (SOURCES

add_library (signalrclient SHARED ${SOURCES})

target_link_libraries(signalrclient ${CPPREST_SO})
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
target_link_libraries(signalrclient ${CPPREST_SO} ${Boost_LIBRARIES} libssl.dylib libcrypto.dylib)
else()
target_link_libraries(signalrclient ${CPPREST_SO})
endif()