"Fossies" - the Fresh Open Source Software Archive

Member "dbus-1.13.18/dbus/CMakeLists.txt" (1 Jul 2020, 8660 Bytes) of package /linux/misc/dbus-1.13.18.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "CMakeLists.txt": 1.13.16_vs_1.13.18.

    1 configure_file(dbus-arch-deps.h.in ${CMAKE_CURRENT_BINARY_DIR}/dbus-arch-deps.h )
    2 
    3 add_definitions(-DDBUS_COMPILATION)
    4 
    5 set(dbusinclude_HEADERS
    6     dbus.h
    7     dbus-address.h
    8     dbus-bus.h
    9     dbus-connection.h
   10     dbus-errors.h
   11     dbus-macros.h
   12     dbus-memory.h
   13     dbus-message.h
   14     dbus-misc.h
   15     dbus-pending-call.h
   16     dbus-protocol.h
   17     dbus-server.h
   18     dbus-shared.h
   19     dbus-signature.h
   20     dbus-syntax.h
   21     dbus-threads.h
   22     dbus-types.h
   23 )
   24 set(dbusinclude_ARCH_HEADERS
   25     ${CMAKE_CURRENT_BINARY_DIR}/dbus-arch-deps.h
   26 )
   27 
   28 ### source code that goes in the installed client library
   29 ### and is specific to library functionality
   30 set(DBUS_LIB_SOURCES
   31     dbus-address.c
   32     dbus-auth.c
   33     dbus-bus.c
   34     dbus-connection.c
   35     dbus-credentials.c
   36     dbus-errors.c
   37     dbus-keyring.c
   38     dbus-marshal-header.c
   39     dbus-marshal-byteswap.c
   40     dbus-marshal-recursive.c
   41     dbus-marshal-validate.c
   42     dbus-message.c
   43     dbus-misc.c
   44     dbus-nonce.c
   45     dbus-object-tree.c
   46     dbus-pending-call.c
   47     dbus-resources.c
   48     dbus-server.c
   49     dbus-server-socket.c
   50     dbus-server-debug-pipe.c
   51     dbus-sha.c
   52     dbus-signature.c
   53     dbus-syntax.c
   54     dbus-timeout.c
   55     dbus-threads.c
   56     dbus-transport.c
   57     dbus-transport-socket.c
   58     dbus-watch.c
   59 )
   60 
   61 
   62 if(UNIX)
   63     set(DBUS_LIB_SOURCES ${DBUS_LIB_SOURCES}
   64         dbus-uuidgen.c
   65         dbus-transport-unix.c
   66         dbus-server-unix.c
   67     )
   68 else(UNIX)
   69     set(DBUS_LIB_SOURCES ${DBUS_LIB_SOURCES}
   70         dbus-transport-win.c
   71         dbus-server-win.c
   72     )
   73 endif()
   74 
   75 set(DBUS_LIB_HEADERS
   76     dbus-auth.h
   77     dbus-connection-internal.h
   78     dbus-credentials.h
   79     dbus-keyring.h
   80     dbus-marshal-header.h
   81     dbus-marshal-byteswap.h
   82     dbus-marshal-recursive.h
   83     dbus-marshal-validate.h
   84     dbus-message-internal.h
   85     dbus-message-private.h
   86     dbus-misc.h
   87     dbus-object-tree.h
   88     dbus-protocol.h
   89     dbus-resources.h
   90     dbus-server-debug-pipe.h
   91     dbus-server-protected.h
   92     dbus-server-unix.h
   93     dbus-sha.h
   94     dbus-timeout.h
   95     dbus-threads.h
   96     dbus-threads-internal.h
   97     dbus-transport.h
   98     dbus-transport-protected.h
   99     dbus-uuidgen.h
  100     dbus-watch.h
  101     ${CMAKE_BINARY_DIR}/config.h
  102 )
  103 if(UNIX)
  104     set(DBUS_LIB_HEADERS ${DBUS_LIB_HEADERS}
  105         dbus-transport-unix.h
  106     )
  107 else(UNIX)
  108     set(DBUS_LIB_HEADERS ${DBUS_LIB_HEADERS}
  109         dbus-transport-win.h
  110     )
  111 endif()
  112 
  113 
  114 ### source code that goes in the installed client library
  115 ### AND is generic utility functionality used by the 
  116 ### daemon or test programs (all symbols in here should 
  117 ### be underscore-prefixed)
  118 set(DBUS_SHARED_SOURCES
  119     dbus-dataslot.c
  120     dbus-file.c
  121     dbus-hash.c
  122     dbus-internals.c
  123     dbus-list.c
  124     dbus-marshal-basic.c
  125     dbus-memory.c
  126     dbus-mempool.c
  127     dbus-string.c
  128     dbus-sysdeps.c
  129     dbus-pipe.c
  130 )
  131 
  132 set(DBUS_SHARED_HEADERS
  133     dbus-dataslot.h
  134     dbus-file.h
  135     dbus-hash.h
  136     dbus-internals.h
  137     dbus-list.h
  138     dbus-marshal-basic.h
  139     dbus-mempool.h
  140     dbus-string.h
  141     dbus-string-private.h
  142     dbus-pipe.h
  143     dbus-sysdeps.h
  144 )
  145 
  146 if(DBUS_ENABLE_EMBEDDED_TESTS)
  147     set(DBUS_SHARED_SOURCES ${DBUS_SHARED_SOURCES} dbus-test-tap.c)
  148     set(DBUS_SHARED_HEADERS ${DBUS_SHARED_HEADERS} dbus-test-tap.h)
  149     # ... else they are in the test library instead
  150 endif()
  151 
  152 ### source code that is generic utility functionality used
  153 ### by the bus daemon or test apps, but is NOT included
  154 ### in the D-BUS client library (all symbols in here 
  155 ### should be underscore-prefixed but don't really need 
  156 ### to be unless they move to DBUS_SHARED_SOURCES later)
  157 set(DBUS_UTIL_SOURCES
  158     dbus-asv-util.c
  159     dbus-mainloop.c
  160     dbus-message-util.c
  161     dbus-shell.c
  162     dbus-pollable-set.c
  163     dbus-pollable-set-poll.c
  164     dbus-string-util.c
  165     dbus-sysdeps-util.c
  166 )
  167 
  168 set(DBUS_UTIL_HEADERS
  169     dbus-asv-util.h
  170     dbus-mainloop.h
  171     dbus-shell.h
  172     dbus-pollable-set.h
  173     dbus-spawn.h
  174     dbus-test.h
  175 )
  176 
  177 ### platform specific settings
  178 if(WIN32)
  179     set(DBUS_SHARED_SOURCES ${DBUS_SHARED_SOURCES}
  180         dbus-file-win.c
  181         dbus-init-win.cpp
  182         dbus-sysdeps-win.c
  183         dbus-pipe-win.c
  184         dbus-sysdeps-thread-win.c
  185     )
  186     set(DBUS_SHARED_HEADERS ${DBUS_SHARED_HEADERS}
  187         dbus-sockets-win.h
  188         dbus-sysdeps-win.h
  189     )
  190     set(DBUS_UTIL_SOURCES ${DBUS_UTIL_SOURCES}
  191         dbus-spawn-win.c
  192         dbus-sysdeps-util-win.c
  193     )
  194     if(WINCE)
  195     set(DBUS_SHARED_SOURCES ${DBUS_SHARED_SOURCES}
  196         dbus-sysdeps-wince-glue.c
  197     )
  198     set(DBUS_SHARED_HEADERS ${DBUS_SHARED_HEADERS}
  199         dbus-sysdeps-wince-glue.h
  200     )
  201     endif()
  202 else(WIN32)
  203     set(DBUS_SHARED_SOURCES ${DBUS_SHARED_SOURCES}
  204         dbus-file-unix.c
  205         dbus-pipe-unix.c
  206         dbus-sysdeps-unix.c
  207         dbus-sysdeps-pthread.c
  208         dbus-userdb.c
  209     )
  210     set(DBUS_SHARED_HEADERS ${DBUS_SHARED_HEADERS}
  211         dbus-server-unix.h
  212         dbus-transport-unix.h
  213         dbus-sysdeps-unix.h
  214         dbus-userdb.h
  215     )
  216     set(DBUS_UTIL_SOURCES ${DBUS_UTIL_SOURCES}
  217         dbus-spawn-unix.c
  218         dbus-userdb-util.c
  219         dbus-sysdeps-util-unix.c
  220     )
  221 endif()
  222 
  223 if(DBUS_HAVE_LINUX_EPOLL)
  224     set(DBUS_UTIL_SOURCES
  225         ${DBUS_UTIL_SOURCES}
  226         dbus-pollable-set-epoll.c
  227     )
  228 endif()
  229 
  230 set(libdbus_SOURCES
  231     ${DBUS_LIB_SOURCES}
  232     ${DBUS_SHARED_SOURCES}
  233 )
  234 
  235 set(libdbus_HEADERS
  236     ${DBUS_LIB_HEADERS}
  237     ${DBUS_SHARED_HEADERS}
  238 )
  239 
  240 if(DEFINED DBUS_LIBRARY_REVISION)
  241     math(EXPR DBUS_LIBRARY_MAJOR "${DBUS_LIBRARY_CURRENT} - ${DBUS_LIBRARY_AGE}")
  242 endif()
  243 
  244 if(WIN32)
  245     add_library_version_info(libdbus_SOURCES "${CMAKE_SHARED_LIBRARY_PREFIX}dbus-1-${DBUS_LIBRARY_MAJOR}")
  246 endif()
  247 
  248 if(MSVC_IDE)
  249     project_source_group(${GROUP_CODE} DBUS_LIB_SOURCES DBUS_LIB_HEADERS)
  250     project_source_group(${GROUP_CODE} DBUS_SHARED_SOURCES DBUS_SHARED_HEADERS)
  251     project_source_group(${GROUP_CODE} DBUS_UTIL_SOURCES DBUS_UTIL_SOURCES)
  252 endif()
  253 
  254 # for clock_getres() on e.g. GNU/Linux (but not Android)
  255 find_library(LIBRT rt)
  256 
  257 # for socket() on QNX
  258 find_library(LIBSOCKET socket)
  259 
  260 ### Client library
  261 add_library(dbus-1 SHARED
  262     ${libdbus_SOURCES}
  263     ${libdbus_HEADERS}
  264 )
  265 
  266 if(WIN32)
  267     if(DEFINED DBUS_LIBRARY_REVISION)
  268         set_target_properties(dbus-1 PROPERTIES SUFFIX "-${DBUS_LIBRARY_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}")
  269         add_custom_command(TARGET dbus-1 POST_BUILD
  270             COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:dbus-1>" "$<TARGET_FILE_DIR:dbus-1>/${CMAKE_SHARED_LIBRARY_PREFIX}dbus-1${CMAKE_SHARED_LIBRARY_SUFFIX}"
  271             COMMENT "Create non versioned dbus-1 library for legacy applications"
  272         )
  273         install(FILES ${LEGACY_FILE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
  274     endif()
  275     if(WINCE)
  276         target_link_libraries(dbus-1 ws2)
  277     else(WINCE)
  278         target_link_libraries(dbus-1 ws2_32 advapi32 netapi32 iphlpapi dbghelp)
  279     endif()
  280 else(WIN32)
  281     if(DEFINED DBUS_LIBRARY_REVISION)
  282         set_target_properties(dbus-1 PROPERTIES VERSION ${DBUS_LIBRARY_MAJOR}.${DBUS_LIBRARY_AGE}.${DBUS_LIBRARY_REVISION} SOVERSION ${DBUS_LIBRARY_MAJOR})
  283     endif()
  284     target_link_libraries(dbus-1 ${CMAKE_THREAD_LIBS_INIT} ${SYSTEMD_LIBRARIES})
  285     if(LIBRT)
  286         target_link_libraries(dbus-1 ${LIBRT})
  287     endif()
  288     if(LIBSOCKET)
  289         target_link_libraries(dbus-1 ${LIBSOCKET})
  290     endif()
  291 endif()
  292 
  293 # Assume that Linux has -Wl,--version-script and other platforms do not
  294 if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
  295     set(SOVERSION ${DBUS_LIBRARY_MAJOR})
  296     configure_file(Version.in ${CMAKE_CURRENT_BINARY_DIR}/Version)
  297     set_target_properties(dbus-1 PROPERTIES LINK_FLAGS -Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/Version)
  298 endif()
  299 
  300 install(TARGETS dbus-1 ${INSTALL_TARGETS_DEFAULT_ARGS})
  301 install(FILES ${dbusinclude_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dbus-1.0/dbus)
  302 install(FILES ${dbusinclude_ARCH_HEADERS} DESTINATION ${CMAKE_INSTALL_LIBDIR}/dbus-1.0/include/dbus)
  303 
  304 ### Internal library, used for the daemon, tools and tests, compiled statically.
  305 
  306 add_library(dbus-internal ${DBUS_INTERNAL_ADD_LIBRARY_OPTIONS}
  307     ${DBUS_UTIL_SOURCES}
  308     ${DBUS_UTIL_HEADERS}
  309 )
  310 target_link_libraries(dbus-internal dbus-1)
  311 if(WIN32)
  312     if(WINCE)
  313         target_link_libraries(dbus-internal ws2)
  314     else(WINCE)
  315         target_link_libraries(dbus-internal ws2_32 advapi32 netapi32 iphlpapi)
  316     endif()
  317 else(WIN32)
  318     target_link_libraries(dbus-internal ${CMAKE_THREAD_LIBS_INIT})
  319     if(LIBRT)
  320         target_link_libraries(dbus-internal ${LIBRT})
  321     endif()
  322     if(LIBSOCKET)
  323         target_link_libraries(dbus-internal ${LIBSOCKET})
  324     endif()
  325 endif()
  326 
  327 if(UNIX)
  328 # set version info
  329 endif()
  330 
  331 
  332 ## mop up the gcov files
  333 #clean-local:
  334 #/bin/rm *.bb *.bbg *.da *.gcov .libs/*.da .libs/*.bbg || true