File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -16,9 +16,26 @@ file( GLOB BOOST_REGEX_SRC ./src/*.cpp )
1616add_library ( boost_regex ${BOOST_REGEX_SRC} )
1717add_library ( Boost::regex ALIAS boost_regex )
1818
19- target_include_directories ( boost_regex PUBLIC include )
20- target_compile_definitions ( boost_regex PUBLIC BOOST_REGEX_NO_LIB)
19+ # Currently, installation isn't supported directly,
20+ # but someone else might install this target from the parent
21+ # CMake script, so lets proactively differentiate between
22+ # the include directory during regular use (BUILD_INTERFACE)
23+ # and after installation
24+ target_include_directories ( boost_regex
25+ PUBLIC
26+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /include >
27+ $<INSTALL_INTERFACE:include >
28+ )
29+
30+ target_compile_definitions ( boost_regex
31+ PUBLIC
32+ # No need for autolink and we don't mangle library name anyway
33+ BOOST_REGEX_NO_LIB
34+ $<$<STREQUAL :$<TARGET_PROPERTY:boost_regex,TYPE >,SHARED_LIBRARY>:BOOST_REGEX_DYN_LINK=1>
35+ $<$<STREQUAL :$<TARGET_PROPERTY:boost_regex,TYPE >,STATIC_LIBRARY>:BOOST_REGEX_STATIC_LINK=1>
36+ )
2137
38+ # Specify dependencies (including header-only libraries)
2239target_link_libraries ( boost_regex
2340 PUBLIC
2441 Boost::assert
You can’t perform that action at this time.
0 commit comments