Default to static tidy-html5, but let the user configure this.
This commit is contained in:
parent
49aa62815a
commit
c69252604c
1 changed files with 10 additions and 2 deletions
|
@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
|
||||||
project(duckscraper VERSION 0.2 LANGUAGES CXX)
|
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)
|
include(GetGitRevisionDescription)
|
||||||
find_package(PugiXML REQUIRED)
|
find_package(PugiXML REQUIRED)
|
||||||
find_package(Boost 1.32.0 COMPONENTS program_options)
|
find_package(Boost 1.32.0 COMPONENTS program_options)
|
||||||
|
@ -34,8 +36,14 @@ add_executable(${PROJECT_NAME}
|
||||||
src/htmlretrieve.cpp
|
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}
|
target_link_libraries(${PROJECT_NAME}
|
||||||
tidy-share
|
${TIDY_LIB}
|
||||||
${PUGIXML_LIBRARIES}
|
${PUGIXML_LIBRARIES}
|
||||||
curlcpp
|
curlcpp
|
||||||
${Boost_LIBRARIES}
|
${Boost_LIBRARIES}
|
||||||
|
@ -47,6 +55,6 @@ target_link_libraries(${PROJECT_NAME}
|
||||||
unset(PROJECT_VERSION_MAJOR)
|
unset(PROJECT_VERSION_MAJOR)
|
||||||
unset(PROJECT_VERSION_MINOR)
|
unset(PROJECT_VERSION_MINOR)
|
||||||
unset(PROJECT_VERSION)
|
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/tidy)
|
||||||
add_subdirectory(lib/curlcpp)
|
add_subdirectory(lib/curlcpp)
|
||||||
|
|
Loading…
Reference in a new issue