diff --git a/CMakeLists.txt b/CMakeLists.txt index e21a14d5e..6656c87d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.6) - +message(STATUS "CMake version: ${CMAKE_VERSION}") include(macros.cmake) enable_testing() diff --git a/query_classifier/test/canonical_tests/CMakeLists.txt b/query_classifier/test/canonical_tests/CMakeLists.txt index 4777fad8d..26bc64602 100644 --- a/query_classifier/test/canonical_tests/CMakeLists.txt +++ b/query_classifier/test/canonical_tests/CMakeLists.txt @@ -1,6 +1,11 @@ -file(COPY ${ERRMSG} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) if(${ERRMSG} MATCHES "ERRMSG-NOTFOUND") message(FATAL_ERROR "The errmsg.sys file was not found, please define the path with -DERRMSG=") +else() + if(${CMAKE_VERSION} VERSION_LESS 2.8) + execute_process(COMMAND cp ${ERRMSG} ${CMAKE_CURRENT_BINARY_DIR}) + else() + file(COPY ${ERRMSG} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) + endif() endif() add_executable(canonizer canonizer.c) target_link_libraries(canonizer pthread query_classifier z dl ssl aio crypt crypto rt m ${EMBEDDED_LIB} fullcore stdc++) diff --git a/server/modules/routing/readwritesplit/test/CMakeLists.txt b/server/modules/routing/readwritesplit/test/CMakeLists.txt index b2012e789..1cd40be63 100644 --- a/server/modules/routing/readwritesplit/test/CMakeLists.txt +++ b/server/modules/routing/readwritesplit/test/CMakeLists.txt @@ -1,3 +1,2 @@ add_test(NAME ReadWriteSplitTest COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/rwsplit.sh testrwsplit.log ${TEST_HOST} ${TEST_PORT_RW} ${TEST_MASTER_ID} ${TEST_USER} ${TEST_PASSWORD} ${CMAKE_CURRENT_SOURCE_DIR}) -set_tests_properties(ReadWriteSplitTest PROPERTIES DEPENDS RunExecutable) add_subdirectory(test_hints) \ No newline at end of file diff --git a/server/test/CMakeLists.txt b/server/test/CMakeLists.txt index 22e4c1b4d..47eb22199 100644 --- a/server/test/CMakeLists.txt +++ b/server/test/CMakeLists.txt @@ -1,7 +1,3 @@ -file(COPY MaxScale_test.cnf DESTINATION ${CMAKE_BINARY_DIR}/etc) -file(RENAME ${CMAKE_BINARY_DIR}/etc/MaxScale_test.cnf ${CMAKE_BINARY_DIR}/etc/MaxScale.cnf) -#add_test(NAME RunExecutable COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/startmaxscale.sh "${CMAKE_BINARY_DIR}/bin/" "-c ${CMAKE_BINARY_DIR}") -#set_tests_properties(RunExecutable PROPERTIES TIMEOUT 2) - -#add_test(NAME KillExecutable COMMAND killall -KILL maxscale) -#set_tests_properties(KillExecutable PROPERTIES DEPENDS StackHintTest ) #this needs to be the last test that requires a running maxscale +if(BUILD_TESTS) + install(FILES MaxScale_test.cnf DESTINATION etc RENAME MaxScale.cnf) +endif()