File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ include(GNUInstallDirs)
88#============================================================================
99option (WITH_TESTS "Build tests." OFF )
1010option (WITH_EXAMPLE "Build example." OFF )
11+ option (USE_BOOST_REGEX "Replace std::regex with Boost.Regex" OFF )
1112
1213#============================================================================
1314# Internal compiler options
@@ -52,6 +53,19 @@ if(NOT MSVC)
5253 set_target_properties (docopt_s PROPERTIES OUTPUT_NAME docopt )
5354endif ()
5455
56+ if (USE_BOOST_REGEX)
57+ add_definitions ("-DDOCTOPT_USE_BOOST_REGEX" )
58+ # This is needed on Linux, where linking a static library into docopt.so
59+ # fails because boost static libs are not compiled with -fPIC
60+ set (Boost_USE_STATIC_LIBS OFF )
61+ find_package (Boost 1.53 REQUIRED COMPONENTS regex )
62+ include_directories (${Boost_INCLUDE_DIRS} )
63+ target_link_libraries (docopt ${Boost_LIBRARIES} )
64+ if (WITH_STATIC)
65+ target_link_libraries (docopt_s ${Boost_LIBRARIES} )
66+ endif ()
67+ endif ()
68+
5569#============================================================================
5670# Examples
5771#============================================================================
You can’t perform that action at this time.
0 commit comments