Guest User

src-CMakeList

a guest
Jun 23rd, 2011
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 50.28 KB | None | 0 0
  1. #
  2. # Licensed to the Apache Software Foundation (ASF) under one
  3. # or more contributor license agreements. See the NOTICE file
  4. # distributed with this work for additional information
  5. # regarding copyright ownership. The ASF licenses this file
  6. # to you under the Apache License, Version 2.0 (the
  7. # "License"); you may not use this file except in compliance
  8. # with the License. You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing,
  13. # software distributed under the License is distributed on an
  14. # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15. # KIND, either express or implied. See the License for the
  16. # specific language governing permissions and limitations
  17. # under the License.
  18. #
  19.  
  20. # Option to require building optional plugins
  21. foreach (r ${REQUIRE})
  22. set(${r}_force ON)
  23. message(STATUS "Forcing ${r} to ${${r}_force}")
  24. endforeach(r)
  25.  
  26. include(CheckFunctionExists)
  27. include(CheckIncludeFileCXX)
  28. include(CheckIncludeFiles)
  29. include(CheckIncludeFileCXX)
  30. include(CheckLibraryExists)
  31. include(CheckSymbolExists)
  32. include(FindBoost)
  33. include(FindDoxygen)
  34.  
  35. #set (CMAKE_VERBOSE_MAKEFILE ON) # for debugging
  36.  
  37. #
  38. # Set up installation of .pdb files if the compiler is Visual Studio
  39. #
  40. # Sample: install_pdb (qpidcommon ${QPID_COMPONENT_COMMON})
  41. #
  42. MACRO (install_pdb theLibrary theComponent)
  43. if (MSVC)
  44. get_target_property(library_dll ${theLibrary} LOCATION)
  45. string(REPLACE .dll .pdb library_pdb ${library_dll})
  46. string(REPLACE $(OutDir) \${CMAKE_INSTALL_CONFIG_NAME} library_pdb ${library_pdb})
  47. string(REPLACE .pdb d.pdb libraryd_pdb ${library_pdb})
  48. #message(STATUS "_pdb: ${library_pdb}, ${libraryd_pdb}")
  49. install (PROGRAMS
  50. ${library_pdb}
  51. DESTINATION ${QPID_INSTALL_LIBDIR}/ReleasePDB
  52. COMPONENT ${theComponent}
  53. OPTIONAL
  54. CONFIGURATIONS Release|MinSizeRel)
  55. install (PROGRAMS
  56. ${library_pdb}
  57. DESTINATION ${QPID_INSTALL_LIBDIR}/ReleasePDB
  58. COMPONENT ${theComponent}
  59. CONFIGURATIONS RelWithDebInfo)
  60. install (PROGRAMS
  61. ${libraryd_pdb}
  62. DESTINATION ${QPID_INSTALL_LIBDIR}/DebugPDB
  63. COMPONENT ${theComponent}
  64. CONFIGURATIONS Debug)
  65. endif (MSVC)
  66. ENDMACRO (install_pdb)
  67.  
  68. #
  69. # inherit_value - if the symbol is undefined then set it to the given value.
  70. # Set flag to indicate this symbol was defined here.
  71. #
  72. MACRO (inherit_value theSymbol theValue)
  73. if (NOT DEFINED ${theSymbol})
  74. set (${theSymbol} ${theValue})
  75. # message ("Set symbol '${theSymbol}' to value '${theValue}'")
  76. set (${theSymbol}_inherited = "true")
  77. endif (NOT DEFINED ${theSymbol})
  78. ENDMACRO (inherit_value)
  79.  
  80. #
  81. # If compiler is Visual Studio then create a "version resource" for the project.
  82. # Use this call to override CPACK and file global settings but not file per-project settings.
  83. # Two groups of four version numbers specify "file" and "product" versions separately.
  84. #
  85. # Sample: add_msvc_version_full (qmfengine library dll 1 0 0 1 1 0 0 1)
  86. #
  87. MACRO (add_msvc_version_full verProject verProjectType verProjectFileExt verFN1 verFN2 verFN3 verFN4 verPN1 verPN2 verPN3 verPN4)
  88. if (MSVC)
  89. # Create project-specific version strings
  90. inherit_value ("winver_${verProject}_FileVersionBinary" "${verFN1},${verFN2},${verFN3},${verFN4}")
  91. inherit_value ("winver_${verProject}_ProductVersionBinary" "${verPN1},${verPN2},${verPN3},${verPN4}")
  92. inherit_value ("winver_${verProject}_FileVersionString" "${verFN1}, ${verFN2}, ${verFN3}, ${verFN4}")
  93. inherit_value ("winver_${verProject}_ProductVersionString" "${verPN1}, ${verPN2}, ${verPN3}, ${verPN4}")
  94. inherit_value ("winver_${verProject}_FileDescription" "${winver_PACKAGE_NAME}-${verProject} ${verProjectType}")
  95. inherit_value ("winver_${verProject}_LegalCopyright" "${winver_LEGAL_COPYRIGHT}")
  96. inherit_value ("winver_${verProject}_InternalName" "${verProject}")
  97. inherit_value ("winver_${verProject}_OriginalFilename" "${verProject}.${verProjectFileExt}")
  98. inherit_value ("winver_${verProject}_ProductName" "${winver_DESCRIPTION_SUMMARY}")
  99.  
  100. # Create strings to be substituted into the template file
  101. set ("winverFileVersionBinary" "${winver_${verProject}_FileVersionBinary}")
  102. set ("winverProductVersionBinary" "${winver_${verProject}_ProductVersionBinary}")
  103. set ("winverFileVersionString" "${winver_${verProject}_FileVersionString}")
  104. set ("winverProductVersionString" "${winver_${verProject}_ProductVersionString}")
  105. set ("winverFileDescription" "${winver_${verProject}_FileDescription}")
  106. set ("winverLegalCopyright" "${winver_${verProject}_LegalCopyright}")
  107. set ("winverInternalName" "${winver_${verProject}_InternalName}")
  108. set ("winverOriginalFilename" "${winver_${verProject}_OriginalFilename}")
  109. set ("winverProductName" "${winver_${verProject}_ProductName}")
  110.  
  111. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/windows/resources/template-resource.rc
  112. ${CMAKE_CURRENT_BINARY_DIR}/windows/resources/${verProject}-resource.rc)
  113. set (${verProject}_SOURCES
  114. ${${verProject}_SOURCES}
  115. ${CMAKE_CURRENT_BINARY_DIR}/windows/resources/${verProject}-resource.rc
  116. )
  117. endif (MSVC)
  118. ENDMACRO (add_msvc_version_full)
  119.  
  120. #
  121. # If compiler is Visual Studio then create a "version resource" for the project.
  122. # Use this call to accept file override version settings or
  123. # inherited CPACK_PACKAGE_VERSION version settings.
  124. #
  125. # Sample: add_msvc_version (qpidcommon library dll)
  126. #
  127. MACRO (add_msvc_version verProject verProjectType verProjectFileExt)
  128. if (MSVC)
  129. add_msvc_version_full (${verProject}
  130. ${verProjectType}
  131. ${verProjectFileExt}
  132. ${winver_FILE_VERSION_N1}
  133. ${winver_FILE_VERSION_N2}
  134. ${winver_FILE_VERSION_N3}
  135. ${winver_FILE_VERSION_N4}
  136. ${winver_PRODUCT_VERSION_N1}
  137. ${winver_PRODUCT_VERSION_N2}
  138. ${winver_PRODUCT_VERSION_N3}
  139. ${winver_PRODUCT_VERSION_N4})
  140. endif (MSVC)
  141. ENDMACRO (add_msvc_version)
  142.  
  143.  
  144. #
  145. # Install optional windows version settings. Override variables are specified in a file.
  146. #
  147. include (./CMakeWinVersions.cmake OPTIONAL)
  148.  
  149. #
  150. # Inherit global windows version settings from CPACK settings.
  151. #
  152. inherit_value ("winver_PACKAGE_NAME" "${CPACK_PACKAGE_NAME}")
  153. inherit_value ("winver_DESCRIPTION_SUMMARY" "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
  154. inherit_value ("winver_FILE_VERSION_N1" "${CPACK_PACKAGE_VERSION_MAJOR}")
  155. inherit_value ("winver_FILE_VERSION_N2" "${CPACK_PACKAGE_VERSION_MINOR}")
  156. inherit_value ("winver_FILE_VERSION_N3" "${CPACK_PACKAGE_VERSION_PATCH}")
  157. inherit_value ("winver_FILE_VERSION_N4" "1")
  158. inherit_value ("winver_PRODUCT_VERSION_N1" "${winver_FILE_VERSION_N1}")
  159. inherit_value ("winver_PRODUCT_VERSION_N2" "${winver_FILE_VERSION_N2}")
  160. inherit_value ("winver_PRODUCT_VERSION_N3" "${winver_FILE_VERSION_N3}")
  161. inherit_value ("winver_PRODUCT_VERSION_N4" "${winver_FILE_VERSION_N4}")
  162. inherit_value ("winver_LEGAL_COPYRIGHT" "")
  163.  
  164.  
  165. # check if we generate source as part of the build
  166. # - rubygen generates the amqp spec and clustering
  167. # - managementgen generates the broker management code
  168. #
  169. # rubygen subdir is excluded from stable distributions
  170. # If the main AMQP spec is present, then check if ruby and python are
  171. # present, and if any sources have changed, forcing a re-gen of source code.
  172.  
  173. set(AMQP_SPEC_DIR ${qpid-cpp_SOURCE_DIR}/../specs)
  174. set(AMQP_SPEC ${AMQP_SPEC_DIR}/amqp.0-10-qpid-errata.xml)
  175. if (EXISTS ${AMQP_SPEC})
  176. include(FindRuby)
  177. include(FindPythonInterp)
  178. if (NOT RUBY_EXECUTABLE)
  179. message(FATAL_ERROR "Can't locate ruby, needed to generate source files.")
  180. endif (NOT RUBY_EXECUTABLE)
  181. if (NOT PYTHON_EXECUTABLE)
  182. message(FATAL_ERROR "Can't locate python, needed to generate source files.")
  183. endif (NOT PYTHON_EXECUTABLE)
  184.  
  185. set(specs ${AMQP_SPEC} ${qpid-cpp_SOURCE_DIR}/xml/cluster.xml)
  186. set(regen_amqp OFF)
  187. set(rgen_dir ${qpid-cpp_SOURCE_DIR}/rubygen)
  188. file(GLOB_RECURSE rgen_progs ${rgen_dir}/*.rb)
  189. # If any of the specs, or any of the sources used to generate code, change
  190. # then regenerate the sources.
  191. foreach (spec_file ${specs} ${rgen_progs})
  192. if (${spec_file} IS_NEWER_THAN ${CMAKE_CURRENT_BINARY_DIR}/rubygen.cmake)
  193. set(regen_amqp ON)
  194. endif (${spec_file} IS_NEWER_THAN ${CMAKE_CURRENT_BINARY_DIR}/rubygen.cmake)
  195. endforeach (spec_file ${specs})
  196. if (regen_amqp)
  197. message(STATUS "Regenerating AMQP protocol sources")
  198. execute_process(COMMAND ${RUBY_EXECUTABLE} -I ${rgen_dir} ${rgen_dir}/generate ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/../include ${specs} all rubygen.cmake
  199. WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
  200. else (regen_amqp)
  201. message(STATUS "No need to generate AMQP protocol sources")
  202. endif (regen_amqp)
  203.  
  204. set(mgmt_specs ${AMQP_SPEC_DIR}/management-schema.xml
  205. ${CMAKE_CURRENT_SOURCE_DIR}/qpid/acl/management-schema.xml
  206. ${CMAKE_CURRENT_SOURCE_DIR}/qpid/cluster/management-schema.xml)
  207. set(mgen_dir ${qpid-cpp_SOURCE_DIR}/managementgen)
  208. set(regen_mgmt OFF)
  209. foreach (spec_file ${mgmt_specs})
  210. if (${spec_file} IS_NEWER_THAN ${CMAKE_CURRENT_BINARY_DIR}/managementgen.cmake)
  211. message(STATUS "${spec_file} is newer")
  212. set(regen_mgmt ON)
  213. endif (${spec_file} IS_NEWER_THAN ${CMAKE_CURRENT_BINARY_DIR}/managementgen.cmake)
  214. endforeach (spec_file ${mgmt_specs})
  215. if (regen_mgmt)
  216. message(STATUS "Regenerating Qpid Management Framework sources")
  217. execute_process(COMMAND ${PYTHON_EXECUTABLE} ${mgen_dir}/qmf-gen -c managementgen.cmake -b -q -o ${CMAKE_CURRENT_BINARY_DIR}/qmf ${mgmt_specs}
  218. WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
  219. else (regen_mgmt)
  220. message(STATUS "No need to generate Qpid Management Framework sources")
  221. endif (regen_mgmt)
  222.  
  223. # Pull in the names of the generated files, i.e. ${rgen_framing_srcs}
  224. include (${CMAKE_CURRENT_BINARY_DIR}/rubygen.cmake)
  225. include (${CMAKE_CURRENT_BINARY_DIR}/managementgen.cmake)
  226.  
  227. else (EXISTS ${AMQP_SPEC})
  228. message(STATUS "No AMQP spec... presume generated sources are included")
  229. set(QPID_GENERATED_HEADERS_IN_SOURCE ON)
  230. include (rubygen.cmake)
  231. include (managementgen.cmake)
  232. endif (EXISTS ${AMQP_SPEC})
  233.  
  234. find_program(HELP2MAN help2man DOC "Location of the help2man program")
  235. option(GEN_MANPAGES "Use help2man to generate man pages" ON)
  236. if (GEN_MANPAGES AND NOT HELP2MAN)
  237. message(STATUS "Can't locate the help2man command; man pages will not be generated")
  238. set (GEN_MANPAGES OFF)
  239. endif (GEN_MANPAGES AND NOT HELP2MAN)
  240.  
  241. # FindDoxygen module tries to locate doxygen and Graphviz dot
  242. set (docs_default ON)
  243. if (NOT DOXYGEN_EXECUTABLE)
  244. set (docs_default OFF)
  245. endif (NOT DOXYGEN_EXECUTABLE)
  246. option(GEN_DOXYGEN "Use doxygen to generate user documentation" ${docs_default})
  247. if (GEN_DOXYGEN AND NOT DOXYGEN_EXECUTABLE)
  248. message(STATUS "Can't locate the doxygen command; user documentation will not be generated")
  249. set (GEN_DOXYGEN OFF)
  250. endif (GEN_DOXYGEN AND NOT DOXYGEN_EXECUTABLE)
  251.  
  252. find_program(VALGRIND valgrind DOC "Location of the valgrind program")
  253. option(ENABLE_VALGRIND "Use valgrind to detect run-time problems" ON)
  254. if (ENABLE_VALGRIND AND NOT VALGRIND)
  255. message(STATUS "Can't locate the valgrind command; no run-time error detection")
  256. endif (ENABLE_VALGRIND AND NOT VALGRIND)
  257.  
  258. if (CMAKE_COMPILER_IS_GNUCXX)
  259. set (COMPILER_FLAGS "")
  260. # Warnings: Enable as many as possible, keep the code clean. Please
  261. # do not disable warnings or remove -Werror without discussing on
  262. # qpid-dev list.
  263. #
  264. # The following warnings are deliberately omitted, they warn on valid code.
  265. # -Wunreachable-code -Wpadded -Winline
  266. # -Wshadow - warns about boost headers.
  267. set (WARNING_FLAGS
  268. "-Werror -pedantic -Wall -Wextra -Wno-shadow -Wpointer-arith -Wcast-qual -Wcast-align -Wno-long-long -Wvolatile-register-var -Winvalid-pch -Wno-system-headers -Woverloaded-virtual")
  269. endif (CMAKE_COMPILER_IS_GNUCXX)
  270.  
  271. if (CMAKE_CXX_COMPILER_ID STREQUAL SunPro)
  272. set (COMPILER_FLAGS "-library=stlport4 -mt")
  273. set (WARNING_FLAGS "+w2")
  274. endif (CMAKE_CXX_COMPILER_ID STREQUAL SunPro)
  275.  
  276. option(ENABLE_WARNINGS "Enable lots of compiler warnings (recommended)" ON)
  277. if (NOT ENABLE_WARNINGS)
  278. set (WARNING_FLAGS "")
  279. endif (NOT ENABLE_WARNINGS)
  280.  
  281. set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILER_FLAGS} ${WARNING_FLAGS}")
  282.  
  283. # Expand a bit from the basic Find_Boost; be specific about what's needed.
  284. # TODO: Not all these libs are needed everywhere:
  285. # Linux only uses filesystem program_options unit_test_framework
  286. # (which itself uses regex).
  287. # Boost.system is sometimes needed; it's handled separately, below.
  288. find_package(Boost 1.33 REQUIRED
  289. COMPONENTS filesystem program_options date_time thread
  290. regex unit_test_framework)
  291. if(NOT Boost_FOUND)
  292. message(FATAL_ERROR "Boost C++ libraries not found. Please install or try setting BOOST_ROOT")
  293. endif(NOT Boost_FOUND)
  294.  
  295. # Boost.system was introduced at Boost 1.35; it's needed secondarily by other
  296. # Boost libs Qpid needs, so be sure it's there.
  297. if (Boost_VERSION GREATER 103499)
  298. find_package(Boost COMPONENTS system)
  299.  
  300. # Allow for cmake pre 2.6 and boost post 1.35
  301. if (NOT Boost_SYSTEM_LIBRARY)
  302. set(Boost_SYSTEM_LIBRARY boost_system)
  303. endif (NOT Boost_SYSTEM_LIBRARY)
  304. endif (Boost_VERSION GREATER 103499)
  305.  
  306. # Versions of cmake pre 2.6 don't set the Boost_*_LIBRARY variables correctly
  307. # these values are correct for Linux
  308. if (NOT Boost_PROGRAM_OPTIONS_LIBRARY)
  309. set(Boost_PROGRAM_OPTIONS_LIBRARY boost_program_options)
  310. endif (NOT Boost_PROGRAM_OPTIONS_LIBRARY)
  311.  
  312. if (NOT Boost_FILESYSTEM_LIBRARY)
  313. set(Boost_FILESYSTEM_LIBRARY boost_filesystem)
  314. endif (NOT Boost_FILESYSTEM_LIBRARY)
  315.  
  316. if (NOT Boost_UNIT_TEST_FRAMEWORK_LIBRARY)
  317. set(Boost_UNIT_TEST_FRAMEWORK_LIBRARY boost_unit_test_framework)
  318. endif (NOT Boost_UNIT_TEST_FRAMEWORK_LIBRARY)
  319.  
  320. if (NOT Boost_REGEX_LIBRARY)
  321. set(Boost_REGEX_LIBRARY boost_regex)
  322. endif (NOT Boost_REGEX_LIBRARY)
  323.  
  324. # The Windows install also wants the Boost DLLs, libs and headers that the
  325. # release is built with. The DLLs enable everything to run, and the headers
  326. # and libs ensure that users building Qpid C++ client programs can compile
  327. # (the C++ API still exposes Boost headers, but hopefully this will be fixed
  328. # in the future).
  329. #
  330. # On Windows you can pick whether the static or dynamic versions of the libs
  331. # are used; allow this choice to the user. Since we also install the Boost
  332. # DLLs that are needed for the Windows package, none are needed for the
  333. # static link case; else drop them into the install. Do this all first, since
  334. # Boost on Windows can use automatic linking to pick up the correct
  335. # Boost libs based on compile-time touching of the headers. Since we don't
  336. # really need to add them to the link lines, set the names to blanks.
  337. if (MSVC)
  338. install (PROGRAMS
  339. ${Boost_DATE_TIME_LIBRARY_DEBUG} ${Boost_DATE_TIME_LIBRARY_RELEASE}
  340. ${Boost_FILESYSTEM_LIBRARY_DEBUG} ${Boost_FILESYSTEM_LIBRARY_RELEASE}
  341. ${Boost_PROGRAM_OPTIONS_LIBRARY_DEBUG} ${Boost_PROGRAM_OPTIONS_LIBRARY_RELEASE}
  342. ${Boost_REGEX_LIBRARY_DEBUG} ${Boost_REGEX_LIBRARY_RELEASE}
  343. ${Boost_THREAD_LIBRARY_DEBUG} ${Boost_THREAD_LIBRARY_RELEASE}
  344. DESTINATION ${QPID_INSTALL_LIBDIR}/boost
  345. COMPONENT ${QPID_COMPONENT_COMMON})
  346.  
  347. if (Boost_VERSION GREATER 103499)
  348. install (PROGRAMS
  349. ${Boost_SYSTEM_LIBRARY_DEBUG} ${Boost_SYSTEM_LIBRARY_RELEASE}
  350. DESTINATION ${QPID_INSTALL_LIBDIR}/boost
  351. COMPONENT ${QPID_COMPONENT_COMMON})
  352. endif (Boost_VERSION GREATER 103499)
  353.  
  354. option(QPID_LINK_BOOST_DYNAMIC "Link with dynamic Boost libs (OFF to link static)" ON)
  355. if (QPID_LINK_BOOST_DYNAMIC)
  356. add_definitions( /D BOOST_ALL_DYN_LINK)
  357. string (REPLACE .lib .dll
  358. _boost_date_time_debug ${Boost_DATE_TIME_LIBRARY_DEBUG})
  359. string (REPLACE .lib .dll
  360. _boost_date_time_release ${Boost_DATE_TIME_LIBRARY_RELEASE})
  361. string (REPLACE .lib .dll
  362. _boost_filesystem_debug ${Boost_FILESYSTEM_LIBRARY_DEBUG})
  363. string (REPLACE .lib .dll
  364. _boost_filesystem_release ${Boost_FILESYSTEM_LIBRARY_RELEASE})
  365. string (REPLACE .lib .dll
  366. _boost_program_options_debug ${Boost_PROGRAM_OPTIONS_LIBRARY_DEBUG})
  367. string (REPLACE .lib .dll
  368. _boost_program_options_release ${Boost_PROGRAM_OPTIONS_LIBRARY_RELEASE})
  369. string (REPLACE .lib .dll
  370. _boost_regex_debug ${Boost_REGEX_LIBRARY_DEBUG})
  371. string (REPLACE .lib .dll
  372. _boost_regex_release ${Boost_REGEX_LIBRARY_RELEASE})
  373. string (REPLACE .lib .dll
  374. _boost_thread_debug ${Boost_THREAD_LIBRARY_DEBUG})
  375. string (REPLACE .lib .dll
  376. _boost_thread_release ${Boost_THREAD_LIBRARY_RELEASE})
  377. # Boost 1.35 added the system library, which gets indirectly linked in
  378. # via other Boost libs. So, if building with Boost 1.35 or later, also
  379. # include system in the Windows install package.
  380. if (Boost_VERSION GREATER 103499)
  381. string (REPLACE boost_thread boost_system
  382. _boost_system_debug ${_boost_thread_debug})
  383. string (REPLACE boost_thread boost_system
  384. _boost_system_release ${_boost_thread_release})
  385. endif (Boost_VERSION GREATER 103499)
  386. install (PROGRAMS
  387. ${_boost_date_time_debug} ${_boost_date_time_release}
  388. ${_boost_filesystem_debug} ${_boost_filesystem_release}
  389. ${_boost_program_options_debug} ${_boost_program_options_release}
  390. ${_boost_regex_debug} ${_boost_regex_release}
  391. ${_boost_system_debug} ${_boost_system_release}
  392. ${_boost_thread_debug} ${_boost_thread_release}
  393. DESTINATION ${QPID_INSTALL_LIBDIR}/boost
  394. COMPONENT ${QPID_COMPONENT_COMMON})
  395. endif (QPID_LINK_BOOST_DYNAMIC)
  396.  
  397. # Need the boost headers regardless of which way the libs go. Try to
  398. # weed out what we don't need, else it's giant and unnecessary.
  399. install (DIRECTORY ${Boost_INCLUDE_DIR}/boost
  400. DESTINATION ${QPID_INSTALL_INCLUDEDIR}
  401. COMPONENT ${QPID_COMPONENT_CLIENT_INCLUDE}
  402. PATTERN "accumulators/*" EXCLUDE
  403. PATTERN "algorithm/*" EXCLUDE
  404. PATTERN "archive/*" EXCLUDE
  405. PATTERN "asio*" EXCLUDE
  406. PATTERN "bimap*" EXCLUDE
  407. PATTERN "circular_buffer*" EXCLUDE
  408. PATTERN "concept*" EXCLUDE
  409. PATTERN "dynamic_bitset*" EXCLUDE
  410. PATTERN "flyweight*" EXCLUDE
  411. PATTERN "fusion/*" EXCLUDE
  412. PATTERN "gil/*" EXCLUDE
  413. PATTERN "graph/*" EXCLUDE
  414. PATTERN "interprocess/*" EXCLUDE
  415. PATTERN "lambda/*" EXCLUDE
  416. PATTERN "logic/*" EXCLUDE
  417. PATTERN "math*" EXCLUDE
  418. PATTERN "mpi*" EXCLUDE
  419. PATTERN "multi_*" EXCLUDE
  420. PATTERN "numeric/*" EXCLUDE
  421. PATTERN "pending/*" EXCLUDE
  422. PATTERN "pool/*" EXCLUDE
  423. PATTERN "property_map/*" EXCLUDE
  424. PATTERN "proto/*" EXCLUDE
  425. PATTERN "random*" EXCLUDE
  426. PATTERN "signals*" EXCLUDE
  427. PATTERN "spirit*" EXCLUDE
  428. PATTERN "statechart/*" EXCLUDE
  429. PATTERN "units/*" EXCLUDE
  430. PATTERN "unordered*" EXCLUDE
  431. PATTERN "wave*" EXCLUDE
  432. PATTERN "xpressive/*" EXCLUDE)
  433.  
  434. set(Boost_DATE_TIME_LIBRARY "")
  435. set(Boost_THREAD_LIBRARY "")
  436. set(Boost_PROGRAM_OPTIONS_LIBRARY "")
  437. set(Boost_FILESYSTEM_LIBRARY "")
  438. set(Boost_UNIT_TEST_FRAMEWORK_LIBRARY "")
  439. set(Boost_REGEX_LIBRARY "")
  440. if (Boost_VERSION GREATER 103499)
  441. set(Boost_SYSTEM_LIBRARY "")
  442. endif (Boost_VERSION GREATER 103499)
  443. include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/windows/resources )
  444. endif (MSVC)
  445.  
  446. include_directories( ${Boost_INCLUDE_DIR} )
  447.  
  448. include_directories( ${CMAKE_CURRENT_SOURCE_DIR} )
  449. include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../include )
  450. include_directories( ${CMAKE_CURRENT_BINARY_DIR} )
  451. include_directories( ${CMAKE_CURRENT_BINARY_DIR}/../include )
  452.  
  453. link_directories( ${Boost_LIBRARY_DIRS} )
  454.  
  455. CHECK_LIBRARY_EXISTS (rt clock_gettime "" CLOCK_GETTIME_IN_RT)
  456. if (NOT CLOCK_GETTIME_IN_RT)
  457. CHECK_FUNCTION_EXISTS (clock_gettime QPID_HAS_CLOCK_GETTIME)
  458. else (NOT CLOCK_GETTIME_IN_RT)
  459. set(CMAKE_REQUIRED_LIBS ${CMAKE_REQUIRED_LIBS} rt)
  460. set(QPID_HAS_CLOCK_GETTIME YES CACHE BOOL "Platform has clock_gettime")
  461. endif (NOT CLOCK_GETTIME_IN_RT)
  462.  
  463. # See if Cyrus SASL is desired and available
  464. CHECK_LIBRARY_EXISTS (sasl2 sasl_checkpass "" HAVE_SASL)
  465. CHECK_INCLUDE_FILES (sasl/sasl.h HAVE_SASL_H)
  466.  
  467. set (sasl_default ${sasl_force})
  468. if (HAVE_SASL AND HAVE_SASL_H)
  469. set (sasl_default ON)
  470. endif (HAVE_SASL AND HAVE_SASL_H)
  471.  
  472. option(BUILD_SASL "Build with Cyrus SASL support" ${sasl_default})
  473. if (BUILD_SASL)
  474. if (NOT HAVE_SASL)
  475. message(FATAL_ERROR "Cyrus SASL support requested but libsasl2 not found")
  476. endif (NOT HAVE_SASL)
  477. if (NOT HAVE_SASL_H)
  478. message(FATAL_ERROR "Cyrus SASL support requested but sasl.h not found")
  479. endif (NOT HAVE_SASL_H)
  480.  
  481. set(BROKER_SASL_NAME "qpidd" CACHE STRING "SASL app name for the qpid broker")
  482. set(qpidcommon_sasl_source
  483. qpid/sys/cyrus/CyrusSecurityLayer.h
  484. qpid/sys/cyrus/CyrusSecurityLayer.cpp
  485. )
  486. set(qpidcommon_sasl_lib sasl2)
  487. endif (BUILD_SASL)
  488.  
  489. # See if XML Exchange is desired and prerequisites are available
  490. CHECK_LIBRARY_EXISTS (xerces-c _init "" HAVE_XERCES)
  491. CHECK_INCLUDE_FILE_CXX (xercesc/framework/MemBufInputSource.hpp HAVE_XERCES_H)
  492. CHECK_INCLUDE_FILE_CXX (xqilla/xqilla-simple.hpp HAVE_XQILLA_H)
  493. CHECK_INCLUDE_FILE_CXX (xqilla/ast/XQEffectiveBooleanValue.hpp HAVE_XQ_EBV)
  494.  
  495. set (xml_default ${xml_force})
  496. if (CMAKE_SYSTEM_NAME STREQUAL Windows)
  497. else (CMAKE_SYSTEM_NAME STREQUAL Windows)
  498. if (HAVE_XERCES AND HAVE_XERCES_H)
  499. if (HAVE_XQILLA_H)
  500. set (xml_default ON)
  501. endif (HAVE_XQILLA_H)
  502. endif (HAVE_XERCES AND HAVE_XERCES_H)
  503. endif (CMAKE_SYSTEM_NAME STREQUAL Windows)
  504.  
  505. option(BUILD_XML "Build with XML Exchange" ${xml_default})
  506. if (BUILD_XML)
  507. if (NOT HAVE_XERCES)
  508. message(FATAL_ERROR "XML Exchange support requested but xerces-c library not found")
  509. endif (NOT HAVE_XERCES)
  510. if (NOT HAVE_XERCES_H)
  511. message(FATAL_ERROR "XML Exchange support requested but Xerces-C headers not found")
  512. endif (NOT HAVE_XERCES_H)
  513. if (NOT HAVE_XQILLA_H)
  514. message(FATAL_ERROR "XML Exchange support requested but XQilla headers not found")
  515. endif (NOT HAVE_XQILLA_H)
  516.  
  517. if (HAVE_XQ_EBV)
  518. add_definitions(-DXQ_EFFECTIVE_BOOLEAN_VALUE_HPP)
  519. endif (HAVE_XQ_EBV)
  520.  
  521. add_library (xml MODULE
  522. qpid/xml/XmlExchange.cpp
  523. qpid/xml/XmlExchange.h
  524. qpid/xml/XmlExchangePlugin.cpp)
  525. set_target_properties (xml PROPERTIES PREFIX "")
  526. target_link_libraries (xml xerces-c xqilla qpidbroker pthread)
  527. if (CMAKE_COMPILER_IS_GNUCXX)
  528. set_target_properties (xml PROPERTIES
  529. PREFIX ""
  530. LINK_FLAGS -Wl,--no-undefined)
  531. endif (CMAKE_COMPILER_IS_GNUCXX)
  532. install (TARGETS xml
  533. DESTINATION ${QPIDD_MODULE_DIR}
  534. COMPONENT ${QPID_COMPONENT_BROKER})
  535.  
  536. set(xml_tests XmlClientSessionTest)
  537.  
  538. endif (BUILD_XML)
  539.  
  540. # Build the ACL plugin
  541. set (acl_default ON)
  542. option(BUILD_ACL "Build ACL enforcement broker plugin" ${acl_default})
  543. if (BUILD_ACL)
  544. set (acl_SOURCES
  545. qpid/acl/Acl.cpp
  546. qpid/acl/Acl.h
  547. qpid/acl/AclData.cpp
  548. qpid/acl/AclData.h
  549. qpid/acl/AclPlugin.cpp
  550. qpid/acl/AclReader.cpp
  551. qpid/acl/AclReader.h
  552. qpid/acl/AclValidator.cpp
  553. qpid/acl/AclValidator.h
  554. )
  555. # Windows builds the ACL code into the qpidbroker library; see QPID-1842
  556. # for history and rationale. If this is changed, remove the acl_SOURCES from
  557. # the qpidbroker platform-specific source list.
  558. if (NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
  559. add_library (acl MODULE ${acl_SOURCES})
  560. set_target_properties (acl PROPERTIES PREFIX "")
  561. target_link_libraries (acl qpidbroker
  562. ${Boost_SYSTEM_LIBRARY}
  563. ${Boost_PROGRAM_OPTIONS_LIBRARY})
  564. if (CMAKE_COMPILER_IS_GNUCXX)
  565. set_target_properties (acl PROPERTIES
  566. PREFIX ""
  567. LINK_FLAGS -Wl,--no-undefined)
  568. endif (CMAKE_COMPILER_IS_GNUCXX)
  569. install (TARGETS acl
  570. DESTINATION ${QPIDD_MODULE_DIR}
  571. COMPONENT ${QPID_COMPONENT_BROKER})
  572. endif (NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
  573. endif (BUILD_ACL)
  574.  
  575. # Check for optional cluster support requirements
  576. include (cluster.cmake)
  577.  
  578. # Check for optional RDMA support requirements
  579. include (rdma.cmake)
  580.  
  581. # Check for optional SSL support requirements
  582. include (ssl.cmake)
  583.  
  584. # Check for syslog capabilities not present on all systems
  585. check_symbol_exists (LOG_AUTHPRIV "sys/syslog.h" HAVE_LOG_AUTHPRIV)
  586. check_symbol_exists (LOG_FTP "sys/syslog.h" HAVE_LOG_FTP)
  587.  
  588. if (CMAKE_SYSTEM_NAME STREQUAL Windows)
  589. if (MSVC)
  590. add_definitions(
  591. /D "_CRT_NONSTDC_NO_WARNINGS"
  592. /D "NOMINMAX"
  593. /D "WIN32_LEAN_AND_MEAN"
  594. /wd4244
  595. /wd4800
  596. /wd4355
  597. )
  598. if (MSVC80)
  599. add_definitions(/D "_WIN32_WINNT=0x0501")
  600. endif (MSVC80)
  601.  
  602. # set the RelWithDebInfo compile/link switches to equal Release
  603. set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /O2 /Ob2 /D NDEBUG")
  604. set (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "/debug /INCREMENTAL:NO")
  605.  
  606. if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../bindings/qpid/dotnet/src)
  607. # Set the windows version for the .NET Binding cpp project
  608. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../bindings/qpid/dotnet/src/org.apache.qpid.messaging.template.rc
  609. ${CMAKE_CURRENT_BINARY_DIR}/windows/resources/org.apache.qpid.messaging.rc)
  610. # Set the windows version for the .NET Binding sessionreceiver project
  611. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../bindings/qpid/dotnet/src/sessionreceiver/properties/sessionreceiver-AssemblyInfo-template.cs
  612. ${CMAKE_CURRENT_BINARY_DIR}/windows/generated_src/sessionreceiver-AssemblyInfo.cs)
  613. endif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../bindings/qpid/dotnet/src)
  614. endif (MSVC)
  615.  
  616. set (qpidtypes_platform_SOURCES
  617. qpid/sys/windows/uuid.cpp
  618. )
  619. set (qpidtypes_platform_LIBS
  620. rpcrt4
  621. )
  622.  
  623. set (qpidcommon_platform_SOURCES
  624. qpid/log/windows/SinkOptions.cpp
  625. qpid/sys/windows/AsynchIO.cpp
  626. qpid/sys/windows/FileSysDir.cpp
  627. qpid/sys/windows/IocpPoller.cpp
  628. qpid/sys/windows/IOHandle.cpp
  629. qpid/sys/windows/LockFile.cpp
  630. qpid/sys/windows/PipeHandle.cpp
  631. qpid/sys/windows/PollableCondition.cpp
  632. qpid/sys/windows/Shlib.cpp
  633. qpid/sys/windows/Socket.cpp
  634. qpid/sys/windows/SocketAddress.cpp
  635. qpid/sys/windows/StrError.cpp
  636. qpid/sys/windows/SystemInfo.cpp
  637. qpid/sys/windows/Thread.cpp
  638. qpid/sys/windows/Time.cpp
  639. qpid/client/windows/SaslFactory.cpp
  640. ${sslcommon_windows_SOURCES}
  641. )
  642.  
  643. set (qpidcommon_platform_LIBS
  644. ${windows_ssl_libs} ws2_32
  645. )
  646. set (qpidbroker_platform_SOURCES
  647. qpid/broker/windows/BrokerDefaults.cpp
  648. qpid/broker/windows/SaslAuthenticator.cpp
  649. ${acl_SOURCES}
  650. ${sslbroker_windows_SOURCES}
  651. )
  652. set (qpidbroker_platform_LIBS
  653. ${windows_ssl_libs} ${windows_ssl_server_libs}
  654. )
  655. set (qpidclient_platform_SOURCES
  656. ${sslclient_windows_SOURCES}
  657. )
  658. set (qpidclient_platform_LIBS
  659. ${windows_ssl_libs}
  660. )
  661.  
  662. set (qpidd_platform_SOURCES
  663. windows/QpiddBroker.cpp
  664. )
  665.  
  666. set (qpidmessaging_platform_SOURCES
  667. qpid/messaging/HandleInstantiator.cpp
  668. )
  669.  
  670. else (CMAKE_SYSTEM_NAME STREQUAL Windows)
  671.  
  672. # POSIX (Non-Windows) platforms have a lot of overlap in sources; the only
  673. # major difference is the poller module.
  674. if (CMAKE_SYSTEM_NAME STREQUAL Linux)
  675. set (qpid_poller_module
  676. qpid/sys/epoll/EpollPoller.cpp
  677. qpid/sys/posix/SystemInfo.cpp
  678. )
  679. add_definitions(-pthread)
  680. set (CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} -pthread)
  681. endif (CMAKE_SYSTEM_NAME STREQUAL Linux)
  682.  
  683. if (CMAKE_SYSTEM_NAME STREQUAL SunOS)
  684. set (qpid_poller_module
  685. qpid/sys/solaris/ECFPoller.cpp
  686. qpid/sys/solaris/SystemInfo.cpp
  687. )
  688. endif (CMAKE_SYSTEM_NAME STREQUAL SunOS)
  689.  
  690. set (qpidtypes_platform_SOURCES)
  691. set (qpidtypes_platform_LIBS
  692. uuid
  693. )
  694.  
  695. set (qpidcommon_platform_SOURCES
  696. qpid/sys/posix/AsynchIO.cpp
  697. qpid/sys/posix/Fork.cpp
  698. qpid/sys/posix/FileSysDir.cpp
  699. qpid/sys/posix/IOHandle.cpp
  700. qpid/sys/posix/LockFile.cpp
  701. qpid/sys/posix/Mutex.cpp
  702. qpid/sys/posix/PipeHandle.cpp
  703. qpid/sys/posix/PollableCondition.cpp
  704. qpid/sys/posix/Shlib.cpp
  705. qpid/log/posix/SinkOptions.cpp
  706. qpid/sys/posix/Socket.cpp
  707. qpid/sys/posix/SocketAddress.cpp
  708. qpid/sys/posix/StrError.cpp
  709. qpid/sys/posix/Thread.cpp
  710. qpid/sys/posix/Time.cpp
  711. qpid/SaslFactory.cpp
  712.  
  713. ${qpid_poller_module}
  714. )
  715. set (qpidcommon_platform_LIBS
  716. ${Boost_SYSTEM_LIBRARY}
  717. ${Boost_PROGRAM_OPTIONS_LIBRARY}
  718. ${Boost_FILESYSTEM_LIBRARY}
  719. ${CMAKE_DL_LIBS}
  720. )
  721.  
  722. set (qpidbroker_platform_SOURCES
  723. qpid/broker/Daemon.cpp
  724. qpid/broker/SaslAuthenticator.cpp
  725. qpid/broker/SignalHandler.h
  726. qpid/broker/SignalHandler.cpp
  727. qpid/broker/posix/BrokerDefaults.cpp
  728. )
  729.  
  730. set (qpidclient_platform_SOURCES
  731. )
  732.  
  733. set (qpidd_platform_SOURCES
  734. posix/QpiddBroker.cpp
  735. )
  736.  
  737. set (qpidmessaging_platform_SOURCES
  738. )
  739. endif (CMAKE_SYSTEM_NAME STREQUAL Windows)
  740.  
  741. set (qpidcommon_SOURCES
  742. ${rgen_framing_srcs}
  743. ${qpidcommon_platform_SOURCES}
  744. ${qpidcommon_sasl_source}
  745. qpid/assert.cpp
  746. qpid/Address.cpp
  747. qpid/DataDir.cpp
  748. qpid/Exception.cpp
  749. qpid/Modules.cpp
  750. qpid/Options.cpp
  751. qpid/Plugin.cpp
  752. qpid/RefCountedBuffer.cpp
  753. qpid/SessionState.cpp
  754. qpid/SessionId.cpp
  755. qpid/StringUtils.cpp
  756. qpid/Url.cpp
  757. qpid/amqp_0_10/SessionHandler.cpp
  758. qpid/framing/AccumulatedAck.cpp
  759. qpid/framing/AMQBody.cpp
  760. qpid/framing/AMQMethodBody.cpp
  761. qpid/framing/AMQContentBody.cpp
  762. qpid/framing/AMQFrame.cpp
  763. qpid/framing/AMQHeaderBody.cpp
  764. qpid/framing/AMQHeartbeatBody.cpp
  765. qpid/framing/Array.cpp
  766. qpid/framing/BodyHandler.cpp
  767. qpid/framing/Buffer.cpp
  768. qpid/framing/Endian.cpp
  769. qpid/framing/FieldTable.cpp
  770. qpid/framing/FieldValue.cpp
  771. qpid/framing/FrameSet.cpp
  772. qpid/framing/FrameDecoder.cpp
  773. qpid/framing/List.cpp
  774. qpid/framing/ProtocolInitiation.cpp
  775. qpid/framing/ProtocolVersion.cpp
  776. qpid/framing/SendContent.cpp
  777. qpid/framing/SequenceNumber.cpp
  778. qpid/framing/SequenceNumberSet.cpp
  779. qpid/framing/SequenceSet.cpp
  780. qpid/framing/Proxy.cpp
  781. qpid/framing/Uuid.cpp
  782. qpid/framing/TransferContent.cpp
  783. qpid/log/Logger.cpp
  784. qpid/log/Options.cpp
  785. qpid/log/OstreamOutput.cpp
  786. qpid/log/Selector.cpp
  787. qpid/log/Statement.cpp
  788. qpid/management/Buffer.cpp
  789. qpid/management/ConnectionSettings.cpp
  790. qpid/management/Mutex.cpp
  791. qpid/management/Manageable.cpp
  792. qpid/management/ManagementObject.cpp
  793. qpid/sys/AggregateOutput.cpp
  794. qpid/sys/AsynchIOHandler.cpp
  795. qpid/sys/ClusterSafe.cpp
  796. qpid/sys/Dispatcher.cpp
  797. qpid/sys/DispatchHandle.cpp
  798. qpid/sys/Runnable.cpp
  799. qpid/sys/Shlib.cpp
  800. qpid/sys/Timer.cpp
  801. qpid/sys/TimerWarnings.cpp
  802. qpid/amqp_0_10/Codecs.cpp
  803. )
  804. add_msvc_version (qpidcommon library dll)
  805.  
  806. add_library (qpidcommon SHARED ${qpidcommon_SOURCES})
  807. if (CLOCK_GETTIME_IN_RT)
  808. set (qpidcommon_platform_LIBS ${qpidcommon_platform_LIBS} rt)
  809. endif (CLOCK_GETTIME_IN_RT)
  810. target_link_libraries (qpidcommon qpidtypes
  811. ${qpidcommon_platform_LIBS}
  812. ${qpidcommon_sasl_lib})
  813. set_target_properties (qpidcommon PROPERTIES
  814. VERSION ${qpidc_version})
  815. install (TARGETS qpidcommon
  816. DESTINATION ${QPID_INSTALL_LIBDIR}
  817. COMPONENT ${QPID_COMPONENT_COMMON})
  818. install_pdb (qpidcommon ${QPID_COMPONENT_COMMON})
  819.  
  820. set(qpidtypes_SOURCES
  821. qpid/types/Exception.cpp
  822. qpid/types/Uuid.cpp
  823. qpid/types/Variant.cpp
  824. ${qpidtypes_platform_SOURCES}
  825. )
  826. add_msvc_version (qpidtypes library dll)
  827. add_library(qpidtypes SHARED ${qpidtypes_SOURCES})
  828. target_link_libraries(qpidtypes ${qpidtypes_platform_LIBS})
  829. set_target_properties (qpidtypes PROPERTIES VERSION ${qpidc_version})
  830. install(TARGETS qpidtypes
  831. DESTINATION ${QPID_INSTALL_LIBDIR}
  832. COMPONENT ${QPID_COMPONENT_COMMON})
  833. install_pdb (qpidtypes ${QPID_COMPONENT_COMMON})
  834.  
  835. set (qpidclient_SOURCES
  836. ${rgen_client_srcs}
  837. ${qpidclient_platform_SOURCES}
  838. qpid/client/Bounds.cpp
  839. qpid/client/Completion.cpp
  840. qpid/client/Connection.cpp
  841. qpid/client/ConnectionHandler.cpp
  842. qpid/client/ConnectionImpl.cpp
  843. qpid/client/ConnectionSettings.cpp
  844. qpid/client/Connector.cpp
  845. qpid/client/Demux.cpp
  846. qpid/client/Dispatcher.cpp
  847. qpid/client/FailoverManager.cpp
  848. qpid/client/FailoverListener.cpp
  849. qpid/client/Future.cpp
  850. qpid/client/FutureCompletion.cpp
  851. qpid/client/FutureResult.cpp
  852. qpid/client/LoadPlugins.cpp
  853. qpid/client/LocalQueue.cpp
  854. qpid/client/LocalQueueImpl.cpp
  855. qpid/client/Message.cpp
  856. qpid/client/MessageImpl.cpp
  857. qpid/client/MessageListener.cpp
  858. qpid/client/MessageReplayTracker.cpp
  859. qpid/client/QueueOptions.cpp
  860. qpid/client/Results.cpp
  861. qpid/client/SessionBase_0_10.cpp
  862. qpid/client/SessionBase_0_10Access.h
  863. qpid/client/ConnectionAccess.h
  864. qpid/client/SessionImpl.cpp
  865. qpid/client/StateManager.cpp
  866. qpid/client/Subscription.cpp
  867. qpid/client/SubscriptionImpl.cpp
  868. qpid/client/SubscriptionManager.cpp
  869. qpid/client/SubscriptionManagerImpl.cpp
  870. qpid/client/TCPConnector.cpp
  871. )
  872. add_msvc_version (qpidclient library dll)
  873.  
  874. add_library (qpidclient SHARED ${qpidclient_SOURCES})
  875. target_link_libraries (qpidclient qpidcommon ${qpidclient_platform_LIBS})
  876. set_target_properties (qpidclient PROPERTIES VERSION ${qpidc_version})
  877. install (TARGETS qpidclient
  878. DESTINATION ${QPID_INSTALL_LIBDIR}
  879. COMPONENT ${QPID_COMPONENT_CLIENT})
  880. install (DIRECTORY ../include/qpid
  881. DESTINATION ${QPID_INSTALL_INCLUDEDIR}
  882. COMPONENT ${QPID_COMPONENT_CLIENT_INCLUDE}
  883. PATTERN ".svn" EXCLUDE)
  884. install_pdb (qpidclient ${QPID_COMPONENT_CLIENT})
  885.  
  886.  
  887. set (qpidmessaging_SOURCES
  888. ${qpidmessaging_platform_SOURCES}
  889. qpid/messaging/Address.cpp
  890. qpid/messaging/AddressParser.h
  891. qpid/messaging/AddressParser.cpp
  892. qpid/messaging/Connection.cpp
  893. qpid/messaging/ConnectionImpl.h
  894. qpid/messaging/Duration.cpp
  895. qpid/messaging/exceptions.cpp
  896. qpid/messaging/Message.cpp
  897. qpid/messaging/MessageImpl.h
  898. qpid/messaging/MessageImpl.cpp
  899. qpid/messaging/Receiver.cpp
  900. qpid/messaging/ReceiverImpl.h
  901. qpid/messaging/Session.cpp
  902. qpid/messaging/SessionImpl.h
  903. qpid/messaging/Sender.cpp
  904. qpid/messaging/SenderImpl.h
  905. qpid/messaging/FailoverUpdates.cpp
  906. qpid/client/amqp0_10/AcceptTracker.h
  907. qpid/client/amqp0_10/AcceptTracker.cpp
  908. qpid/client/amqp0_10/AddressResolution.h
  909. qpid/client/amqp0_10/AddressResolution.cpp
  910. qpid/client/amqp0_10/ConnectionImpl.h
  911. qpid/client/amqp0_10/ConnectionImpl.cpp
  912. qpid/client/amqp0_10/IncomingMessages.h
  913. qpid/client/amqp0_10/IncomingMessages.cpp
  914. qpid/client/amqp0_10/MessageSink.h
  915. qpid/client/amqp0_10/MessageSource.h
  916. qpid/client/amqp0_10/OutgoingMessage.h
  917. qpid/client/amqp0_10/OutgoingMessage.cpp
  918. qpid/client/amqp0_10/ReceiverImpl.h
  919. qpid/client/amqp0_10/ReceiverImpl.cpp
  920. qpid/client/amqp0_10/SessionImpl.h
  921. qpid/client/amqp0_10/SessionImpl.cpp
  922. qpid/client/amqp0_10/SenderImpl.h
  923. qpid/client/amqp0_10/SenderImpl.cpp
  924. qpid/client/amqp0_10/SimpleUrlParser.h
  925. qpid/client/amqp0_10/SimpleUrlParser.cpp
  926. )
  927. add_msvc_version (qpidmessaging library dll)
  928.  
  929. add_library (qpidmessaging SHARED ${qpidmessaging_SOURCES})
  930. target_link_libraries (qpidmessaging qpidclient)
  931. set_target_properties (qpidmessaging PROPERTIES VERSION ${qpidc_version})
  932. install (TARGETS qpidmessaging
  933. DESTINATION ${QPID_INSTALL_LIBDIR}
  934. COMPONENT ${QPID_COMPONENT_CLIENT})
  935. install_pdb (qpidmessaging ${QPID_COMPONENT_CLIENT})
  936.  
  937. # Released source artifacts from Apache have the generated headers included in
  938. # the source tree, not the binary tree. So don't attempt to grab them when
  939. # they're not supposed to be there.
  940. if (NOT QPID_GENERATED_HEADERS_IN_SOURCE)
  941. install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../include/qpid
  942. DESTINATION ${QPID_INSTALL_INCLUDEDIR}
  943. COMPONENT ${QPID_COMPONENT_CLIENT_INCLUDE})
  944. endif (NOT QPID_GENERATED_HEADERS_IN_SOURCE)
  945.  
  946.  
  947. if (WIN32)
  948. # Install the DtcPlugin project and call it qpidxarm.
  949. set(AMQP_WCF_DIR ${qpid-cpp_SOURCE_DIR}/../wcf)
  950. set(qpidxarm_SOURCES ${AMQP_WCF_DIR}/src/Apache/Qpid/DtcPlugin/DtcPlugin.cpp)
  951. if (EXISTS ${qpidxarm_SOURCES})
  952. add_msvc_version (qpidxarm library dll)
  953. add_library (qpidxarm SHARED ${qpidxarm_SOURCES})
  954. target_link_libraries (qpidxarm qpidclient qpidcommon)
  955. install (TARGETS qpidxarm
  956. DESTINATION ${QPID_INSTALL_LIBDIR}
  957. COMPONENT ${QPID_COMPONENT_CLIENT})
  958. install_pdb (qpidxarm ${QPID_COMPONENT_CLIENT})
  959. endif (EXISTS ${qpidxarm_SOURCES})
  960. endif (WIN32)
  961.  
  962. set (qpidbroker_SOURCES
  963. ${mgen_broker_cpp}
  964. ${qpidbroker_platform_SOURCES}
  965. qpid/amqp_0_10/Connection.h
  966. qpid/amqp_0_10/Connection.cpp
  967. qpid/broker/Broker.cpp
  968. qpid/broker/Exchange.cpp
  969. qpid/broker/ExpiryPolicy.cpp
  970. qpid/broker/Fairshare.cpp
  971. qpid/broker/LegacyLVQ.cpp
  972. qpid/broker/MessageDeque.cpp
  973. qpid/broker/MessageMap.cpp
  974. qpid/broker/PriorityQueue.cpp
  975. qpid/broker/Queue.cpp
  976. qpid/broker/QueueCleaner.cpp
  977. qpid/broker/QueueListeners.cpp
  978. qpid/broker/PersistableMessage.cpp
  979. qpid/broker/Bridge.cpp
  980. qpid/broker/Connection.cpp
  981. qpid/broker/ConnectionHandler.cpp
  982. qpid/broker/ConnectionFactory.cpp
  983. qpid/broker/DeliverableMessage.cpp
  984. qpid/broker/DeliveryRecord.cpp
  985. qpid/broker/DirectExchange.cpp
  986. qpid/broker/DtxAck.cpp
  987. qpid/broker/DtxBuffer.cpp
  988. qpid/broker/DtxManager.cpp
  989. qpid/broker/DtxTimeout.cpp
  990. qpid/broker/DtxWorkRecord.cpp
  991. qpid/broker/ExchangeRegistry.cpp
  992. qpid/broker/FanOutExchange.cpp
  993. qpid/broker/HeadersExchange.cpp
  994. qpid/broker/Link.cpp
  995. qpid/broker/LinkRegistry.cpp
  996. qpid/broker/Message.cpp
  997. qpid/broker/MessageAdapter.cpp
  998. qpid/broker/MessageBuilder.cpp
  999. qpid/broker/MessageStoreModule.cpp
  1000. qpid/broker/NameGenerator.cpp
  1001. qpid/broker/NullMessageStore.cpp
  1002. qpid/broker/QueueBindings.cpp
  1003. qpid/broker/QueueEvents.cpp
  1004. qpid/broker/QueuePolicy.cpp
  1005. qpid/broker/QueueRegistry.cpp
  1006. qpid/broker/QueueFlowLimit.cpp
  1007. qpid/broker/RateTracker.cpp
  1008. qpid/broker/RecoveryManagerImpl.cpp
  1009. qpid/broker/RecoveredEnqueue.cpp
  1010. qpid/broker/RecoveredDequeue.cpp
  1011. qpid/broker/RetryList.cpp
  1012. qpid/broker/SecureConnection.cpp
  1013. qpid/broker/SecureConnectionFactory.cpp
  1014. qpid/broker/SemanticState.h
  1015. qpid/broker/SemanticState.cpp
  1016. qpid/broker/SessionAdapter.cpp
  1017. qpid/broker/SessionState.h
  1018. qpid/broker/SessionState.cpp
  1019. qpid/broker/SessionManager.h
  1020. qpid/broker/SessionManager.cpp
  1021. qpid/broker/SessionContext.h
  1022. qpid/broker/SessionHandler.h
  1023. qpid/broker/SessionHandler.cpp
  1024. qpid/broker/System.cpp
  1025. qpid/broker/ThresholdAlerts.cpp
  1026. qpid/broker/TopicExchange.cpp
  1027. qpid/broker/TxAccept.cpp
  1028. qpid/broker/TxBuffer.cpp
  1029. qpid/broker/TxPublish.cpp
  1030. qpid/broker/Vhost.cpp
  1031. qpid/management/ManagementAgent.cpp
  1032. qpid/management/ManagementDirectExchange.cpp
  1033. qpid/management/ManagementTopicExchange.cpp
  1034. qpid/sys/TCPIOPlugin.cpp
  1035. )
  1036. add_msvc_version (qpidbroker library dll)
  1037. add_library (qpidbroker SHARED ${qpidbroker_SOURCES})
  1038. target_link_libraries (qpidbroker qpidcommon ${qpidbroker_platform_LIBS})
  1039. set_target_properties (qpidbroker PROPERTIES VERSION ${qpidc_version})
  1040. if (MSVC)
  1041. set_target_properties (qpidbroker PROPERTIES COMPILE_FLAGS /wd4290)
  1042. endif (MSVC)
  1043. install (TARGETS qpidbroker
  1044. DESTINATION ${QPID_INSTALL_LIBDIR}
  1045. COMPONENT ${QPID_COMPONENT_BROKER})
  1046. install_pdb (qpidbroker ${QPID_COMPONENT_BROKER})
  1047.  
  1048.  
  1049. set (qpidd_SOURCES
  1050. ${qpidd_platform_SOURCES}
  1051. qpidd.cpp
  1052. qpidd.h
  1053. )
  1054. add_msvc_version (qpidd application exe)
  1055. add_executable (qpidd ${qpidd_SOURCES})
  1056. target_link_libraries (qpidd qpidbroker qpidcommon
  1057. ${Boost_SYSTEM_LIBRARY}
  1058. ${Boost_PROGRAM_OPTIONS_LIBRARY}
  1059. ${Boost_FILESYSTEM_LIBRARY})
  1060. install (TARGETS qpidd RUNTIME
  1061. DESTINATION ${QPID_INSTALL_BINDIR}
  1062. COMPONENT ${QPID_COMPONENT_BROKER})
  1063. if (CPACK_GENERATOR STREQUAL "NSIS")
  1064. set (CPACK_NSIS_MENU_LINKS
  1065. "qpidd" "Start Qpid Broker")
  1066. endif (CPACK_GENERATOR STREQUAL "NSIS")
  1067.  
  1068. # QMF library
  1069. # Library Version Information (CURRENT.REVISION.AGE):
  1070. #
  1071. # CURRENT => API/ABI version. Bump this if the interface changes
  1072. # REVISION => Version of underlying implementation.
  1073. # Bump if implementation changes but API/ABI doesn't
  1074. # AGE => Number of API/ABI versions this is backward compatible with
  1075. set (qmf_version 2.0.0)
  1076. set (qmf2_version 1.0.0)
  1077. set (qmfengine_version 1.0.0)
  1078.  
  1079. set (qmf_SOURCES
  1080. qpid/agent/ManagementAgentImpl.cpp
  1081. qpid/agent/ManagementAgentImpl.h
  1082. )
  1083.  
  1084. add_msvc_version (qmf library dll)
  1085. add_library (qmf SHARED ${qmf_SOURCES})
  1086. target_link_libraries (qmf qpidclient)
  1087. set_target_properties (qmf PROPERTIES
  1088. VERSION ${qmf_version})
  1089. install (TARGETS qmf OPTIONAL
  1090. DESTINATION ${QPID_INSTALL_LIBDIR}
  1091. COMPONENT ${QPID_COMPONENT_QMF})
  1092. install_pdb (qmf ${QPID_COMPONENT_QMF})
  1093.  
  1094. if(NOT WIN32)
  1095. set (qmf2_HEADERS
  1096. ../include/qmf/AgentEvent.h
  1097. ../include/qmf/Agent.h
  1098. ../include/qmf/AgentSession.h
  1099. ../include/qmf/ConsoleEvent.h
  1100. ../include/qmf/ConsoleSession.h
  1101. ../include/qmf/DataAddr.h
  1102. ../include/qmf/Data.h
  1103. ../include/qmf/exceptions.h
  1104. ../include/qmf/Handle.h
  1105. ../include/qmf/ImportExport.h
  1106. ../include/qmf/Query.h
  1107. ../include/qmf/Schema.h
  1108. ../include/qmf/SchemaId.h
  1109. ../include/qmf/SchemaMethod.h
  1110. ../include/qmf/SchemaProperty.h
  1111. ../include/qmf/SchemaTypes.h
  1112. ../include/qmf/Subscription.h
  1113. )
  1114.  
  1115. set (qmf2_SOURCES
  1116. ${qmf2_HEADERS}
  1117. qmf/agentCapability.h
  1118. qmf/Agent.cpp
  1119. qmf/AgentEvent.cpp
  1120. qmf/AgentEventImpl.h
  1121. qmf/AgentImpl.h
  1122. qmf/AgentSession.cpp
  1123. qmf/AgentSubscription.cpp
  1124. qmf/AgentSubscription.h
  1125. qmf/ConsoleEvent.cpp
  1126. qmf/ConsoleEventImpl.h
  1127. qmf/ConsoleSession.cpp
  1128. qmf/ConsoleSessionImpl.h
  1129. qmf/constants.cpp
  1130. qmf/constants.h
  1131. qmf/DataAddr.cpp
  1132. qmf/DataAddrImpl.h
  1133. qmf/Data.cpp
  1134. qmf/DataImpl.h
  1135. qmf/exceptions.cpp
  1136. qmf/Expression.cpp
  1137. qmf/Expression.h
  1138. qmf/Hash.cpp
  1139. qmf/Hash.h
  1140. qmf/PrivateImplRef.h
  1141. qmf/Query.cpp
  1142. qmf/QueryImpl.h
  1143. qmf/Schema.cpp
  1144. qmf/SchemaCache.cpp
  1145. qmf/SchemaCache.h
  1146. qmf/SchemaId.cpp
  1147. qmf/SchemaIdImpl.h
  1148. qmf/SchemaImpl.h
  1149. qmf/SchemaMethod.cpp
  1150. qmf/SchemaMethodImpl.h
  1151. qmf/SchemaProperty.cpp
  1152. qmf/SchemaPropertyImpl.h
  1153. qmf/Subscription.cpp
  1154. qmf/SubscriptionImpl.h
  1155. )
  1156.  
  1157. add_msvc_version (qmf2 library dll)
  1158. add_library (qmf2 SHARED ${qmf2_SOURCES})
  1159. target_link_libraries (qmf2 qpidmessaging qpidtypes qpidclient qpidcommon)
  1160. set_target_properties (qmf2 PROPERTIES
  1161. VERSION ${qmf2_version})
  1162. install (TARGETS qmf2 OPTIONAL
  1163. DESTINATION ${QPID_INSTALL_LIBDIR}
  1164. COMPONENT ${QPID_COMPONENT_QMF})
  1165. install (FILES ${qmf2_HEADERS}
  1166. DESTINATION ${QPID_INSTALL_INCLUDEDIR}/qmf
  1167. COMPONENT ${QPID_COMPONENT_QMF})
  1168. install_pdb (qmf2 ${QPID_COMPONENT_QMF})
  1169. endif (NOT WIN32)
  1170.  
  1171. set (qmfengine_SOURCES
  1172. qmf/engine/Agent.cpp
  1173. qmf/engine/BrokerProxyImpl.cpp
  1174. qmf/engine/BrokerProxyImpl.h
  1175. qmf/engine/ConnectionSettingsImpl.cpp
  1176. qmf/engine/ConnectionSettingsImpl.h
  1177. qmf/engine/ConsoleImpl.cpp
  1178. qmf/engine/ConsoleImpl.h
  1179. qmf/engine/EventImpl.cpp
  1180. qmf/engine/EventImpl.h
  1181. qmf/engine/MessageImpl.cpp
  1182. qmf/engine/MessageImpl.h
  1183. qmf/engine/ObjectIdImpl.cpp
  1184. qmf/engine/ObjectIdImpl.h
  1185. qmf/engine/ObjectImpl.cpp
  1186. qmf/engine/ObjectImpl.h
  1187. qmf/engine/Protocol.cpp
  1188. qmf/engine/Protocol.h
  1189. qmf/engine/QueryImpl.cpp
  1190. qmf/engine/QueryImpl.h
  1191. qmf/engine/SequenceManager.cpp
  1192. qmf/engine/SequenceManager.h
  1193. qmf/engine/SchemaImpl.cpp
  1194. qmf/engine/SchemaImpl.h
  1195. qmf/engine/ValueImpl.cpp
  1196. qmf/engine/ValueImpl.h
  1197. )
  1198. if (NOT WIN32)
  1199. list(APPEND qmfengine_SOURCES qmf/engine/ResilientConnection.cpp)
  1200. endif (NOT WIN32)
  1201. add_msvc_version (qmfengine library dll)
  1202.  
  1203. add_library (qmfengine SHARED ${qmfengine_SOURCES})
  1204. target_link_libraries (qmfengine qpidclient)
  1205. set_target_properties (qmfengine PROPERTIES
  1206. VERSION ${qmfengine_version})
  1207. install (TARGETS qmfengine OPTIONAL
  1208. DESTINATION ${QPID_INSTALL_LIBDIR}
  1209. COMPONENT ${QPID_COMPONENT_QMF})
  1210. install_pdb (qmfengine ${QPID_COMPONENT_QMF})
  1211.  
  1212. # QMF console library
  1213. #module_hdr += \
  1214. # qpid/console/Agent.h \
  1215. # qpid/console/Broker.h \
  1216. # qpid/console/ClassKey.h \
  1217. # qpid/console/ConsoleImportExport.h \
  1218. # qpid/console/ConsoleListener.h \
  1219. # qpid/console/Event.h \
  1220. # qpid/console/Object.h \
  1221. # qpid/console/ObjectId.h \
  1222. # qpid/console/Package.h \
  1223. # qpid/console/Schema.h \
  1224. # qpid/console/SequenceManager.h \
  1225. # qpid/console/SessionManager.h \
  1226. # qpid/console/Value.h
  1227. set (qmfconsole_SOURCES
  1228. ../include/qpid/console/Agent.h
  1229. ../include/qpid/console/Broker.h
  1230. ../include/qpid/console/ClassKey.h
  1231. ../include/qpid/console/ConsoleImportExport.h
  1232. ../include/qpid/console/ConsoleListener.h
  1233. ../include/qpid/console/Event.h
  1234. ../include/qpid/console/Object.h
  1235. ../include/qpid/console/ObjectId.h
  1236. ../include/qpid/console/Package.h
  1237. ../include/qpid/console/Schema.h
  1238. ../include/qpid/console/SequenceManager.h
  1239. ../include/qpid/console/SessionManager.h
  1240. ../include/qpid/console/Value.h
  1241. qpid/console/Agent.cpp
  1242. qpid/console/Broker.cpp
  1243. qpid/console/ClassKey.cpp
  1244. qpid/console/Event.cpp
  1245. qpid/console/Object.cpp
  1246. qpid/console/ObjectId.cpp
  1247. qpid/console/Package.cpp
  1248. qpid/console/Schema.cpp
  1249. qpid/console/SequenceManager.cpp
  1250. qpid/console/SessionManager.cpp
  1251. qpid/console/Value.cpp
  1252. )
  1253. add_msvc_version (qmfconsole library dll)
  1254. add_library (qmfconsole SHARED ${qmfconsole_SOURCES})
  1255. target_link_libraries (qmfconsole qpidclient)
  1256. set_target_properties (qmfconsole PROPERTIES
  1257. VERSION ${qpidc_version})
  1258. install (TARGETS qmfconsole
  1259. DESTINATION ${QPID_INSTALL_LIBDIR}
  1260. COMPONENT ${QPID_COMPONENT_QMF})
  1261. install_pdb (qmfconsole ${QPID_COMPONENT_QMF})
  1262.  
  1263. # A queue event listener plugin that creates messages on a replication
  1264. # queue corresponding to enqueue and dequeue events:
  1265. set (replicating_listener_SOURCES
  1266. qpid/replication/constants.h
  1267. qpid/replication/ReplicatingEventListener.cpp
  1268. qpid/replication/ReplicatingEventListener.h
  1269. )
  1270. add_msvc_version (replicating_listener library dll)
  1271. add_library (replicating_listener MODULE ${replicating_listener_SOURCES})
  1272. target_link_libraries (replicating_listener qpidbroker
  1273. ${Boost_SYSTEM_LIBRARY}
  1274. ${Boost_PROGRAM_OPTIONS_LIBRARY})
  1275. set_target_properties (replicating_listener PROPERTIES PREFIX "")
  1276. if (CMAKE_COMPILER_IS_GNUCXX)
  1277. set_target_properties(replicating_listener PROPERTIES
  1278. LINK_FLAGS -Wl,--no-undefined)
  1279. endif (CMAKE_COMPILER_IS_GNUCXX)
  1280. install (TARGETS replicating_listener
  1281. DESTINATION ${QPIDD_MODULE_DIR}
  1282. COMPONENT ${QPID_COMPONENT_BROKER})
  1283.  
  1284. # A custom exchange plugin that allows an exchange to be created that
  1285. # can process the messages from a replication queue (populated on the
  1286. # source system by the replicating listener plugin above) and take the
  1287. # corresponding action on the local queues
  1288. set (replication_exchange_SOURCES
  1289. qpid/replication/constants.h
  1290. qpid/replication/ReplicationExchange.cpp
  1291. qpid/replication/ReplicationExchange.h
  1292. )
  1293. add_msvc_version (replication_exchange library dll)
  1294. add_library (replication_exchange MODULE ${replication_exchange_SOURCES})
  1295. target_link_libraries (replication_exchange qpidbroker)
  1296. set_target_properties (replication_exchange PROPERTIES PREFIX "")
  1297. if (CMAKE_COMPILER_IS_GNUCXX)
  1298. set_target_properties(replication_exchange PROPERTIES
  1299. LINK_FLAGS -Wl,--no-undefined)
  1300. endif (CMAKE_COMPILER_IS_GNUCXX)
  1301. install (TARGETS replication_exchange
  1302. DESTINATION ${QPIDD_MODULE_DIR}
  1303. COMPONENT ${QPID_COMPONENT_BROKER})
  1304.  
  1305. # This is only really needed until all the trunk builds (Linux, UNIX, Windows)
  1306. # are all on cmake only. This is because cmake builds always have a config.h
  1307. # file whereas older builds only have config.h on autoconf-generated builds.
  1308. add_definitions(-DHAVE_CONFIG_H)
  1309.  
  1310. add_definitions(-DBOOST_FILESYSTEM_VERSION=2)
  1311.  
  1312. # Now create the config file from all the info learned above.
  1313. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake
  1314. ${CMAKE_CURRENT_BINARY_DIR}/config.h)
  1315. add_subdirectory(qpid/store)
  1316. add_subdirectory(tests)
Advertisement
Add Comment
Please, Sign In to add comment