specify expat include dir for xlsxio

develop
Myk Taylor 2020-08-09 02:14:37 -07:00
parent c7cf7fdd30
commit 204240f3e3
1 changed files with 5 additions and 3 deletions

@ -35,13 +35,15 @@ foreach(var ${vars})
endforeach() endforeach()
if(WIN32) if(WIN32)
set(LIB_SUFFIX "MD.lib") set(EXPAT_LIB_SUFFIX "MD.lib")
set(LIB_SUFFIX ".lib")
else() else()
set(EXPAT_LIB_SUFFIX ".a")
set(LIB_SUFFIX ".a") set(LIB_SUFFIX ".a")
endif() endif()
set(LIBEXPAT_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/libexpat) set(LIBEXPAT_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/libexpat)
set(LIBEXPAT_OUTPUT_LIB ${LIBEXPAT_INSTALL_DIR}/lib/libexpat${LIB_SUFFIX}) set(LIBEXPAT_OUTPUT_LIB ${LIBEXPAT_INSTALL_DIR}/lib/libexpat${EXPAT_LIB_SUFFIX})
ExternalProject_Add(libexpat_project ExternalProject_Add(libexpat_project
PREFIX libexpat PREFIX libexpat
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libexpat/expat SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libexpat/expat
@ -65,7 +67,7 @@ ExternalProject_Add(xlsxio_project
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/xlsxio SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/xlsxio
INSTALL_DIR ${XLSXIO_INSTALL_DIR} INSTALL_DIR ${XLSXIO_INSTALL_DIR}
BUILD_BYPRODUCTS ${XLSXIO_INSTALL_DIR}/lib/libxlsxio_read${LIB_SUFFIX} 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} -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=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_OUTPUT_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 libexpat_project)
add_dependencies(xlsxio_project libzip_project) add_dependencies(xlsxio_project libzip_project)