- Sidequest: Clean up header-only library dependencies with cmake.

This commit is contained in:
Ian Roddis
2021-08-13 12:43:39 -03:00
parent de8025e0f9
commit 71344b3a2a
12 changed files with 82 additions and 48 deletions

23
cmake/pistache.cmake Normal file
View File

@@ -0,0 +1,23 @@
project(pistache)
include(ExternalProject)
ExternalProject_Add(PistacheDownload
PREFIX third_party
GIT_REPOSITORY https://github.com/pistacheio/pistache.git
GIT_TAG master
INSTALL_COMMAND ""
)
set(PISTACHE_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/third_party/src/PistacheDownload/include)
set(PISTACHE_LIB_DIR ${CMAKE_CURRENT_BINARY_DIR}/third_party/src/PistacheDownload-build/src)
add_library(${PROJECT_NAME} SHARED IMPORTED)
add_dependencies(${PROJECT_NAME} $PistacheDownload)
set_target_properties(${PROJECT_NAME} PROPERTIES IMPORTED_LOCATION "${PISTACHE_LIB_DIR}/libpistache.a")
#add_library(${PROJECT_NAME} STATIC IMPORTED)
#set_target_properties(${PROJECT_NAME} PROPERTIES IMPORTED_LOCATION "${PISTACHE_BINARY_DIR}/lib/libpistache.a")
#file(MAKE_DIRECTORY "${PISTACHE_BINARY_DIR}/include")
#target_include_directories(${PROJECT_NAME} SYSTEM INTERFACE "${PISTACHE_BINARY_DIR}/include/")