34 lines
826 B
CMake
34 lines
826 B
CMake
# Explicitly link to libc
|
|
set(EXTRA_LIBS ${EXTRA_LIBS} c)
|
|
|
|
# Targets
|
|
add_library(libowlps-client.so SHARED libowlps-client.c)
|
|
add_library(libowlps-client.a STATIC libowlps-client.c)
|
|
|
|
# Fix targets' names
|
|
set_target_properties(
|
|
libowlps-client.so libowlps-client.a
|
|
PROPERTIES
|
|
OUTPUT_NAME owlps-client
|
|
SOVERSION 1
|
|
VERSION 1.0
|
|
)
|
|
|
|
# Add compile flags
|
|
set_target_properties(libowlps-client.so
|
|
PROPERTIES COMPILE_FLAGS ${SHARED_FLAGS})
|
|
set_target_properties(libowlps-client.a
|
|
PROPERTIES COMPILE_FLAGS ${EXE_FLAGS})
|
|
|
|
# Link libraries
|
|
target_link_libraries(libowlps-client.so libowlps.so ${EXTRA_LIBS})
|
|
target_link_libraries(libowlps-client.a libowlps.a ${EXTRA_LIBS})
|
|
|
|
# Install targets
|
|
install(
|
|
TARGETS libowlps-client.so libowlps-client.a
|
|
DESTINATION lib)
|
|
install(
|
|
FILES owlps-client.h
|
|
DESTINATION include)
|