Added
Link Here
|
1 |
--- CMakeLists.txt.orig 2023-06-03 13:33:46 UTC |
2 |
+++ CMakeLists.txt |
3 |
@@ -135,12 +135,16 @@ set(RE2_HEADERS |
4 |
) |
5 |
|
6 |
add_library(re2 ${RE2_SOURCES}) |
7 |
+add_library(re2_static STATIC ${RE2_SOURCES}) |
8 |
target_compile_features(re2 PUBLIC cxx_std_14) |
9 |
target_include_directories(re2 PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>) |
10 |
+target_include_directories(re2 PRIVATE ${CMAKE_SOURCE_DIR}) |
11 |
+target_include_directories(re2_static PRIVATE ${CMAKE_SOURCE_DIR}) |
12 |
# CMake gives "set_target_properties called with incorrect number of arguments." |
13 |
# errors if we don't quote ${RE2_HEADERS}, so quote it despite prevailing style. |
14 |
set_target_properties(re2 PROPERTIES PUBLIC_HEADER "${RE2_HEADERS}") |
15 |
set_target_properties(re2 PROPERTIES SOVERSION ${SONAME} VERSION ${SONAME}.0.0) |
16 |
+set_target_properties(re2_static PROPERTIES OUTPUT_NAME "re2") |
17 |
add_library(re2::re2 ALIAS re2) |
18 |
|
19 |
if(APPLE AND RE2_BUILD_FRAMEWORK) |
20 |
@@ -245,6 +249,8 @@ install(TARGETS re2 |
21 |
FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR} |
22 |
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/re2 |
23 |
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) |
24 |
+install(TARGETS re2_static |
25 |
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
26 |
install(EXPORT re2Targets |
27 |
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/re2 |
28 |
NAMESPACE re2::) |
29 |
@ |