clean up dep lib vars

develop
Myk Taylor 2020-08-09 02:24:05 -07:00
parent 204240f3e3
commit 79415cf097
2 changed files with 13 additions and 20 deletions

@ -417,32 +417,17 @@ endif()
# build the lib itself
if(BUILD_LIBRARY)
ExternalProject_Get_Property(xlsxio_project INSTALL_DIR)
set(XLSXIO_INSTALL_DIR ${INSTALL_DIR})
ExternalProject_Get_Property(xlsxio_project BUILD_BYPRODUCTS)
set(XLSXIO_LIB ${BUILD_BYPRODUCTS})
include_directories(${XLSXIO_INSTALL_DIR}/include)
add_library(xlsxio_read STATIC IMPORTED)
set_target_properties(xlsxio_read PROPERTIES IMPORTED_LOCATION ${XLSXIO_LIB})
add_dependencies(xlsxio_read xlsxio_project)
ExternalProject_Get_Property(libzip_project INSTALL_DIR)
set(LIBZIP_INSTALL_DIR ${INSTALL_DIR})
ExternalProject_Get_Property(libzip_project BUILD_BYPRODUCTS)
set(LIBZIP_LIB ${BUILD_BYPRODUCTS})
include_directories(${LIBZIP_INSTALL_DIR}/include)
add_library(zip STATIC IMPORTED)
set_target_properties(zip PROPERTIES IMPORTED_LOCATION ${LIBZIP_LIB})
add_dependencies(zip libzip_project)
ExternalProject_Get_Property(libexpat_project INSTALL_DIR)
set(LIBEXPAT_INSTALL_DIR ${INSTALL_DIR})
ExternalProject_Get_Property(libexpat_project BUILD_BYPRODUCTS)
set(LIBEXPAT_LIB ${BUILD_BYPRODUCTS})
include_directories(${LIBEXPAT_INSTALL_DIR}/include)
add_library(expat STATIC IMPORTED)
set_target_properties(expat PROPERTIES IMPORTED_LOCATION ${LIBEXPAT_LIB})
add_dependencies(expat libexpat_project)
add_subdirectory(library)
install(FILES LICENSE.rst docs/changelog.txt DESTINATION ${DFHACK_USERDOC_DESTINATION})

@ -43,31 +43,39 @@ else()
endif()
set(LIBEXPAT_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/libexpat)
set(LIBEXPAT_OUTPUT_LIB ${LIBEXPAT_INSTALL_DIR}/lib/libexpat${EXPAT_LIB_SUFFIX})
set(LIBEXPAT_INSTALL_DIR ${LIBEXPAT_INSTALL_DIR} PARENT_SCOPE)
set(LIBEXPAT_LIB ${LIBEXPAT_INSTALL_DIR}/lib/libexpat${EXPAT_LIB_SUFFIX})
set(LIBEXPAT_LIB ${LIBEXPAT_LIB} PARENT_SCOPE)
ExternalProject_Add(libexpat_project
PREFIX libexpat
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libexpat/expat
INSTALL_DIR ${LIBEXPAT_INSTALL_DIR}
BUILD_BYPRODUCTS ${LIBEXPAT_OUTPUT_LIB}
BUILD_BYPRODUCTS ${LIBEXPAT_LIB}
CMAKE_ARGS ${CL_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_INSTALL_LIBDIR=lib -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
)
set(LIBZIP_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/libzip)
set(LIBZIP_INSTALL_DIR ${LIBZIP_INSTALL_DIR} PARENT_SCOPE)
set(LIBZIP_LIB ${LIBZIP_INSTALL_DIR}/lib/libzip${LIB_SUFFIX})
set(LIBZIP_LIB ${LIBZIP_LIB} PARENT_SCOPE)
ExternalProject_Add(libzip_project
PREFIX libzip
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libzip
INSTALL_DIR ${LIBZIP_INSTALL_DIR}
BUILD_BYPRODUCTS ${LIBZIP_INSTALL_DIR}/lib/libzip${LIB_SUFFIX}
BUILD_BYPRODUCTS ${LIBZIP_LIB}
CMAKE_ARGS ${CL_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBZIP_INSTALL_DIR} -DCMAKE_BUILD_TYPE=Release -DBUILD_DOC=OFF -DBUILD_EXAMPLES=OFF -DBUILD_REGRESS=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_TOOLS=OFF -DENABLE_BZIP2=OFF -DENABLE_COMMONCRYPTO=OFF -DENABLE_GNUTLS=OFF -DENABLE_LZMA=OFF -DENABLE_MBEDTLS=OFF -DENABLE_OPENSSL=OFF -DENABLE_WINDOWS_CRYPTO=OFF -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
)
set(XLSXIO_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/xlsxio)
set(XLSXIO_INSTALL_DIR ${XLSXIO_INSTALL_DIR} PARENT_SCOPE)
set(XLSXIO_LIB ${XLSXIO_INSTALL_DIR}/lib/libxlsxio_read${LIB_SUFFIX})
set(XLSXIO_LIB ${XLSXIO_LIB} PARENT_SCOPE)
ExternalProject_Add(xlsxio_project
PREFIX xlsxio
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/xlsxio
INSTALL_DIR ${XLSXIO_INSTALL_DIR}
BUILD_BYPRODUCTS ${XLSXIO_INSTALL_DIR}/lib/libxlsxio_read${LIB_SUFFIX}
CMAKE_ARGS ${CL_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} -DEXPAT_LIBRARIES=${LIBEXPAT_OUTPUT_LIB} -DEXPAT_INCLUDE_DIR=${LIBEXPAT_INSTALL_DIR}/include -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
BUILD_BYPRODUCTS ${XLSXIO_LIB}
CMAKE_ARGS ${CL_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} -DEXPAT_LIBRARIES=${LIBEXPAT_LIB} -DEXPAT_INCLUDE_DIR=${LIBEXPAT_INSTALL_DIR}/include -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
)
add_dependencies(xlsxio_project libexpat_project)
add_dependencies(xlsxio_project libzip_project)