summaryrefslogtreecommitdiff
path: root/tools/CMakeLists.txt
blob: 52397ae3af085e25b30187955b1bfd2f465e1402 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${librabbitmq_SOURCE_DIR} ${librabbitmq_BINARY_DIR} ${POPT_INCLUDE_DIRS})

if (WIN32)
    set(PLATFORM_DIR win32)
    set(PLATFORM_SRCS
        win32/compat.c
        )
else (WIN32)
    set(PLATFORM_DIR unix)
endif (WIN32)

include_directories(${PLATFORM_DIR})

set(COMMON_SRCS
    common.h
    common.c
    ${PLATFORM_SRCS}
    )

add_executable(amqp-publish publish.c ${COMMON_SRCS})
target_link_libraries(amqp-publish rabbitmq ${POPT_LIBRARY})

add_executable(amqp-get get.c ${COMMON_SRCS})
target_link_libraries(amqp-get rabbitmq ${POPT_LIBRARY})

add_executable(amqp-consume consume.c ${PLATFORM_DIR}/process.c ${COMMON_SRCS})
target_link_libraries(amqp-consume rabbitmq ${POPT_LIBRARY})

add_executable(amqp-declare-queue declare_queue.c ${COMMON_SRCS})
target_link_libraries(amqp-declare-queue rabbitmq ${POPT_LIBRARY})

add_executable(amqp-delete-queue delete_queue.c ${COMMON_SRCS})
target_link_libraries(amqp-delete-queue rabbitmq ${POPT_LIBRARY})

install(TARGETS amqp-publish amqp-get amqp-consume amqp-declare-queue amqp-delete-queue
	RUNTIME DESTINATION bin
	LIBRARY DESTINATION lib
	ARCHIVE DESTINATION lib
	PUBLIC_HEADER DESTINATION include)