cmake: add static lib
@@ -330,21 +330,24 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
)
endif()
+add_library(re OBJECT ${SRCS})
-# todo: add SHARED and STATIC
-add_library(re SHARED ${SRCS})
+add_library(re-shared SHARED $<TARGET_OBJECTS:re>)
+add_library(re-static STATIC $<TARGET_OBJECTS:re>)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
target_link_libraries(re "-framework SystemConfiguration" "-framework CoreFoundation" )
endif()
-
target_link_libraries(re -L/opt/local/lib -lssl -lcrypto -lpthread)
set_target_properties(re PROPERTIES VERSION ${PROJECT_VERSION})
set_target_properties(re PROPERTIES SOVERSION ${PROJECT_VERSION_MAJOR})
-
+set_target_properties(re PROPERTIES POSITION_INDEPENDENT_CODE 1)
set_target_properties(re PROPERTIES PUBLIC_HEADER include/re.h)
+set_target_properties(re-shared PROPERTIES OUTPUT_NAME "re")
+set_target_properties(re-static PROPERTIES OUTPUT_NAME "re")
+
target_include_directories(re PRIVATE .)
target_include_directories(re PRIVATE include)
