From 29ea2a4e998655004e88d9b58a222ae16fb95091 Mon Sep 17 00:00:00 2001 From: Thomas Fussell Date: Fri, 10 Mar 2017 18:48:22 -0500 Subject: [PATCH] install expat with vcpkg on appveyor, always link cryptopp and zlib --- .appveyor.yml | 2 +- source/CMakeLists.txt | 18 ++++-------------- third-party/libstudxml/CMakeLists.txt | 8 +++----- 3 files changed, 8 insertions(+), 20 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index fb16a57c..af9a335a 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -16,7 +16,7 @@ install: - mkdir downloads - type nul > downloads\AlwaysAllowDownloads - powershell -exec bypass scripts\bootstrap.ps1 -- vcpkg install cryptopp zlib +- vcpkg install cryptopp zlib expat - vcpkg integrate install - cd .. diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 99136e8e..9dcf9e5b 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -129,20 +129,10 @@ add_dependencies(xlnt xlnt.third-party) target_link_libraries(xlnt PRIVATE libstudxml) target_include_directories(xlnt PUBLIC ${XLNT_INCLUDE_DIR}) target_include_directories(xlnt PRIVATE ${XLNT_SOURCE_DIR}) - -if(LOCAL_ZLIB OR LOCAL_DEPENDENCIES) - target_link_libraries(xlnt PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third-party/zlib/zlib-download-prefix/src/zlib-download-build/libz.a) -else() - target_link_libraries(xlnt PRIVATE ${ZLIB_LIBRARY_RELEASE}) - target_include_directories(xlnt PRIVATE ${ZLIB_INCLUDE_DIR}) -endif() - -if(LOCAL_CRYPTOPP OR LOCAL_DEPENDENCIES) - target_link_libraries(xlnt PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/third-party/cryptopp/cryptopp-download-prefix/src/cryptopp-download-build/libcryptopp.a) -else() - target_link_libraries(xlnt PRIVATE ${CRYPTOPP_LIBRARY_RELEASE}) - target_include_directories(xlnt PRIVATE ${CRYPTOPP_INCLUDE_DIR}) -endif() +target_link_libraries(xlnt PRIVATE ${ZLIB_LIBRARY_RELEASE}) +target_include_directories(xlnt PRIVATE ${ZLIB_INCLUDE_DIR}) +target_link_libraries(xlnt PRIVATE ${CRYPTOPP_LIBRARY_RELEASE}) +target_include_directories(xlnt PRIVATE ${CRYPTOPP_INCLUDE_DIR}) if(MSVC) set_target_properties(xlnt PROPERTIES COMPILE_FLAGS "/wd\"4251\" /wd\"4275\" /wd\"4068\" /MP") diff --git a/third-party/libstudxml/CMakeLists.txt b/third-party/libstudxml/CMakeLists.txt index fea24c28..65d7da19 100644 --- a/third-party/libstudxml/CMakeLists.txt +++ b/third-party/libstudxml/CMakeLists.txt @@ -51,11 +51,9 @@ add_library(libstudxml STATIC ${LIBSTUDXML} ${GENX} ${EXPAT}) target_compile_definitions(libstudxml PUBLIC LIBSTUDXML_STATIC_LIB=1) target_include_directories(libstudxml PUBLIC ${LIBSTUDXML_ROOT_DIR}) -if(NOT LOCAL_EXPAT AND NOT LOCAL_DEPENDENCIES) - find_package(EXPAT REQUIRED) - target_compile_definitions(libstudxml PRIVATE LIBSTUDXML_EXTERNAL_EXPAT=1) - target_link_libraries(libstudxml PRIVATE expat) -endif() +find_package(EXPAT REQUIRED) +target_compile_definitions(libstudxml PRIVATE LIBSTUDXML_EXTERNAL_EXPAT=1) +target_link_libraries(libstudxml PRIVATE expat) if(NOT STATIC) set_target_properties(libstudxml PROPERTIES POSITION_INDEPENDENT_CODE 1)