set(TARGET_NAMELINK_COMPONENT NAMELINK_COMPONENT dev DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
+option(BUILD_SHARED_LIBS "whether to build shared libraries"
+ ON)
option(BUILD_TESTING "whether to enable build of the test suite"
$ENV{BUILD_TESTING})
option(BUILD_DOCSONLY "build *only* documentation"
strerror.cc
string.cc
)
-add_library(libhashkit SHARED)
+add_library(libhashkit)
add_library(hashkit ALIAS libhashkit)
set_target_properties(libhashkit PROPERTIES
CXX_STANDARD ${CXX_STANDARD}
)
endif()
-add_library(libmemcached SHARED)
+add_library(libmemcached)
add_library(memcached ALIAS libmemcached)
set_target_properties(libmemcached PROPERTIES
CXX_STANDARD ${CXX_STANDARD}
pedantic.c
../libmemcached/byteorder.cc
)
-add_library(libmemcachedprotocol SHARED)
+add_library(libmemcachedprotocol)
add_library(memcachedprotocol ALIAS libmemcachedprotocol)
set_target_properties(libmemcachedprotocol PROPERTIES
CXX_STANDARD ${CXX_STANDARD}
ping.cc
version.cc
)
-add_library(libmemcachedutil SHARED)
+add_library(libmemcachedutil)
add_library(memcachedutil ALIAS libmemcachedutil)
if(CMAKE_USE_PTHREADS_INIT)
target_sources(libmemcachedutil PRIVATE pool.cc)
${CMAKE_BINARY_DIR}/include
)
+install(TARGETS p9y EXPORT p9y-targets
+ RUNTIME COMPONENT bin DESTINATION ${CMAKE_INSTALL_BINDIR}
+ ARCHIVE COMPONENT lib DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY COMPONENT lib DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ${TARGET_NAMELINK_COMPONENT}
+ )
+export(EXPORT p9y-targets NAMESPACE libmemcached::)
+install(EXPORT p9y-targets NAMESPACE libmemcached::
+ COMPONENT dev
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
+
if(NOT HAVE_GETOPT_H)
target_sources(p9y PRIVATE getopt.c)
endif()