From c69252604cbe988f424a18fee6596c55b9ec11aa Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Mon, 28 Sep 2015 23:44:11 +0200 Subject: [PATCH] Default to static tidy-html5, but let the user configure this. --- CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f36ecf..a23308e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.0 FATAL_ERROR) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") project(duckscraper VERSION 0.2 LANGUAGES CXX) +option(BUILD_SHARED_TIDY "Wheter you want to build tidy-html5 as a shared library" OFF) + include(GetGitRevisionDescription) find_package(PugiXML REQUIRED) find_package(Boost 1.32.0 COMPONENTS program_options) @@ -34,8 +36,14 @@ add_executable(${PROJECT_NAME} src/htmlretrieve.cpp ) +if (BUILD_SHARED_TIDY) + set(TIDY_LIB "tidy-share") +else(BUILD_SHARED_TIDY) + set(TIDY_LIB "tidy-static") +endif(BUILD_SHARED_TIDY) + target_link_libraries(${PROJECT_NAME} - tidy-share + ${TIDY_LIB} ${PUGIXML_LIBRARIES} curlcpp ${Boost_LIBRARIES} @@ -47,6 +55,6 @@ target_link_libraries(${PROJECT_NAME} unset(PROJECT_VERSION_MAJOR) unset(PROJECT_VERSION_MINOR) unset(PROJECT_VERSION) -set(BUILD_SHARED_LIB ON) #for tidy +set(BUILD_SHARED_LIB ${BUILD_SHARED_TIDY}) #for tidy add_subdirectory(lib/tidy) add_subdirectory(lib/curlcpp)