diff options
author | Andrew Stitcher <astitcher@apache.org> | 2009-05-14 15:19:56 +0000 |
---|---|---|
committer | Andrew Stitcher <astitcher@apache.org> | 2009-05-14 15:19:56 +0000 |
commit | a05dff2847b981cda1f584398f46cbc790afec4f (patch) | |
tree | e0ef23ecc71ea5cd19f8201e549b3efbe1834aca | |
parent | 70c71154f9daa923734c473cc6966cdcbb01408f (diff) | |
download | qpid-python-a05dff2847b981cda1f584398f46cbc790afec4f.tar.gz |
More work on cmake:
Make tests build on Linux
Fix XML tests to run
Fix cmake installed locations for modules/config files
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@774814 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/cpp/src/CMakeLists.txt | 15 | ||||
-rw-r--r-- | qpid/cpp/src/tests/CMakeLists.txt | 18 | ||||
-rw-r--r-- | qpid/cpp/src/tests/XmlClientSessionTest.cpp | 6 |
3 files changed, 27 insertions, 12 deletions
diff --git a/qpid/cpp/src/CMakeLists.txt b/qpid/cpp/src/CMakeLists.txt index cc2b020bd1..a4affcf010 100644 --- a/qpid/cpp/src/CMakeLists.txt +++ b/qpid/cpp/src/CMakeLists.txt @@ -118,13 +118,17 @@ if (ENABLE_VALGRIND AND NOT VALGRIND) message(STATUS "Can't locate the valgrind command; no run-time error detection") endif (ENABLE_VALGRIND AND NOT VALGRIND) -set(QPIDC_MODULE_DIR "." CACHE STRING +set(QPIDC_INSTALL_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib CACHE STRING + "Directory to install library files") +set(QPIDC_INSTALL_CONFDIR ${CMAKE_INSTALL_PREFIX}/etc CACHE STRING + "Directory to install configuration files") +set(QPIDC_MODULE_DIR ${QPIDC_INSTALL_LIBDIR}/qpid/client CACHE STRING "Directory to load client plug-in modules from") -set(QPIDD_MODULE_DIR "." CACHE STRING +set(QPIDD_MODULE_DIR ${QPIDC_INSTALL_LIBDIR}/qpid/daemon CACHE STRING "Directory to load broker plug-in modules from") -set(QPIDC_CONF_FILE "qpidc.conf" CACHE STRING +set(QPIDC_CONF_FILE ${QPIDC_INSTALL_CONFDIR}/qpid/qpidc.conf CACHE STRING "Name of the Qpid client configuration file") -set(QPIDD_CONF_FILE "qpidd.conf" CACHE STRING +set(QPIDD_CONF_FILE ${QPIDC_INSTALL_CONFDIR}/qpid/qpidd.conf CACHE STRING "Name of the Qpid broker configuration file") option(ENABLE_WARNINGS "Enable lots of compiler warnings (recommended)" ON) @@ -227,6 +231,9 @@ if (BUILD_XML) PREFIX "" LINK_FLAGS -Wl,--no-undefined) endif (CMAKE_COMPILER_IS_GNUCXX) + + set(xml_tests XmlClientSessionTest) + endif (BUILD_XML) # Build the ACL plugin diff --git a/qpid/cpp/src/tests/CMakeLists.txt b/qpid/cpp/src/tests/CMakeLists.txt index da7bb7d89b..a02ecad9cb 100644 --- a/qpid/cpp/src/tests/CMakeLists.txt +++ b/qpid/cpp/src/tests/CMakeLists.txt @@ -17,6 +17,9 @@ # under the License. # +# Make sure that everything get built before the tests +# Need to create a var with all the necessary top level targets + add_definitions(-DBOOST_TEST_DYN_LINK) include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ) @@ -30,7 +33,10 @@ if (MSVC) add_definitions( /wd4275 /wd4503 ) endif (MSVC) -set (qpid_test_boost_libs ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_REGEX_LIBRARY}) +# Like this to work with cmake 2.4 on Unix +set (qpid_test_boost_libs + boost_regex + boost_unit_test_framework) # # Unit test program @@ -40,7 +46,6 @@ set (qpid_test_boost_libs ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_REGEX_LIBRARY # ccmake and set unit_tests_to_build to the set you want to build. set(unit_tests_to_build - unit_test exception_test RefCounted SessionState @@ -89,11 +94,10 @@ set(unit_tests_to_build ReplicationTest ClientMessageTest PollableCondition + ${xml_tests} CACHE STRING "Which unit tests to build" ) -if (QPID_HAS_XML) - set(unit_tests_to_build ${unit_tests_to_build} XmlClientSessionTest) -endif (QPID_HAS_XML) + mark_as_advanced(unit_tests_to_build) # Disabled till we move to amqp_0_10 codec. @@ -103,11 +107,11 @@ mark_as_advanced(unit_tests_to_build) # amqp_0_10/Map.cpp \ # amqp_0_10/handlers.cpp -add_executable (unit_test ${unit_tests_to_build}) +add_executable (unit_test unit_test ${unit_tests_to_build}) # The generally recommended way to add macro settings is to use # COMPILE_DEFINITIONS, but it's a rough go to add more than one definition # with a value; in this case, assuming that -D works everywhere is easier. -set_source_files_properties (ReplicationTest.cpp Shlib.cpp +set_source_files_properties (ReplicationTest.cpp Shlib.cpp ${xml_tests} PROPERTIES COMPILE_FLAGS "-DQPID_MODULE_SUFFIX=\\\"${CMAKE_SHARED_MODULE_SUFFIX}\\\" -DQPID_MODULE_PREFIX=\\\"${CMAKE_SHARED_MODULE_PREFIX}\\\"") diff --git a/qpid/cpp/src/tests/XmlClientSessionTest.cpp b/qpid/cpp/src/tests/XmlClientSessionTest.cpp index aeb13c292f..b6b8520bd8 100644 --- a/qpid/cpp/src/tests/XmlClientSessionTest.cpp +++ b/qpid/cpp/src/tests/XmlClientSessionTest.cpp @@ -52,7 +52,11 @@ using std::string; using std::cout; using std::endl; -Shlib shlib("../.libs/xml.so"); +#if defined (QPID_MODULE_SUFFIX) + Shlib shlib("../xml" QPID_MODULE_SUFFIX); +#else + Shlib shlib("../.libs/xml.so"); +#endif class SubscribedLocalQueue : public LocalQueue { private: |