File: CMakeLists.txt

package info (click to toggle)
librabbitmq 0.9.0-0.2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 1,128 kB
  • sloc: ansic: 11,667; xml: 747; python: 597; sh: 60; makefile: 9
file content (86 lines) | stat: -rw-r--r-- 2,443 bytes parent folder | download
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${LIBRABBITMQ_INCLUDE_DIRS} ${POPT_INCLUDE_DIR})

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 ${RMQ_LIBRARY_TARGET} ${POPT_LIBRARY})

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

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

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

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

if (BUILD_TOOLS_DOCS)
  if (XMLTO_FOUND)
    set(DOCS_SRCS
      doc/amqp-consume.xml
      doc/amqp-declare-queue.xml
      doc/amqp-delete-queue.xml
      doc/amqp-get.xml
      doc/amqp-publish.xml
      doc/librabbitmq-tools.xml
      )

    file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc)
    set(XMLTO_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/doc/man-date.ent)
    add_custom_command(
            OUTPUT ${XMLTO_DEPENDS}
	          COMMAND date +'%Y-%m-%d' > ${XMLTO_DEPENDS}
            VERBATIM
            )

    set(XMLTO_COMMAND_ARGS --skip-validation --searchpath "${CMAKE_CURRENT_BINARY_DIR}/doc")

    XMLTO(${DOCS_SRCS}
      MODES man
      ALL)

    foreach(file ${XMLTO_FILES_man})
      get_filename_component(fileExt ${file} EXT)
      string( REGEX REPLACE "^[.]" "" fileExt ${fileExt} )
      install(
        FILES ${file}
        DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man${fileExt}
        )
    endforeach()

  else(XMLTO_FOUND)
    message(WARNING "xmlto not found, will not build tools documentation")
  endif(XMLTO_FOUND)
endif()

if (ENABLE_SSL_SUPPORT)
  add_definitions(-DWITH_SSL=1)
endif()

if (ENABLE_SSL_SUPPORT)
  add_definitions(-DWITH_SSL=1)
endif()

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)