tester: remove duplicate

parent 1888be98
......@@ -126,17 +126,6 @@ if(ENABLE_TUNNEL)
set(ENABLE_TUNNEL OFF CACHE BOOL "Enable tunnel support" FORCE)
endif()
endif()
if(ENABLE_TESTS)
find_package(CUnit)
if(CUNIT_FOUND)
check_library_exists(${CUNIT_LIBRARIES} "CU_add_suite" "" HAVE_CU_ADD_SUITE)
check_library_exists(${CUNIT_LIBRARIES} "CU_get_suite" "" HAVE_CU_GET_SUITE)
check_library_exists(${CUNIT_LIBRARIES} "CU_curses_run_tests" "" HAVE_CU_CURSES)
else()
message(WARNING "Could not find cunit framework, tests will not be compiled.")
set(ENABLE_TESTS OFF CACHE BOOL "Enable compilation of tests" FORCE)
endif()
endif()
if(ZLIB_FOUND)
set(HAVE_ZLIB 1)
endif()
......@@ -153,9 +142,6 @@ get_filename_component(antlr3c_library_path "${ANTLR3C_LIBRARIES}" PATH)
set(LIBS_PRIVATE "-L${antlr3c_library_path} -lantlr3c")
get_filename_component(bctoolbox_library_path "${BCTOOLBOX_LIBRARIES}" PATH)
set(LIBS_PRIVATE "${LIBS_PRIVATE} -L${bctoolbox_library_path} -lbctoolbox")
if(CUNIT_FOUND)
set(REQUIRES_PRIVATE "${REQUIRES_PRIVATE} cunit")
endif()
if(ZLIB_FOUND)
set(REQUIRES_PRIVATE "${REQUIRES_PRIVATE} z")
endif()
......@@ -179,9 +165,6 @@ include_directories(
if(TUNNEL_FOUND)
include_directories(${TUNNEL_INCLUDE_DIRS})
endif()
if(CUNIT_FOUND)
include_directories(${CUNIT_INCLUDE_DIRS})
endif()
if(ZLIB_FOUND)
include_directories(${ZLIB_INCLUDE_DIRS})
endif()
......
############################################################################
# FindCUnit.txt
# Copyright (C) 2015 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
#
# - Find the CUnit include file and library
#
# CUNIT_FOUND - system has CUnit
# CUNIT_INCLUDE_DIRS - the CUnit include directory
# CUNIT_LIBRARIES - The libraries needed to use CUnit
include(CheckIncludeFile)
include(CheckLibraryExists)
set(_CUNIT_ROOT_PATHS
${CMAKE_INSTALL_PREFIX}
)
find_path(CUNIT_INCLUDE_DIRS
NAMES CUnit/CUnit.h
HINTS _CUNIT_ROOT_PATHS
PATH_SUFFIXES include
)
if(CUNIT_INCLUDE_DIRS)
set(HAVE_CUNIT_CUNIT_H 1)
endif()
find_library(CUNIT_LIBRARIES
NAMES cunit
HINTS ${_CUNIT_ROOT_PATHS}
PATH_SUFFIXES bin lib
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(CUnit
DEFAULT_MSG
CUNIT_INCLUDE_DIRS CUNIT_LIBRARIES
)
mark_as_advanced(CUNIT_INCLUDE_DIRS CUNIT_LIBRARIES)
......@@ -47,8 +47,8 @@ apply_compile_flags(TESTER_SOURCES "CPP" "C")
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
add_library(belle_sip_tester_static STATIC ${TESTER_SOURCES})
target_include_directories(belle_sip_tester_static PUBLIC ${CUNIT_INCLUDE_DIRS})
target_link_libraries(belle_sip_tester_static ${CUNIT_LIBRARIES} bellesip)
target_include_directories(belle_sip_tester_static PUBLIC ${BCTOOLBOX_INCLUDE_DIRS})
target_link_libraries(belle_sip_tester_static ${BCTOOLBOX_LIBRARIES} bellesip)
set(RUNTIME_COMPONENT_SOURCES
belle_sip_tester_windows.cpp
......@@ -80,8 +80,8 @@ else()
if(NOT "${LINK_FLAGS_STR}" STREQUAL "")
set_target_properties(belle_sip_tester PROPERTIES LINK_FLAGS "${LINK_FLAGS_STR}")
endif()
target_include_directories(belle_sip_tester PUBLIC ${CUNIT_INCLUDE_DIRS})
target_link_libraries(belle_sip_tester ${CUNIT_LIBRARIES} bellesip)
target_include_directories(belle_sip_tester PUBLIC ${BCTOOLBOX_INCLUDE_DIRS})
target_link_libraries(belle_sip_tester ${BCTOOLBOX_LIBRARIES} bellesip)
add_test(NAME belle_sip_tester COMMAND belle_sip_tester --verbose)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment