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/")