ensure libexpat is used as a static lib

develop
Myk Taylor 2020-08-10 00:01:47 -07:00
parent 679ca41da8
commit 6da364a60b
1 changed files with 3 additions and 1 deletions

@ -38,10 +38,12 @@ if(WIN32)
set(EXPAT_LIB_SUFFIX "MD.lib")
set(LIB_SUFFIX ".lib")
set(LIB_PREFIX "")
set(XLSXIO_C_FLAGS "${CMAKE_C_FLAGS} /DXML_STATIC")
else()
set(EXPAT_LIB_SUFFIX ".a")
set(LIB_SUFFIX ".a")
set(LIB_PREFIX "lib")
set(XLSXIO_C_FLAGS "${CMAKE_C_FLAGS} -DXML_STATIC")
endif()
set(LIBEXPAT_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/libexpat)
@ -76,5 +78,5 @@ ExternalProject_Add(xlsxio_project
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/xlsxio
INSTALL_DIR ${XLSXIO_INSTALL_DIR}
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_DIRS=${LIBEXPAT_INSTALL_DIR}/include -DCMAKE_POSITION_INDEPENDENT_CODE=ON
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}
)