- More cmake cleanup

This commit is contained in:
Ian Roddis
2021-08-13 13:21:55 -03:00
parent 71344b3a2a
commit 35857f9513
6 changed files with 33 additions and 42 deletions

View File

@@ -1,23 +1,25 @@
project(pistache)
include(ExternalProject)
ExternalProject_Add(PistacheDownload
PREFIX third_party
GIT_REPOSITORY https://github.com/pistacheio/pistache.git
GIT_TAG master
INSTALL_COMMAND ""
)
set_directory_properties(PROPERTIES EP_UPDATE_DISCONNECTED true)
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(pistache_root ${THIRD_PARTY_DIR}/${PROJECT_NAME})
ExternalProject_Add(PistacheDownload
PREFIX ${pistache_root}
GIT_REPOSITORY https://github.com/pistacheio/pistache.git
GIT_TAG master
INSTALL_COMMAND ""
)
ExternalProject_Get_Property(PistacheDownload SOURCE_DIR)
set(PISTACHE_INCLUDE_DIR ${SOURCE_DIR}/include)
set(PISTACHE_LIB_DIR ${pistache_root}/src/PistacheDownload-build/src)
file(MAKE_DIRECTORY ${PISTACHE_INCLUDE_DIR})
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/")
add_dependencies(${PROJECT_NAME} PistacheDownload)
target_include_directories(${PROJECT_NAME} INTERFACE ${PISTACHE_INCLUDE_DIR})
set_target_properties(${PROJECT_NAME} PROPERTIES IMPORTED_LOCATION "${PISTACHE_LIB_DIR}/libpistache.a")