cppdap: Build as part of CMake or use external installation

Add `cm3p/` headers to use the selected copy of the library.

Co-authored-by: Glen Chung <kuchung@microsoft.com>
This commit is contained in:
Brad King
2023-05-19 10:33:13 -04:00
parent 3381e6bd5c
commit 5ec69eb58c
14 changed files with 161 additions and 4 deletions

View File

@@ -376,3 +376,19 @@ if(BUILD_CursesDialog)
message(FATAL_ERROR "CMAKE_USE_SYSTEM_FORM in ON but CURSES_FORM_LIBRARY is not set!")
endif()
endif()
#---------------------------------------------------------------------
# Build cppdap library.
if(CMake_ENABLE_CPPDAP)
if(CMAKE_USE_SYSTEM_CPPDAP)
find_package(cppdap CONFIG)
if(NOT cppdap_FOUND)
message(FATAL_ERROR
"CMAKE_USE_SYSTEM_CPPDAP is ON but a cppdap is not found!")
endif()
else()
add_subdirectory(Utilities/cmcppdap)
add_library(cppdap::cppdap ALIAS cmcppdap)
CMAKE_SET_TARGET_FOLDER(cppdap "Utilities/3rdParty")
endif()
endif()