add libexpat to the build

develop
Myk Taylor 2020-08-08 20:18:43 -07:00
parent e7afc4cfeb
commit 8a05f09cd6
2 changed files with 18 additions and 7 deletions

@ -433,11 +433,13 @@ if(BUILD_LIBRARY)
IMPORTED_LOCATION ${LIBZIP_INSTALL_DIR}/lib64/libzip.a)
add_dependencies(zip libzip_project)
# just pull from the system until I figure out how to integrate these deps
# into the build
add_library(expat SHARED IMPORTED)
ExternalProject_Get_Property(libexpat_project INSTALL_DIR)
set(LIBEXPAT_INSTALL_DIR ${INSTALL_DIR})
include_directories(${LIBEXPAT_INSTALL_DIR}/include)
add_library(expat STATIC IMPORTED)
set_target_properties(expat PROPERTIES
IMPORTED_LOCATION /usr/lib64/libexpat.so)
IMPORTED_LOCATION ${LIBEXPAT_INSTALL_DIR}/lib64/libexpat.a)
add_dependencies(expat libexpat_project)
add_subdirectory(library)
install(FILES LICENSE.rst docs/changelog.txt DESTINATION ${DFHACK_USERDOC_DESTINATION})

@ -18,6 +18,15 @@ option(CLSOCKET_DEP_ONLY "Build for use inside other CMake projects as dependenc
add_subdirectory(clsocket)
ide_folder(clsocket "Depends")
set(LIBEXPAT_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/libexpat)
ExternalProject_Add(libexpat_project
PREFIX libexpat
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libexpat/expat
INSTALL_DIR ${LIBEXPAT_INSTALL_DIR}
BUILD_BYPRODUCTS ${LIBEXPAT_INSTALL_DIR}/lib64/libexpat.a
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBEXPAT_INSTALL_DIR} -DCMAKE_BUILD_TYPE=Release -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF -DEXPAT_BUILD_TOOLS=OFF -DEXPAT_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON
)
set(LIBZIP_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/libzip)
ExternalProject_Add(libzip_project
PREFIX libzip
@ -33,7 +42,7 @@ ExternalProject_Add(xlsxio_project
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/xlsxio
INSTALL_DIR ${XLSXIO_INSTALL_DIR}
BUILD_BYPRODUCTS ${XLSXIO_INSTALL_DIR}/lib/libxlsxio_read.a
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${XLSXIO_INSTALL_DIR} -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC=ON -DBUILD_SHARED=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_TOOLS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_DOCUMENTATION=OFF -DWITH_LIBZIP=ON -DZLIB_DIR=${ZLIB_DIR}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${XLSXIO_INSTALL_DIR} -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC=ON -DBUILD_SHARED=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_TOOLS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_DOCUMENTATION=OFF -DWITH_LIBZIP=ON -DZLIB_DIR=${ZLIB_DIR} -DLIBZIP_DIR=${LIBZIP_INSTALL_DIR} -DEXPAT_DIR=${LIBEXPAT_INSTALL_DIR}
)
#-DLIBZIP_DIR=
#-DEXPAT_DIR=
add_dependencies(xlsxio_project libexpat_project)
add_dependencies(xlsxio_project libzip_project)