From ded16fbe8d5c146ed413c8682fc67a8b8e40a3ce Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Tue, 31 Jan 2023 04:55:12 +0800 Subject: [PATCH] Fix CMakeLists for MacPorts diff --git a/CMakeLists.txt b/CMakeLists.txt index 7cb4f6dc..9198c575 100644 --- CMakeLists.txt +++ CMakeLists.txt @@ -438,37 +438,10 @@ ## should be sent upstream. ## Restbed is therefore compiled by Android toolchain preparation script target_link_libraries(${PROJECT_NAME} PRIVATE restbed) - elseif(EXISTS "${RESTBED_DEVEL_DIR}/CMakeLists.txt") - message( STATUS - "Restbed submodule found at ${RESTBED_DEVEL_DIR} using it" ) - add_subdirectory( - ${RESTBED_DEVEL_DIR} - ${CMAKE_BINARY_DIR}/restbed - EXCLUDE_FROM_ALL ) - # EXCLUDE_FROM_ALL prevent executing install directives from included - # dependencies see https://stackoverflow.com/a/64900982 - - target_include_directories( - ${PROJECT_NAME} PRIVATE "${RESTBED_DEVEL_DIR}/source/" ) - target_link_libraries(${PROJECT_NAME} PRIVATE restbed) else() - message( WARNING - "FetchContent restbed, will be installed if you run make install") - FetchContent_Declare( - restbed - GIT_REPOSITORY "https://github.com/Corvusoft/restbed.git" - GIT_TAG "4.8" - GIT_SUBMODULES dependency/asio dependency/catch - GIT_SHALLOW TRUE - GIT_PROGRESS TRUE - TIMEOUT 10 -# EXCLUDE_FROM_ALL # Available only in CMake >= 3.28 - ) - FetchContent_MakeAvailable(restbed) - target_include_directories( - ${PROJECT_NAME} PRIVATE ${restbed_SOURCE_DIR}/source/ ) - target_link_libraries(${PROJECT_NAME} PRIVATE restbed-static) + ${PROJECT_NAME} PUBLIC @PREFIX@/include/restbed/ ) + target_link_libraries(${PROJECT_NAME} PUBLIC restbed) endif()