cmake: Add --libs output for pkg-config.
[socket_wrapper.git] / src / CMakeLists.txt
1 project(libsocket_wrapper C)
2
3 include_directories(${CMAKE_BINARY_DIR})
4 add_library(socket_wrapper SHARED socket_wrapper.c)
5
6 target_link_libraries(socket_wrapper ${SWRAP_REQUIRED_LIBRARIES})
7
8 install(
9   TARGETS
10     socket_wrapper
11   RUNTIME DESTINATION ${BIN_INSTALL_DIR}
12   LIBRARY DESTINATION ${LIB_INSTALL_DIR}
13   ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
14 )
15
16 set_target_properties(
17   socket_wrapper
18     PROPERTIES
19       VERSION
20         ${LIBRARY_VERSION}
21       SOVERSION
22         ${LIBRARY_SOVERSION}
23 )
24
25 # This needs to be at the end
26 get_target_property(SWRAP_LOCATION socket_wrapper LOCATION)
27 set(SOCKET_WRAPPER_LOCATION ${SWRAP_LOCATION} PARENT_SCOPE)