2016-12-14 06:48:38 +08:00
|
|
|
cmake_minimum_required(VERSION 3.1)
|
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
|
2016-10-31 03:48:40 +08:00
|
|
|
include_directories(libstudxml
|
2016-10-28 06:40:20 +08:00
|
|
|
utfcpp/source
|
2016-10-31 04:01:42 +08:00
|
|
|
zlib
|
2016-12-14 06:48:38 +08:00
|
|
|
cryptopp
|
2016-10-31 04:01:42 +08:00
|
|
|
${LIBRARY_SOURCE_DIR}/detail)
|
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
|
2016-11-01 08:48:43 +08:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/value-traits.cxx
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/content
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/exception
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/forward
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/parser
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/qname
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/serializer
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/value-traits)
|
|
|
|
|
|
|
|
set(EXPAT
|
2016-10-28 19:54:37 +08:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/details/expat/xmlparse.c
|
2016-11-01 08:48:43 +08:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/details/expat/xmlrole.c
|
2016-10-28 19:54:37 +08:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/details/expat/xmltok_impl.c
|
2016-11-01 08:48:43 +08:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/details/expat/xmltok_ns.c
|
2016-10-28 19:54:37 +08:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/details/expat/xmltok.c
|
2016-11-01 08:48:43 +08:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/details/expat/ascii.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/details/expat/asciitab.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/details/expat/config.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/details/expat/expat_external.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/details/expat/expat.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/details/expat/iasciitab.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/details/expat/internal.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/details/expat/latin1tab.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/details/expat/nametab.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/details/expat/utf8tab.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/details/expat/xmlrole.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/details/expat/xmltok_impl.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/details/expat/xmltok.h)
|
|
|
|
|
|
|
|
set(GENX
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/details/genx/char-props.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/details/genx/genx.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libstudxml/xml/details/genx/genx.h)
|
|
|
|
|
2016-10-31 03:48:40 +08:00
|
|
|
set(ZLIB ${CMAKE_CURRENT_SOURCE_DIR}/zlib/adler32.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/zlib/compress.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/zlib/crc32.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/zlib/deflate.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/zlib/infback.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/zlib/inffast.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/zlib/inflate.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/zlib/inftrees.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/zlib/trees.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/zlib/uncompr.c
|
2016-11-01 08:48:43 +08:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/zlib/zutil.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/zlib/crc32.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/zlib/deflate.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/zlib/inffast.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/zlib/inffixed.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/zlib/inflate.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/zlib/inftrees.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/zlib/trees.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/zlib/zconf.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/zlib/zlib.h
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/zlib/zutil.h)
|
2016-10-28 06:40:20 +08:00
|
|
|
|
2017-01-02 23:47:54 +08:00
|
|
|
file(GLOB CRYPTOPP ${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/*.cpp)
|
|
|
|
list(REMOVE_ITEM CRYPTOPP
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/simple.cpp
|
2017-01-03 03:47:22 +08:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/rdrand.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/pch.cpp
|
2017-01-02 23:47:54 +08:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/winpipes.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/cryplib_bds.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/test.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/bench1.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/bench2.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/validat0.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/validat1.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/validat2.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/validat3.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/adhoc.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/datatest.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/regtest.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/fipsalgt.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/dlltest.cpp
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/fipstest.cpp)
|
|
|
|
if(MINGW OR WIN32)
|
|
|
|
list(APPEND CRYPTOPP ${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/winpipes.cpp)
|
|
|
|
endif()
|
|
|
|
|
2017-01-03 06:41:39 +08:00
|
|
|
if(NOT MSVC)
|
|
|
|
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/basecode.cpp PROPERTIES
|
|
|
|
COMPILE_FLAGS "-Wno-unused-private-field")
|
|
|
|
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/rw.cpp PROPERTIES
|
|
|
|
COMPILE_FLAGS "-Wno-unused-const-variable")
|
|
|
|
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/filters.cpp PROPERTIES
|
|
|
|
COMPILE_FLAGS "-Wno-reorder")
|
|
|
|
endif()
|
|
|
|
|
2016-11-01 08:48:43 +08:00
|
|
|
if(NOT MSVC)
|
|
|
|
set_source_files_properties(${ZLIB} PROPERTIES COMPILE_FLAGS "-Wno-implicit-function-declaration")
|
2016-11-10 08:52:18 +08:00
|
|
|
else()
|
|
|
|
set_source_files_properties(${ZLIB} PROPERTIES COMPILE_FLAGS "/wd\"4018\"")
|
2016-10-28 06:40:20 +08:00
|
|
|
endif()
|
|
|
|
|
2017-01-03 06:41:39 +08:00
|
|
|
add_library(xlnt.third-party STATIC
|
2017-01-02 23:47:54 +08:00
|
|
|
${LIBSTUDXML}
|
|
|
|
${GENX}
|
|
|
|
${EXPAT}
|
|
|
|
${ZLIB}
|
|
|
|
${CRYPTOPP})
|
|
|
|
target_compile_definitions(xlnt.third-party
|
|
|
|
PRIVATE LIBSTUDXML_STATIC_LIB=1
|
|
|
|
PRIVATE NO_OS_DEPENDENCE=1
|
|
|
|
PRIVATE CRYPTOPP_DISABLE_ASM=1)
|
2016-10-28 06:40:20 +08:00
|
|
|
|
2016-10-28 10:09:10 +08:00
|
|
|
if(NOT STATIC)
|
2017-01-02 23:47:54 +08:00
|
|
|
set_target_properties(xlnt.third-party PROPERTIES POSITION_INDEPENDENT_CODE 1)
|
2016-10-28 10:09:10 +08:00
|
|
|
endif()
|
|
|
|
|
2016-10-28 06:40:20 +08:00
|
|
|
if(MSVC)
|
2017-01-02 23:47:54 +08:00
|
|
|
target_compile_definitions(xlnt.third-party PRIVATE
|
|
|
|
_CRT_SECURE_NO_WARNINGS=1
|
|
|
|
NOMINMAX)
|
2016-10-28 06:40:20 +08:00
|
|
|
set_target_properties(xlnt.third-party PROPERTIES COMPILE_FLAGS "/MP")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
source_group(libstudxml FILES ${LIBSTUDXML})
|
2016-11-01 08:48:43 +08:00
|
|
|
source_group(libstudxml\\genx FILES ${GENX})
|
|
|
|
source_group(libstudxml\\expat FILES ${EXPAT})
|
2016-10-31 03:48:40 +08:00
|
|
|
source_group(zlib FILES ${ZLIB})
|