Default to static tidy-html5, but let the user configure this.

This commit is contained in:
King_DuckZ 2015-09-28 23:44:11 +02:00
parent 49aa62815a
commit c69252604c

View file

@ -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)