summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2009-07-02 05:46:42 +0000
committerAndrew Stitcher <astitcher@apache.org>2009-07-02 05:46:42 +0000
commitb9c16c0f118317871454fde5ee703c157d88e660 (patch)
tree81a0fed2175e7c72548e1685b953075db094ceb3
parent155482f43f33c6aa5bd44e8ebd767017433d8988 (diff)
downloadqpid-python-b9c16c0f118317871454fde5ee703c157d88e660.tar.gz
Fix cmake build for recent gnu ld which needs all libs used by prog and
dependencies linked into prog, also fix for older versions of cmake with more limited boost support. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@790464 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/cpp/examples/CMakeLists.txt8
-rw-r--r--qpid/cpp/src/CMakeLists.txt29
-rw-r--r--qpid/cpp/src/ssl.cmake2
3 files changed, 32 insertions, 7 deletions
diff --git a/qpid/cpp/examples/CMakeLists.txt b/qpid/cpp/examples/CMakeLists.txt
index 73931101bc..bfc7e7389d 100644
--- a/qpid/cpp/examples/CMakeLists.txt
+++ b/qpid/cpp/examples/CMakeLists.txt
@@ -42,9 +42,13 @@ macro(add_example subdir example)
add_executable(${subdir}_${example} ${example}.cpp)
set_target_properties(${subdir}_${example} PROPERTIES OUTPUT_NAME ${example})
if (${ARGC} GREATER 2)
- target_link_libraries(${subdir}_${example} ${ARGN} qpidclient)
+ target_link_libraries(${subdir}_${example} ${ARGN} qpidclient
+ ${Boost_PROGRAM_OPTIONS_LIBRARY}
+ ${Boost_FILESYSTEM_LIBRARY})
else (${ARGC} GREATER 2)
- target_link_libraries(${subdir}_${example} qpidclient)
+ target_link_libraries(${subdir}_${example} qpidclient
+ ${Boost_PROGRAM_OPTIONS_LIBRARY}
+ ${Boost_FILESYSTEM_LIBRARY})
endif (${ARGC} GREATER 2)
endmacro(add_example)
diff --git a/qpid/cpp/src/CMakeLists.txt b/qpid/cpp/src/CMakeLists.txt
index f34441b532..1ce2411e26 100644
--- a/qpid/cpp/src/CMakeLists.txt
+++ b/qpid/cpp/src/CMakeLists.txt
@@ -32,7 +32,7 @@ include(CheckSymbolExists)
include(FindBoost)
include(FindDoxygen)
-#set (CMAKE_VERBOSE_MAKEFILE ON) # for dubugging
+#set (CMAKE_VERBOSE_MAKEFILE ON) # for debugging
# check if we generate source as part of the build
# - rubygen generates the amqp spec and clustering
@@ -146,13 +146,33 @@ if (ENABLE_WARNINGS AND CMAKE_COMPILER_IS_GNUCXX)
endif (ENABLE_WARNINGS AND CMAKE_COMPILER_IS_GNUCXX)
# Expand a bit from the basic Find_Boost; be specific about what's needed.
+# TODO: Not all these libs are needed everywhere:
+# Linux only uses filesystem program_options unit_test_framework (which itself uses regex)
find_package(Boost 1.33 REQUIRED
- COMPONENTS date_time filesystem program_options thread
+ COMPONENTS filesystem program_options date_time thread
regex unit_test_framework)
if(NOT Boost_FOUND)
message(FATAL_ERROR "Boost C++ libraries not found. Please install or try setting BOOST_ROOT")
endif(NOT Boost_FOUND)
+# Versions of cmake pre 2.6 don“t set the Boost_*_LIBRARY variables correctly
+# these values are correct for Linux
+if (NOT Boost_PROGRAM_OPTIONS_LIBRARY)
+ set(Boost_PROGRAM_OPTIONS_LIBRARY boost_program_options)
+endif (NOT Boost_PROGRAM_OPTIONS_LIBRARY)
+
+if (NOT Boost_FILESYSTEM_LIBRARY)
+ set(Boost_FILESYSTEM_LIBRARY boost_filesystem)
+endif (NOT Boost_FILESYSTEM_LIBRARY)
+
+if (NOT Boost_UNIT_TEST_FRAMEWORK_LIBRARY)
+ set(Boost_UNIT_TEST_FRAMEWORK_LIBRARY boost_unit_test_framework)
+endif (NOT Boost_UNIT_TEST_FRAMEWORK_LIBRARY)
+
+if (NOT Boost_REGEX_LIBRARY)
+ set(Boost_REGEX_LIBRARY boost_regex)
+endif (NOT Boost_REGEX_LIBRARY)
+
include_directories( ${Boost_INCLUDE_DIR} )
include_directories( . )
@@ -569,7 +589,8 @@ set (qpidd_SOURCES
qpidd.h
)
add_executable (qpidd ${qpidd_SOURCES})
-target_link_libraries (qpidd qpidbroker qpidcommon)
+target_link_libraries (qpidd qpidbroker qpidcommon ${Boost_PROGRAM_OPTIONS_LIBRARY}
+ ${Boost_FILESYSTEM_LIBRARY})
# QMF agent library
#module_hdr += \
@@ -654,7 +675,7 @@ add_library (replicating_listener MODULE
qpid/replication/ReplicatingEventListener.cpp
qpid/replication/ReplicatingEventListener.h
)
-target_link_libraries (replicating_listener qpidbroker)
+target_link_libraries (replicating_listener qpidbroker ${Boost_PROGRAM_OPTIONS_LIBRARY})
set_target_properties (replicating_listener PROPERTIES
PREFIX "")
if (CMAKE_COMPILER_IS_GNUCXX)
diff --git a/qpid/cpp/src/ssl.cmake b/qpid/cpp/src/ssl.cmake
index 48b53dad3b..278373cb2a 100644
--- a/qpid/cpp/src/ssl.cmake
+++ b/qpid/cpp/src/ssl.cmake
@@ -76,7 +76,7 @@ if (BUILD_SSL)
qpid/sys/ssl/SslHandler.cpp
)
add_library (ssl MODULE ${ssl_SOURCES})
- target_link_libraries (ssl qpidbroker sslcommon)
+ target_link_libraries (ssl qpidbroker sslcommon ${Boost_PROGRAM_OPTIONS_LIBRARY})
set_target_properties (ssl PROPERTIES
PREFIX ""
COMPILE_FLAGS ${NSS_COMPILE_FLAGS})