Skip to content

Commit b3b6cc8

Browse files
committed
Merge branch 'find-websocketpp' of https://git01.codeplex.com/forks/locutusofborg/casablanca2 into misc_cmake_pull_requests
2 parents e2290fb + 48db656 commit b3b6cc8

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

Release/CMakeLists.txt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,20 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Binaries)
165165

166166
# These settings can be used by the test targets
167167
set(Casablanca_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
168-
set(Casablanca_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include ${Boost_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/libs/websocketpp)
168+
169+
find_path(WEBSOCKETPP_CONFIG websocketpp-config.cmake
170+
HINTS /usr/lib/cmake/websocketpp)
171+
find_path(WEBSOCKETPP_CONFIG_VERSION websocketpp-configVersion.cmake
172+
HINTS /usr/lib/cmake/websocketpp)
173+
if(WEBSOCKETPP_CONFIG AND WEBSOCKETPP_CONFIG_VERSION)
174+
include(${WEBSOCKETPP_CONFIG}/websocketpp-config.cmake)
175+
include(${WEBSOCKETPP_CONFIG}/websocketpp-configVersion.cmake)
176+
message("-- Found websocketpp version " ${PACKAGE_VERSION} " on system")
177+
set(Casablanca_INCLUDE_DIRS ${Casablanca_INCLUDE_DIR} ${Boost_INCLUDE_DIR} ${WEBSOCKETPP_INCLUDE_DIR})
178+
else(WEBSOCKETPP_CONFIG AND WEBSOCKETPP_CONFIG_VERSION)
179+
set(Casablanca_INCLUDE_DIRS ${Casablanca_INCLUDE_DIR} ${Boost_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/libs/websocketpp)
180+
message("-- websocketpp not found, using the embedded version")
181+
endif(WEBSOCKETPP_CONFIG AND WEBSOCKETPP_CONFIG_VERSION)
169182

170183
set(Casablanca_LIBRARY ${LIB}cpprest)
171184
set(Casablanca_LIBRARIES ${Casablanca_LIBRARY} ${Boost_LIBRARIES} ${Boost_FRAMEWORK})

0 commit comments

Comments
 (0)