testing
[awesomized/libmemcached] / src / bin / CMakeLists.txt
1 add_subdirectory(common)
2
3 foreach(CLIENT IN LISTS CLIENTS)
4 add_executable(${CLIENT} ${CLIENT}.cc)
5 target_include_directories(${CLIENT} PRIVATE ..)
6 target_link_libraries(${CLIENT} PRIVATE libclient_common)
7 if(CMAKE_INSTALL_RPATH)
8 set_target_properties(${CLIENT} PROPERTIES
9 INSTALL_RPATH ${CMAKE_INSTALL_RPATH}/../${CMAKE_INSTALL_LIBDIR})
10 endif()
11 install(TARGETS ${CLIENT}
12 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
13 endforeach()
14
15 # extra sources
16
17 target_sources(memcapable PRIVATE ../libmemcached/byteorder.cc)
18
19 # extra libs
20
21 target_link_libraries(memcapable PRIVATE Threads::Threads)
22 target_link_libraries(memping PRIVATE libmemcachedutil)
23 target_link_libraries(memslap PRIVATE Threads::Threads)
24
25 # memaslap is special
26
27 if(HAVE_MEMASLAP)
28 add_executable(memaslap memaslap.c
29 memaslap/ms_conn.c
30 memaslap/ms_setting.c
31 memaslap/ms_sigsegv.c
32 memaslap/ms_stats.c
33 memaslap/ms_task.c
34 memaslap/ms_thread.c)
35 target_include_directories(memaslap PRIVATE memaslap ${LIBEVENT_INCLUDEDIR})
36 target_link_libraries(memaslap PRIVATE libclient_common ${LIBEVENT_LIBRARIES} Threads::Threads)
37 if(CMAKE_INSTALL_RPATH)
38 set_target_properties(${CLIENT} PROPERTIES
39 INSTALL_RPATH ${CMAKE_INSTALL_RPATH}/../${CMAKE_INSTALL_LIBDIR})
40 endif()
41 install(TARGETS memaslap
42 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
43 endif()