From 82b92c6d8fd2ed5f1bff3da74bc9b4f5a79646b4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 9 Dec 2017 18:31:39 +0100 Subject: [PATCH] Update CMake files after switch from CppUnit to Catch Don't look for CppUnit library nor build it any longer, but just use the Catch headers under 3rdparty/catch. --- build/cmake/functions.cmake | 5 +- build/cmake/modules/Findcppunit.cmake | 77 --------------------------- build/cmake/tests/CMakeLists.txt | 75 -------------------------- 3 files changed, 1 insertion(+), 156 deletions(-) delete mode 100644 build/cmake/modules/Findcppunit.cmake diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake index 2fd4af8b1a..ef3f17c9eb 100644 --- a/build/cmake/functions.cmake +++ b/build/cmake/functions.cmake @@ -693,11 +693,8 @@ function(wx_add_test name) list(INSERT test_src 0 "${wxSOURCE_DIR}/tests/dummy.cpp") endif() add_executable(${name} ${test_src}) - target_include_directories(${name} PRIVATE "${wxSOURCE_DIR}/tests" ${CPPUNIT_INCLUDE_DIR}) + target_include_directories(${name} PRIVATE "${wxSOURCE_DIR}/tests" "${wxSOURCE_DIR}/3rdparty/catch/include") wx_exe_link_libraries(${name} base net) - target_link_libraries(${name} - ${CPPUNIT_LIBRARIES} - ) if(wxBUILD_SHARED) target_compile_definitions(${name} PRIVATE WXUSINGDLL) endif() diff --git a/build/cmake/modules/Findcppunit.cmake b/build/cmake/modules/Findcppunit.cmake deleted file mode 100644 index 1d47a91844..0000000000 --- a/build/cmake/modules/Findcppunit.cmake +++ /dev/null @@ -1,77 +0,0 @@ -# - try to find cppunit library -# -# Cache Variables: (probably not for direct use in your scripts) -# CPPUNIT_INCLUDE_DIR -# CPPUNIT_LIBRARY -# -# Non-cache variables you might use in your CMakeLists.txt: -# CPPUNIT_FOUND -# CPPUNIT_INCLUDE_DIRS -# CPPUNIT_LIBRARIES -# -# Requires these CMake modules: -# SelectLibraryConfigurations (included with CMake >= 2.8.0) -# FindPackageHandleStandardArgs (known included with CMake >=2.6.2) -# -# Original Author: -# 2009-2011 Ryan Pavlik -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2011. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -set(CPPUNIT_ROOT_DIR - "${CPPUNIT_ROOT_DIR}" - CACHE - PATH - "Directory to search") - -find_library(CPPUNIT_LIBRARY_RELEASE - NAMES - cppunit - HINTS - "${CPPUNIT_ROOT_DIR}" - "${CPPUNIT_ROOT_DIR}/lib") - -find_library(CPPUNIT_LIBRARY_DEBUG - NAMES - cppunitd - HINTS - "${CPPUNIT_ROOT_DIR}" - "${CPPUNIT_ROOT_DIR}/lib") - -include(SelectLibraryConfigurations) -select_library_configurations(CPPUNIT) - -# Might want to look close to the library first for the includes. -get_filename_component(_libdir "${CPPUNIT_LIBRARY_RELEASE}" PATH) - -find_path(CPPUNIT_INCLUDE_DIR - NAMES - cppunit/TestCase.h - HINTS - "${_libdir}/.." - PATHS - "${CPPUNIT_ROOT_DIR}" - PATH_SUFFIXES - include/) - - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(cppunit - DEFAULT_MSG - CPPUNIT_LIBRARY - CPPUNIT_INCLUDE_DIR) - -if(CPPUNIT_FOUND) - set(CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARY} ${CMAKE_DL_LIBS}) - set(CPPUNIT_INCLUDE_DIRS "${CPPUNIT_INCLUDE_DIR}") - mark_as_advanced(CPPUNIT_ROOT_DIR) -endif() - -mark_as_advanced(CPPUNIT_INCLUDE_DIR - CPPUNIT_LIBRARY_RELEASE - CPPUNIT_LIBRARY_DEBUG) diff --git a/build/cmake/tests/CMakeLists.txt b/build/cmake/tests/CMakeLists.txt index 5770b7854f..e0f449f9b7 100644 --- a/build/cmake/tests/CMakeLists.txt +++ b/build/cmake/tests/CMakeLists.txt @@ -7,81 +7,6 @@ # Licence: wxWindows licence ############################################################################# -# Find CPPUnit -wx_add_thirdparty_library(wxUSE_CPPUNIT cppunit - "use cppunit (Used for unit tests)" DEFAULT sys) - -if(wxUSE_CPPUNIT STREQUAL "builtin") - # Build our own private copy if it could not be found in the system - message(STATUS "Could not find cppunit. Downloading and building local copy") - set(CPPUNIT_URL http://dev-www.libreoffice.org/src/cppunit-1.13.2.tar.gz) - set(CPPUNIT_MD5 d1c6bdd5a76c66d2c38331e2d287bc01) - add_library(cppunit STATIC IMPORTED) - if(MSVC AND DEFINED CMAKE_VS_MSBUILD_COMMAND) - # Build with VS 2010+ - if(CMAKE_VS_PLATFORM_TOOLSET) - set(build_param_toolset /p:PlatformToolset=${CMAKE_VS_PLATFORM_TOOLSET}) - if(MSVC_VERSION EQUAL 1700) - # VS11 requires an additional parameter to build VS10 project files - set(build_param_toolset ${build_param_toolset} /p:VisualStudioVersion=11.0) - endif() - else() - # Maybe empty with VS10, but that should be fine - # because the vcxproj is VS10 - set(build_param_toolset) - endif() - ExternalProject_Add(cppunitlib - URL ${CPPUNIT_URL} - URL_MD5 ${CPPUNIT_MD5} - CONFIGURE_COMMAND "" - BUILD_IN_SOURCE 1 - BUILD_COMMAND - ${CMAKE_VS_MSBUILD_COMMAND} - src/cppunit/cppunit.vcxproj - /p:Configuration=$ - /p:Platform=${CMAKE_VS_PLATFORM_NAME} - ${build_param_toolset} - INSTALL_COMMAND - ${CMAKE_COMMAND} -E copy /lib/cppunit$<$:d>.lib - COMMAND - ${CMAKE_COMMAND} -E copy_directory /include /include - ) - ExternalProject_Get_Property(cppunitlib INSTALL_DIR) - set_target_properties(cppunit PROPERTIES - IMPORTED_LOCATION "${INSTALL_DIR}/cppunit.lib" - IMPORTED_LOCATION_DEBUG "${INSTALL_DIR}/cppunitd.lib" - ) - elseif(UNIX) - # TODO: forward CC and CCFLAGS - ExternalProject_Add(cppunitlib - URL ${CPPUNIT_URL} - URL_MD5 ${CPPUNIT_MD5} - CONFIGURE_COMMAND /configure - --prefix= - --disable-shared - --disable-doxygen - --disable-html-docs - BUILD_COMMAND make - INSTALL_COMMAND make install - ) - ExternalProject_Get_Property(cppunitlib INSTALL_DIR) - set_target_properties(cppunit PROPERTIES IMPORTED_LOCATION - "${INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}cppunit${CMAKE_STATIC_LIBRARY_SUFFIX}") - else() - set(wxUSE_CPPUNIT OFF) - endif() - - set(CPPUNIT_INCLUDE_DIR "${INSTALL_DIR}/include") - set(CPPUNIT_LIBRARIES cppunit) - add_dependencies(cppunit cppunitlib) -elseif(wxUSE_CPPUNIT) - find_package(cppunit REQUIRED) -endif() - -if(NOT wxUSE_CPPUNIT) - message(FATAL_ERROR "cppunit is required for tests. Please install cppunit or set wxBUILD_TESTS=OFF") -endif() - add_subdirectory(base) # Build GUI tests