xlnt/third-party/CMakeLists.txt

60 lines
2.2 KiB
CMake
Raw Normal View History

2016-10-28 06:40:20 +08:00
include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/common.cmake)
project(${LIBRARY_NAME}.third-party VERSION ${LIBRARY_VERSION} LANGUAGES CXX C)
# Includes
include_directories(miniz
libstudxml
utfcpp/source
pole
botan
${LIBRARY_SOURCE_DIR}/detail)
set(MINIZ
2016-10-28 19:54:37 +08:00
${CMAKE_CURRENT_SOURCE_DIR}/miniz/miniz.c
${CMAKE_CURRENT_SOURCE_DIR}/miniz/miniz.h)
2016-10-28 06:40:20 +08:00
set(LIBSTUDXML
2016-10-28 19:54:37 +08:00
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/parser.cxx
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/qname.cxx
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/serializer.cxx
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/value-traits.cxx
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/details/expat/xmlparse.c
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/details/expat/xmlrole.c
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/details/expat/xmltok_impl.c
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/details/expat/xmltok_ns.c
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/details/expat/xmltok.c
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/details/genx/char-props.c
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/details/genx/genx.c)
2016-10-28 06:40:20 +08:00
set(POLE pole/pole.cpp)
set(BOTAN ${CMAKE_CURRENT_SOURCE_DIR}/botan/botan_all.cpp)
if(MSVC)
set_source_files_properties(${BOTAN} PROPERTIES COMPILE_FLAGS "/wd\"4244\"")
endif()
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
set(CPU "x64")
else()
set(CPU "x86")
endif()
add_custom_command(OUTPUT ${BOTAN}
COMMAND python configure.py --minimized-build --enable-modules=sha1,aes,filters,codec_filt,cbc,ecb,sha2_32,sha2_64 --without-sphinx --disable-shared --amalgamation --cpu=${CPU}
2016-10-28 06:40:20 +08:00
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/botan
COMMENT "Generating botan amalgamation ${BOTAN}")
add_library(xlnt.third-party OBJECT ${MINIZ} ${LIBSTUDXML} ${POLE} ${BOTAN})
target_compile_definitions(xlnt.third-party PRIVATE LIBSTUDXML_STATIC_LIB=1)
if(NOT STATIC)
set_target_properties(xlnt.third-party
PROPERTIES POSITION_INDEPENDENT_CODE 1)
endif()
2016-10-28 06:40:20 +08:00
if(MSVC)
target_compile_definitions(xlnt.third-party PRIVATE _CRT_SECURE_NO_WARNINGS=1 NOMINMAX)
set_target_properties(xlnt.third-party PROPERTIES COMPILE_FLAGS "/MP")
endif()
source_group(miniz FILES ${MINIZ})
source_group(libstudxml FILES ${LIBSTUDXML})