|
|
|
@ -18,67 +18,40 @@ option(CLSOCKET_DEP_ONLY "Build for use inside other CMake projects as dependenc
|
|
|
|
|
add_subdirectory(clsocket)
|
|
|
|
|
ide_folder(clsocket "Depends")
|
|
|
|
|
|
|
|
|
|
# assemble environment args to pass on to dependency projects
|
|
|
|
|
get_cmake_property(vars CACHE_VARIABLES)
|
|
|
|
|
foreach(var ${vars})
|
|
|
|
|
if(var MATCHES "^CMAKE_"
|
|
|
|
|
AND NOT var MATCHES "^CMAKE_CACHE"
|
|
|
|
|
AND NOT var MATCHES "^CMAKE_HOME"
|
|
|
|
|
AND NOT var MATCHES "^CMAKE_PROJECT")
|
|
|
|
|
list(APPEND CL_ARGS "-D${var}=${${var}}")
|
|
|
|
|
endif()
|
|
|
|
|
if(var MATCHES "^ZLIB")
|
|
|
|
|
list(APPEND CL_ARGS "-D${var}=${${var}}")
|
|
|
|
|
endif()
|
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
|
|
include(ExternalProject)
|
|
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
|
set(EXPAT_LIB_NAME_SUFFIX "MD")
|
|
|
|
|
set(XLSXIO_C_FLAGS "${CMAKE_C_FLAGS} /DXML_STATIC")
|
|
|
|
|
else()
|
|
|
|
|
set(EXPAT_LIB_NAME_SUFFIX "")
|
|
|
|
|
set(XLSXIO_C_FLAGS "${CMAKE_C_FLAGS} -DXML_STATIC")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
set(LIBEXPAT_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/libexpat)
|
|
|
|
|
set(LIBEXPAT_LIB ${LIBEXPAT_INSTALL_DIR}/lib/libexpat${EXPAT_LIB_NAME_SUFFIX}${CMAKE_STATIC_LIBRARY_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_LIB}
|
|
|
|
|
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
|
|
|
|
|
CMAKE_GENERATOR_TOOLSET "${CMAKE_GENERATOR_TOOLSET}"
|
|
|
|
|
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
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
set(LIBZIP_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/libzip)
|
|
|
|
|
set(LIBZIP_LIB ${LIBZIP_INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}zip${CMAKE_STATIC_LIBRARY_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_LIB}
|
|
|
|
|
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
|
|
|
|
|
CMAKE_GENERATOR_TOOLSET "${CMAKE_GENERATOR_TOOLSET}"
|
|
|
|
|
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
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
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/${CMAKE_STATIC_LIBRARY_PREFIX}xlsxio_read${CMAKE_STATIC_LIBRARY_SUFFIX})
|
|
|
|
|
set(XLSXIO_LIB ${XLSXIO_LIB} PARENT_SCOPE)
|
|
|
|
|
ExternalProject_Add(xlsxio_project
|
|
|
|
|
PREFIX xlsxio
|
|
|
|
|
DEPENDS libexpat_project libzip_project
|
|
|
|
|
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/xlsxio
|
|
|
|
|
INSTALL_DIR ${XLSXIO_INSTALL_DIR}
|
|
|
|
|
BUILD_BYPRODUCTS ${XLSXIO_LIB}
|
|
|
|
|
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
|
|
|
|
|
CMAKE_GENERATOR_TOOLSET "${CMAKE_GENERATOR_TOOLSET}"
|
|
|
|
|
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_DIRS=${LIBEXPAT_INSTALL_DIR}/include -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_C_FLAGS=${XLSXIO_C_FLAGS}
|
|
|
|
|
)
|
|
|
|
|
# set the default values of libexpat options - the descriptions are left empty
|
|
|
|
|
# because later option() calls *do* override those
|
|
|
|
|
set(EXPAT_BUILD_EXAMPLES OFF CACHE BOOL "")
|
|
|
|
|
set(EXPAT_BUILD_TESTS OFF CACHE BOOL "")
|
|
|
|
|
set(EXPAT_BUILD_TOOLS OFF CACHE BOOL "")
|
|
|
|
|
set(EXPAT_SHARED_LIBS OFF CACHE BOOL "")
|
|
|
|
|
set(EXPAT_BUILD_DOCS OFF CACHE BOOL "")
|
|
|
|
|
set(EXPAT_ENABLE_INSTALL OFF CACHE BOOL "")
|
|
|
|
|
add_subdirectory(libexpat/expat)
|
|
|
|
|
|
|
|
|
|
set(LIBZIP_BUILD_DOC OFF CACHE BOOL "")
|
|
|
|
|
set(LIBZIP_BUILD_EXAMPLES OFF CACHE BOOL "")
|
|
|
|
|
set(LIBZIP_BUILD_REGRESS OFF CACHE BOOL "")
|
|
|
|
|
set(LIBZIP_BUILD_SHARED_LIBS OFF CACHE BOOL "")
|
|
|
|
|
set(LIBZIP_BUILD_TOOLS OFF CACHE BOOL "")
|
|
|
|
|
set(LIBZIP_ENABLE_BZIP2 OFF CACHE BOOL "")
|
|
|
|
|
set(LIBZIP_ENABLE_COMMONCRYPTO OFF CACHE BOOL "")
|
|
|
|
|
set(LIBZIP_ENABLE_GNUTLS OFF CACHE BOOL "")
|
|
|
|
|
set(LIBZIP_ENABLE_LZMA OFF CACHE BOOL "")
|
|
|
|
|
set(LIBZIP_ENABLE_MBEDTLS OFF CACHE BOOL "")
|
|
|
|
|
set(LIBZIP_ENABLE_OPENSSL OFF CACHE BOOL "")
|
|
|
|
|
set(LIBZIP_ENABLE_WINDOWS_CRYPTO OFF CACHE BOOL "")
|
|
|
|
|
set(LIBZIP_DO_INSTALL OFF CACHE BOOL "")
|
|
|
|
|
add_subdirectory(libzip)
|
|
|
|
|
|
|
|
|
|
set(XLSXIO_USE_DFHACK_LIBS ON CACHE BOOL "")
|
|
|
|
|
set(XLSXIO_BUILD_STATIC ON CACHE BOOL "")
|
|
|
|
|
set(XLSXIO_BUILD_SHARED OFF CACHE BOOL "")
|
|
|
|
|
set(XLSXIO_BUILD_DOCUMENTATION OFF CACHE BOOL "")
|
|
|
|
|
set(XLSXIO_BUILD_EXAMPLES OFF CACHE BOOL "")
|
|
|
|
|
set(XLSXIO_BUILD_TOOLS OFF CACHE BOOL "")
|
|
|
|
|
set(XLSXIO_WITH_LIBZIP ON CACHE BOOL "")
|
|
|
|
|
set(XLSXIO_ZLIB_DIR "${ZLIB_DIR}" CACHE PATH "")
|
|
|
|
|
set(XLSXIO_LIBZIP_DIR "${CMAKE_CURRENT_BINARY_DIR}/libzip" CACHE PATH "")
|
|
|
|
|
set(XLSXIO_EXPAT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libexpat" CACHE PATH "")
|
|
|
|
|
set(XLSXIO_ENABLE_INSTALL OFF CACHE BOOL "")
|
|
|
|
|
add_subdirectory(xlsxio)
|
|
|
|
|