summaryrefslogtreecommitdiff
path: root/cpp/src/CMakeLists.txt
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2009-04-30 17:16:06 +0000
committerAndrew Stitcher <astitcher@apache.org>2009-04-30 17:16:06 +0000
commit5af5eef7eeff6cb26e34b1755471b4ee621d5edd (patch)
treee4fd03b8f11f7ce932dea958516fd1eb5198d339 /cpp/src/CMakeLists.txt
parentcd5a790dcf32b692cedb82ef5d08549ce9a2d1b6 (diff)
downloadqpid-python-5af5eef7eeff6cb26e34b1755471b4ee621d5edd.tar.gz
Made cmake config more like the autotools version
- By default if it detects a dependency it will build the module that needs it, otherwise it won't - It can be forced to build modules so that automated builds that have required outputs can fail config git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@770330 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/CMakeLists.txt')
-rw-r--r--cpp/src/CMakeLists.txt44
1 files changed, 30 insertions, 14 deletions
diff --git a/cpp/src/CMakeLists.txt b/cpp/src/CMakeLists.txt
index 09a97eeea4..ead289fff4 100644
--- a/cpp/src/CMakeLists.txt
+++ b/cpp/src/CMakeLists.txt
@@ -17,6 +17,12 @@
# under the License.
#
+# Option to require building optional plugins
+foreach (r ${REQUIRE})
+ set(${r}_force ON)
+ message(STATUS "Forcing ${r} to ${${r}_force}")
+endforeach(r)
+
include(CheckFunctionExists)
include(CheckIncludeFileCXX)
include(CheckIncludeFiles)
@@ -159,10 +165,16 @@ else (NOT CLOCK_GETTIME_IN_RT)
endif (NOT CLOCK_GETTIME_IN_RT)
# See if Cyrus SASL is desired and available
-option(QPID_HAS_SASL "Build with Cyrus SASL support" ON)
-if (QPID_HAS_SASL)
- CHECK_LIBRARY_EXISTS (sasl2 sasl_checkpass "" HAVE_SASL2)
- CHECK_INCLUDE_FILES (sasl/sasl.h HAVE_SASL_H)
+CHECK_LIBRARY_EXISTS (sasl2 sasl_checkpass "" HAVE_SASL2)
+CHECK_INCLUDE_FILES (sasl/sasl.h HAVE_SASL_H)
+
+set (sasl_default ${sasl_force})
+if (HAVE_SASL2 AND HAVE_SASL_H)
+ set (sasl_default ON)
+endif (HAVE_SASL2 AND HAVE_SASL_H)
+
+option(BUILD_SASL "Build with Cyrus SASL support" ${sasl_default})
+if (BUILD_SASL)
if (NOT HAVE_SASL2)
message(FATAL_ERROR "Cyrus SASL support requested but libsasl2 not found")
endif (NOT HAVE_SASL2)
@@ -176,21 +188,25 @@ if (QPID_HAS_SASL)
qpid/sys/cyrus/CyrusSecurityLayer.cpp
)
set(qpidcommon_sasl_lib sasl2)
-
-endif (QPID_HAS_SASL)
+endif (BUILD_SASL)
# See if XML Exchange is desired and prerequisites are available
+CHECK_LIBRARY_EXISTS (xerces-c _init "" HAVE_XERCES)
+CHECK_INCLUDE_FILE_CXX (xercesc/framework/MemBufInputSource.hpp HAVE_XERCES_H)
+CHECK_INCLUDE_FILE_CXX (xqilla/xqilla-simple.hpp HAVE_XQILLA_H)
+
+set (xml_default ${xml_force})
if (CMAKE_SYSTEM_NAME STREQUAL Windows)
- set (xml_default OFF)
else (CMAKE_SYSTEM_NAME STREQUAL Windows)
- set (xml_default ON)
+ if (HAVE_XERCES AND HAVE_XERCES_H)
+ if (HAVE_XQILLA_H)
+ set (xml_default ON)
+ endif (HAVE_XQILLA_H)
+ endif (HAVE_XERCES AND HAVE_XERCES_H)
endif (CMAKE_SYSTEM_NAME STREQUAL Windows)
-option(QPID_HAS_XML "Build with XML Exchange" ${xml_default})
-if (QPID_HAS_XML)
- CHECK_LIBRARY_EXISTS (xerces-c _init "" HAVE_XERCES)
- CHECK_INCLUDE_FILE_CXX (xercesc/framework/MemBufInputSource.hpp HAVE_XERCES_H)
- CHECK_INCLUDE_FILE_CXX (xqilla/xqilla-simple.hpp HAVE_XQILLA_H)
+option(BUILD_XML "Build with XML Exchange" ${xml_default})
+if (BUILD_XML)
if (NOT HAVE_XERCES)
message(FATAL_ERROR "XML Exchange support requested but xerces-c library not found")
endif (NOT HAVE_XERCES)
@@ -209,7 +225,7 @@ if (QPID_HAS_XML)
set_target_properties (xml PROPERTIES
PREFIX ""
LINK_FLAGS -Wl,--no-undefined)
-endif (QPID_HAS_XML)
+endif (BUILD_XML)
# Build the ACL plugin
set (acl_SOURCES