Link tests against maxutils

The tests now link against the maxutils libraries. Currently, the maxutils
libraries consist of only the maxbase library.
This commit is contained in:
Markus Mäkelä 2018-06-19 14:39:04 +03:00
parent 7254a7c525
commit be853a448c
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
2 changed files with 12 additions and 2 deletions

View File

@ -31,6 +31,7 @@ enable_testing()
include(utilities.cmake)
include_directories(${CMAKE_SOURCE_DIR})
include_directories(${MAXUTILS_INCLUDE_DIR})
# The core library
include_directories(${CMAKE_BINARY_DIR})
@ -41,9 +42,9 @@ add_library(testcore SHARED testconnections.cpp nodes.cpp mariadb_nodes.cpp maxs
blob_test.cpp keepalived_func.cpp tcp_connection.cpp base/stopwatch.cpp
# Include the CDC connector in the core library
${CMAKE_SOURCE_DIR}/../connectors/cdc-connector/cdc_connector.cpp)
target_link_libraries(testcore ${MYSQL_CLIENT} ${JANSSON_LIBRARIES} z m pthread ssl dl rt crypto crypt)
target_link_libraries(testcore ${MYSQL_CLIENT} ${JANSSON_LIBRARIES} ${MAXUTILS_LIBRARIES} z m pthread ssl dl rt crypto crypt)
install(TARGETS testcore DESTINATION system-test)
add_dependencies(testcore connector-c jansson)
add_dependencies(testcore connector-c jansson maxutils)
# Include the CDC connector headers
include_directories(${CMAKE_SOURCE_DIR}/../connectors/cdc-connector/)

View File

@ -147,3 +147,12 @@ set(JANSSON_STATIC_FOUND TRUE CACHE INTERNAL "")
set(JANSSON_INCLUDE_DIR ${CMAKE_BINARY_DIR}/jansson/install/include CACHE INTERNAL "")
set(JANSSON_STATIC_LIBRARIES ${CMAKE_BINARY_DIR}/jansson/install/lib/libjansson.a CACHE INTERNAL "")
set(JANSSON_LIBRARIES ${JANSSON_STATIC_LIBRARIES} CACHE INTERNAL "")
# Build the maxutils library
ExternalProject_Add(maxutils
SOURCE_DIR ${CMAKE_SOURCE_DIR}/../maxutils/
BINARY_DIR ${CMAKE_BINARY_DIR}/maxutils
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/maxutils/install)
set(MAXUTILS_INCLUDE_DIR ${CMAKE_BINARY_DIR}/maxutils/install/include CACHE INTERNAL "")
set(MAXUTILS_LIBRARIES ${CMAKE_BINARY_DIR}/maxutils/install/lib/libmaxbase.a CACHE INTERNAL "")