diff options
author | Andrew Stitcher <astitcher@apache.org> | 2012-10-22 06:56:41 +0000 |
---|---|---|
committer | Andrew Stitcher <astitcher@apache.org> | 2012-10-22 06:56:41 +0000 |
commit | 0c95a63008ee6b575e5defe860232e91675802db (patch) | |
tree | d54fb12e95d72d8efec8a6bf1978aeea55adea09 /qpid/cpp | |
parent | 7d437d2c16aee1e8bb5675e3bfc412fed93780bf (diff) | |
download | qpid-python-0c95a63008ee6b575e5defe860232e91675802db.tar.gz |
QPID-3633: Make cmake the primary build tool for the cpp tree
- Make the installed pkgconfig files have the correct paths embedded.
- Use install variables that should be compatible with the variables
set by rpmbuild's %cmake macro
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1400780 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
-rw-r--r-- | qpid/cpp/BuildInstallSettings.cmake | 292 | ||||
-rw-r--r-- | qpid/cpp/CMakeLists.txt | 8 | ||||
-rw-r--r-- | qpid/cpp/docs/api/CMakeLists.txt | 2 | ||||
-rw-r--r-- | qpid/cpp/src/CMakeLists.txt | 29 | ||||
-rw-r--r-- | qpid/cpp/src/Makefile.am | 1 | ||||
-rw-r--r-- | qpid/cpp/src/config.h.cmake | 2 |
6 files changed, 172 insertions, 162 deletions
diff --git a/qpid/cpp/BuildInstallSettings.cmake b/qpid/cpp/BuildInstallSettings.cmake index 3da1d89bfe..4dce28f370 100644 --- a/qpid/cpp/BuildInstallSettings.cmake +++ b/qpid/cpp/BuildInstallSettings.cmake @@ -1,25 +1,25 @@ -#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# Settings related to the Qpid build and install CMake/CTest/CPack procedure.
-# These are used by both the C++ and WCF components.
-
+# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# Settings related to the Qpid build and install CMake/CTest/CPack procedure. +# These are used by both the C++ and WCF components. + # Parse the version from QPID_VERSION.txt. # Use the top level qpid/ file if we're in an SVN checkout, source dir otherwise. if(EXISTS "${PROJECT_SOURCE_DIR}/../QPID_VERSION.txt") @@ -31,121 +31,133 @@ else() endif(EXISTS "${PROJECT_SOURCE_DIR}/../QPID_VERSION.txt") string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\n" "\\1" QPID_VERSION_MAJOR "${QPID_VERSION}") string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\n" "\\2" QPID_VERSION_MINOR "${QPID_VERSION}") -
-# When doing installs, there are a number of components that the item can
-# be associated with. Since there may be different sets of components desired
-# for the various platforms, the component names are defined here. When
-# setting the COMPONENT in an install directive, use these to ensure that
-# the item is installed correctly.
-
-if (WIN32)
- # Install types; these defines the component sets that are installed.
- # Each component (below) indicates which of these install type(s) it is
- # included in. The user can refine the components at install time.
- set (CPACK_ALL_INSTALL_TYPES Broker Development Full)
-
- set (QPID_COMPONENT_COMMON Common)
- set (CPACK_COMPONENT_COMMON_INSTALL_TYPES Broker Development Full)
- set (CPACK_COMPONENT_COMMON_DISPLAY_NAME "Required common runtime items")
- set (CPACK_COMPONENT_COMMON_DESCRIPTION
- "Run-time library common to all runtime components in Qpid.\nThis item is required by both broker and client components.")
-
- set (QPID_COMPONENT_BROKER Broker)
- set (CPACK_COMPONENT_BROKER_DEPENDS Common)
- set (CPACK_COMPONENT_BROKER_INSTALL_TYPES Broker Full)
- set (CPACK_COMPONENT_BROKER_DISPLAY_NAME "Broker")
- set (CPACK_COMPONENT_BROKER_DESCRIPTION
- "Messaging broker; controls message flow within the system.\nAt least one broker is required to run any messaging application.")
-
- set (QPID_COMPONENT_CLIENT Client)
- set (CPACK_COMPONENT_CLIENT_DEPENDS Common)
- set (CPACK_COMPONENT_CLIENT_INSTALL_TYPES Development Full)
- set (CPACK_COMPONENT_CLIENT_DISPLAY_NAME "Client runtime libraries")
- set (CPACK_COMPONENT_CLIENT_DESCRIPTION
- "Runtime library components required to build and execute a client application.")
-
- set (QPID_COMPONENT_CLIENT_INCLUDE ClientInclude)
- set (CPACK_COMPONENT_CLIENTINCLUDE_INSTALL_TYPES Development Full)
- set (CPACK_COMPONENT_CLIENTINCLUDE_DISPLAY_NAME
- "Client programming header files")
- set (CPACK_COMPONENT_CLIENTINCLUDE_DESCRIPTION
- "C++ header files required to build any Qpid messaging application.")
-
- set (QPID_COMPONENT_EXAMPLES Examples)
- set (CPACK_COMPONENT_EXAMPLES_INSTALL_TYPES Development Full)
- set (CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME "C++ Client programming examples")
- set (CPACK_COMPONENT_EXAMPLES_DESCRIPTION
- "Example source code for using the C++ Client.")
-
- set (QPID_COMPONENT_QMF QMF)
- set (CPACK_COMPONENT_QMF_INSTALL_TYPES Development Full)
- set (CPACK_COMPONENT_QMF_DISPLAY_NAME
- "Qpid Management Framework (QMF)")
- set (CPACK_COMPONENT_QMF_DESCRIPTION
- "QMF Agent allows you to embed QMF management in your program.\nQMF Console allows you to build management programs using QMF.")
-
- set (QPID_INSTALL_BINDIR bin CACHE STRING
- "Directory to install user executables")
- set (QPID_INSTALL_CONFDIR conf CACHE STRING
- "Directory to install configuration files")
- set (QPID_INSTALL_SASLDIR conf CACHE STRING
- "Directory to install SASL configuration files")
- set (QPID_INSTALL_DATADIR conf CACHE STRING
- "Directory to install read-only arch.-independent data root")
- set (QPID_INSTALL_EXAMPLESDIR examples CACHE STRING
- "Directory to install programming examples in")
- set (QPID_INSTALL_HTMLDIR docs/api/html CACHE STRING
- "Directory to install HTML documentation")
- set (QPID_INSTALL_INCLUDEDIR include CACHE STRING
- "Directory to install programming header files")
- set (QPID_INSTALL_LIBDIR bin CACHE STRING
- "Directory to install library files")
- set (QPID_INSTALL_SBINDIR bin CACHE STRING
- "Directory to install system admin executables")
- set (QPIDC_MODULE_DIR plugins/client CACHE STRING
- "Directory to load client plug-in modules from")
- set (QPIDD_MODULE_DIR plugins/broker CACHE STRING
- "Directory to load broker plug-in modules from")
-endif (WIN32)
-
-if (UNIX)
- set (QPID_COMPONENT_BROKER runtime)
- set (QPID_COMPONENT_CLIENT runtime)
- set (QPID_COMPONENT_COMMON runtime)
- set (CPACK_COMPONENT_RUNTIME_DISPLAY_NAME
- "Items required to run broker and/or client programs")
- set (QPID_COMPONENT_CLIENT_INCLUDE development)
- set (QPID_COMPONENT_EXAMPLES development)
- set (QPID_COMPONENT_QMF development)
- set (CPACK_COMPONENT_DEVELOPMENT_DISPLAY_NAME
- "Items required to build new C++ Qpid client programs")
-
- set (QPID_INSTALL_BINDIR bin CACHE STRING
- "Directory to install user executables")
- set (QPID_INSTALL_CONFDIR etc/qpid CACHE STRING
- "Directory to install configuration files")
- set (QPID_INSTALL_DATADIR share/qpid CACHE STRING
- "Directory to install read-only arch.-independent data root")
- set (QPID_INSTALL_SASLDIR etc/sasl2 CACHE STRING
- "Directory to install SASL configuration files")
- set (QPID_INSTALL_EXAMPLESDIR share/examples CACHE STRING
- "Directory to install programming examples in")
- set (QPID_INSTALL_HTMLDIR html CACHE STRING
- "Directory to install HTML documentation")
- set (QPID_INSTALL_INCLUDEDIR include CACHE STRING
- "Directory to install programming header files")
- set (QPID_INSTALL_LIBDIR lib CACHE STRING
- "Directory to install library files")
- set (QPID_INSTALL_SBINDIR sbin CACHE STRING
- "Directory to install system admin executables")
- set (QPIDC_MODULE_DIR ${QPID_INSTALL_LIBDIR}/qpid/client CACHE STRING
- "Directory to load client plug-in modules from")
- set (QPIDD_MODULE_DIR ${QPID_INSTALL_LIBDIR}/qpid/daemon CACHE STRING
- "Directory to load broker plug-in modules from")
- set (QPID_LIBEXEC_DIR libexec/qpid CACHE STRING
- "Directory for executables used by qpid libs")
- set (QPID_LOCALSTATE_DIR var CACHE STRING - "Directory to store local state data") - set (QPID_MAN_DIR man CACHE STRING - "Directory to install manual files") -endif (UNIX)
+ +# When doing installs, there are a number of components that the item can +# be associated with. Since there may be different sets of components desired +# for the various platforms, the component names are defined here. When +# setting the COMPONENT in an install directive, use these to ensure that +# the item is installed correctly. + +if (WIN32) + # Install types; these defines the component sets that are installed. + # Each component (below) indicates which of these install type(s) it is + # included in. The user can refine the components at install time. + set (CPACK_ALL_INSTALL_TYPES Broker Development Full) + + set (QPID_COMPONENT_COMMON Common) + set (CPACK_COMPONENT_COMMON_INSTALL_TYPES Broker Development Full) + set (CPACK_COMPONENT_COMMON_DISPLAY_NAME "Required common runtime items") + set (CPACK_COMPONENT_COMMON_DESCRIPTION + "Run-time library common to all runtime components in Qpid.\nThis item is required by both broker and client components.") + + set (QPID_COMPONENT_BROKER Broker) + set (CPACK_COMPONENT_BROKER_DEPENDS Common) + set (CPACK_COMPONENT_BROKER_INSTALL_TYPES Broker Full) + set (CPACK_COMPONENT_BROKER_DISPLAY_NAME "Broker") + set (CPACK_COMPONENT_BROKER_DESCRIPTION + "Messaging broker; controls message flow within the system.\nAt least one broker is required to run any messaging application.") + + set (QPID_COMPONENT_CLIENT Client) + set (CPACK_COMPONENT_CLIENT_DEPENDS Common) + set (CPACK_COMPONENT_CLIENT_INSTALL_TYPES Development Full) + set (CPACK_COMPONENT_CLIENT_DISPLAY_NAME "Client runtime libraries") + set (CPACK_COMPONENT_CLIENT_DESCRIPTION + "Runtime library components required to build and execute a client application.") + + set (QPID_COMPONENT_CLIENT_INCLUDE ClientInclude) + set (CPACK_COMPONENT_CLIENTINCLUDE_INSTALL_TYPES Development Full) + set (CPACK_COMPONENT_CLIENTINCLUDE_DISPLAY_NAME + "Client programming header files") + set (CPACK_COMPONENT_CLIENTINCLUDE_DESCRIPTION + "C++ header files required to build any Qpid messaging application.") + + set (QPID_COMPONENT_EXAMPLES Examples) + set (CPACK_COMPONENT_EXAMPLES_INSTALL_TYPES Development Full) + set (CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME "C++ Client programming examples") + set (CPACK_COMPONENT_EXAMPLES_DESCRIPTION + "Example source code for using the C++ Client.") + + set (QPID_COMPONENT_QMF QMF) + set (CPACK_COMPONENT_QMF_INSTALL_TYPES Development Full) + set (CPACK_COMPONENT_QMF_DISPLAY_NAME + "Qpid Management Framework (QMF)") + set (CPACK_COMPONENT_QMF_DESCRIPTION + "QMF Agent allows you to embed QMF management in your program.\nQMF Console allows you to build management programs using QMF.") + + set (QPID_INSTALL_BINDIR bin CACHE STRING + "Directory to install user executables") + set (QPID_INSTALL_CONFDIR conf CACHE STRING + "Directory to install configuration files") + set (QPID_INSTALL_SASLDIR conf CACHE STRING + "Directory to install SASL configuration files") + set (QPID_INSTALL_DATADIR conf CACHE STRING + "Directory to install read-only arch.-independent data root") + set (QPID_INSTALL_EXAMPLESDIR examples CACHE STRING + "Directory to install programming examples in") + set (QPID_INSTALL_DOCDIR docs CACHE STRING + "Directory to install documentation") + set (QPID_INSTALL_INCLUDEDIR include CACHE STRING + "Directory to install programming header files") + set (QPID_INSTALL_LIBDIR bin CACHE STRING + "Directory to install library files") + set (QPID_INSTALL_SBINDIR bin CACHE STRING + "Directory to install system admin executables") + set (QPIDC_MODULE_DIR plugins/client CACHE STRING + "Directory to load client plug-in modules from") + set (QPIDD_MODULE_DIR plugins/broker CACHE STRING + "Directory to load broker plug-in modules from") +endif (WIN32) + +if (UNIX) +# function to get absolute path from a variable that may be relative to the +# install prefix +function(set_absolute_install_path var input) + if (${input} MATCHES "^/.*") + set (${var} ${input} PARENT_SCOPE) + else () + set (${var} ${CMAKE_INSTALL_PREFIX}/${input} PARENT_SCOPE) + endif () +endfunction(set_absolute_install_path) + +# In rpm builds the build sets some variables: +# CMAKE_INSTALL_PREFIX - this is a standard cmake variable +# INCLUDE_INSTALL_DIR +# LIB_INSTALL_DIR +# SYSCONF_INSTALL_DIR +# SHARE_INSTALL_DIR +# So make these cached variables and the specific variables non cached and +# derived from them. + set (INCLUDE_INSTALL_DIR include CACHE PATH "Include file directory") + set (LIB_INSTALL_DIR lib CACHE PATH "Library object file directory") + set (SYSCONF_INSTALL_DIR etc CACHE PATH "System read only configuration directory") + set (SHARE_INSTALL_DIR share CACHE PATH "Shared read only data directory") + set (DOC_INSTALL_DIR ${SHARE_INSTALL_DIR}/doc/${CMAKE_PROJECT_NAME}-${QPID_VERSION} CACHE PATH "Shared read only data directory") + + set (QPID_COMPONENT_BROKER runtime) + set (QPID_COMPONENT_CLIENT runtime) + set (QPID_COMPONENT_COMMON runtime) + set (CPACK_COMPONENT_RUNTIME_DISPLAY_NAME + "Items required to run broker and/or client programs") + set (QPID_COMPONENT_CLIENT_INCLUDE development) + set (QPID_COMPONENT_EXAMPLES development) + set (QPID_COMPONENT_QMF development) + set (CPACK_COMPONENT_DEVELOPMENT_DISPLAY_NAME + "Items required to build new C++ Qpid client programs") + + # These are always relative to $CMAKE_INSTALL_PREFIX + set (QPID_INSTALL_BINDIR bin) + set (QPID_INSTALL_SBINDIR sbin) + set (QPID_INSTALL_TESTDIR libexec/qpid/tests) # Directory for test executables + set (QPID_INSTALL_CONFDIR ${SYSCONF_INSTALL_DIR}/qpid) + set (QPID_INSTALL_SASLDIR ${SYSCONF_INSTALL_DIR}/sasl2) + set (QPID_INSTALL_DATADIR ${SHARE_INSTALL_DIR}/qpid) + set (QPID_INSTALL_EXAMPLESDIR ${SHARE_INSTALL_DIR}/examples) + set (QPID_INSTALL_DOCDIR ${DOC_INSTALL_DIR}) # Directory to install documentation + set (QPID_INSTALL_INCLUDEDIR ${INCLUDE_INSTALL_DIR}) + set (QPID_INSTALL_LIBDIR ${LIB_INSTALL_DIR}) + set (QPID_LOCALSTATE_DIR var) # Directory to store local state data + set (QPID_MAN_DIR man) # Directory to install manual files + + set_absolute_install_path (QPIDC_MODULE_DIR ${QPID_INSTALL_LIBDIR}/qpid/client) # Directory to load client plug-in modules from + set_absolute_install_path (QPIDD_MODULE_DIR ${QPID_INSTALL_LIBDIR}/qpid/daemon) # Directory to load broker plug-in modules from +endif (UNIX) diff --git a/qpid/cpp/CMakeLists.txt b/qpid/cpp/CMakeLists.txt index ada8f165ee..8609e07da2 100644 --- a/qpid/cpp/CMakeLists.txt +++ b/qpid/cpp/CMakeLists.txt @@ -54,12 +54,14 @@ if (WIN32) set (CPACK_PACKAGE_EXECUTABLES "") endif (WIN32) -set (QPIDC_CONF_FILE ${QPID_INSTALL_CONFDIR}/qpidc.conf CACHE STRING +set_absolute_install_path (QPIDC_CONF_PATH ${QPID_INSTALL_CONFDIR}/qpidc.conf) +set_absolute_install_path (QPIDD_CONF_PATH ${QPID_INSTALL_CONFDIR}/qpidd.conf) +set (QPIDC_CONF_FILE ${QPIDC_CONF_PATH} CACHE STRING "Name of the Qpid client configuration file") -set (QPIDD_CONF_FILE ${QPID_INSTALL_CONFDIR}/qpidd.conf CACHE STRING +set (QPIDD_CONF_FILE ${QPIDD_CONF_PATH} CACHE STRING "Name of the Qpid broker configuration file") -install(FILES LICENSE NOTICE DESTINATION ${CMAKE_INSTALL_PREFIX}) +install(FILES LICENSE NOTICE DESTINATION ${QPID_INSTALL_DOCDIR}) if (WIN32) set (CMAKE_DEBUG_POSTFIX "d") diff --git a/qpid/cpp/docs/api/CMakeLists.txt b/qpid/cpp/docs/api/CMakeLists.txt index 21e6f51caf..27a84ab443 100644 --- a/qpid/cpp/docs/api/CMakeLists.txt +++ b/qpid/cpp/docs/api/CMakeLists.txt @@ -33,7 +33,7 @@ if (GEN_DOXYGEN) # HTML files are generated to ./html - put those in the install. install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ - DESTINATION ${QPID_INSTALL_HTMLDIR} + DESTINATION ${QPID_INSTALL_DOCDIR}/api/html COMPONENT ${QPID_COMPONENT_CLIENT_INCLUDE}) if (CPACK_GENERATOR STREQUAL "NSIS") set (CPACK_NSIS_MENU_LINKS diff --git a/qpid/cpp/src/CMakeLists.txt b/qpid/cpp/src/CMakeLists.txt index a1b1741dc8..ce94c0a318 100644 --- a/qpid/cpp/src/CMakeLists.txt +++ b/qpid/cpp/src/CMakeLists.txt @@ -1474,19 +1474,18 @@ add_subdirectory(qpid/store) add_subdirectory(tests) # Support for pkg-config -if (UNIX) - add_custom_target(pkgconfig ALL echo DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/qpid.pc) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/qpid.pc.in - ${CMAKE_CURRENT_BINARY_DIR}/qpid.pc) - install (FILES ${CMAKE_CURRENT_BINARY_DIR}/qpid.pc - DESTINATION ${QPID_INSTALL_LIBDIR}/pkgconfig - COMPONENT ${QPID_COMPONENT_COMMON}) - - add_dependencies(pkgconfig ${CMAKE_CURRENT_BINARY_DIR}/qmf2.pc) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/qmf2.pc.in - ${CMAKE_CURRENT_BINARY_DIR}/qmf2.pc) - install (FILES ${CMAKE_CURRENT_BINARY_DIR}/qmf2.pc - DESTINATION ${QPID_INSTALL_LIBDIR}/pkgconfig - COMPONENT ${QPID_COMPONENT_COMMON}) -endif (UNIX) +# Compatible variable names used in the pkg config files also for autoconf +set (prefix ${CMAKE_INSTALL_PREFIX}) +set (exec_prefix ${CMAKE_INSTALL_PREFIX}) +set_absolute_install_path (libdir ${LIB_INSTALL_DIR}) +set_absolute_install_path (includedir ${INCLUDE_INSTALL_DIR}) +set (VERSION ${QPID_VERSION}) + +#add_custom_target(pkgconfig ALL echo DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/qpid.pc) +#add_dependencies(pkgconfig ${CMAKE_CURRENT_BINARY_DIR}/qmf2.pc) +configure_file(qpid.pc.in qpid.pc @ONLY) +configure_file(qmf2.pc.in qmf2.pc @ONLY) +install (FILES ${CMAKE_CURRENT_BINARY_DIR}/qpid.pc ${CMAKE_CURRENT_BINARY_DIR}/qmf2.pc + DESTINATION ${LIB_INSTALL_DIR}/pkgconfig + COMPONENT ${QPID_COMPONENT_COMMON}) diff --git a/qpid/cpp/src/Makefile.am b/qpid/cpp/src/Makefile.am index ba2d6a9219..d166e412e2 100644 --- a/qpid/cpp/src/Makefile.am +++ b/qpid/cpp/src/Makefile.am @@ -129,7 +129,6 @@ INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(srcdir) -I=$(bu # Destination for intalled programs and tests defined here # qpidexecdir = $(libexecdir)/qpid -AM_CXXFLAGS += -DQPID_LIBEXEC_DIR=\"$(qpidexecdir)\" qpidexec_PROGRAMS = qpidexec_SCRIPTS = qpidtestdir = $(qpidexecdir)/tests diff --git a/qpid/cpp/src/config.h.cmake b/qpid/cpp/src/config.h.cmake index f55f68afde..5c8c56c749 100644 --- a/qpid/cpp/src/config.h.cmake +++ b/qpid/cpp/src/config.h.cmake @@ -37,8 +37,6 @@ #cmakedefine QPIDC_MODULE_DIR "${QPIDC_MODULE_DIR}" #cmakedefine QPIDD_MODULE_DIR "${QPIDD_MODULE_DIR}" -#cmakedefine QPID_LIBEXEC_DIR "${QPID_LIBEXEC_DIR}" - #define QPID_SHLIB_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}" #define QPID_MODULE_PREFIX #cmakedefine QPID_DEBUG_POSTFIX "${QPID_DEBUG_POSTFIX}" |