Think cmake is figured out

This commit is contained in:
Ian Roddis
2021-06-03 21:22:00 -03:00
parent 850d177ff5
commit d7b32ce03a
3 changed files with 16 additions and 11 deletions

View File

@@ -1,19 +1,23 @@
project(pistache)
include(ExternalProject)
set(PISTACHE_BINARY_DIR ${THIRD_PARTY_DIR}/pistache)
ExternalProject_Add(${PROJECT_NAME}_extern
ExternalProject_Add(PistacheDownload
PREFIX third_party
GIT_REPOSITORY https://github.com/pistacheio/pistache.git
GIT_TAG master
BINARY_DIR ${PISTACHE_BINARY_DIR}
INSTALL_COMMAND ""
)
add_library(${PROJECT_NAME} STATIC IMPORTED)
add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_extern)
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)
set_target_properties(${PROJECT_NAME} PROPERTIES IMPORTED_LOCATION "${PISTACHE_BINARY_DIR}/lib/libpistache.a")
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/")
#target_include_directories(${PROJECT_NAME} SYSTEM INTERFACE "${PISTACHE_BINARY_DIR}/include/")