ADD_DEFINITIONS(-Wall -Werror -Wextra -Wno-unused-parameter)
STRING(REPLACE "-DNDEBUG" "" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
-ADD_LIBRARY(nl-tiny SHARED
+SET(SOURCES
attr.c
cache.c
cache_mngt.c
socket.c
unl.c
)
+ADD_LIBRARY(nl-tiny SHARED ${SOURCES})
+ADD_LIBRARY(nl-tiny-static STATIC ${SOURCES})
+SET_TARGET_PROPERTIES(nl-tiny-static PROPERTIES OUTPUT_NAME nl-tiny)
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/libnl-tiny.pc.in"
@ONLY
)
-INSTALL(TARGETS nl-tiny LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+INSTALL(TARGETS nl-tiny nl-tiny-static LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
INSTALL(FILES ${CMAKE_BINARY_DIR}/libnl-tiny.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
INSTALL(
DIRECTORY ${CMAKE_SOURCE_DIR}/include/