File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ include(GNUInstallDirs)
8
8
#============================================================================
9
9
option (WITH_TESTS "Build tests." OFF )
10
10
option (WITH_EXAMPLE "Build example." OFF )
11
+ option (USE_BOOST_REGEX "Replace std::regex with Boost.Regex" OFF )
11
12
12
13
#============================================================================
13
14
# Internal compiler options
@@ -52,6 +53,19 @@ if(NOT MSVC)
52
53
set_target_properties (docopt_s PROPERTIES OUTPUT_NAME docopt )
53
54
endif ()
54
55
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
+
55
69
#============================================================================
56
70
# Examples
57
71
#============================================================================
You can’t perform that action at this time.
0 commit comments