diff --git a/CMakeExternals/CppUnit.cmake b/CMakeExternals/CppUnit.cmake index 7ebf18c970..6fef5798d4 100644 --- a/CMakeExternals/CppUnit.cmake +++ b/CMakeExternals/CppUnit.cmake @@ -1,49 +1,46 @@ #----------------------------------------------------------------------------- # CppUnit #----------------------------------------------------------------------------- # Sanity checks if(DEFINED CppUnit_DIR AND NOT EXISTS ${CppUnit_DIR}) message(FATAL_ERROR "CppUnit_DIR variable is defined but corresponds to non-existing directory") endif() set(proj CppUnit) set(proj_DEPENDENCIES ) set(${proj}_DEPENDS ${proj}) if(NOT DEFINED CppUnit_DIR) set(additional_args ) if(CTEST_USE_LAUNCHERS) list(APPEND additional_args "-DCMAKE_PROJECT_${proj}_INCLUDE:FILEPATH=${CMAKE_ROOT}/Modules/CTestUseLaunchers.cmake" ) endif() ExternalProject_Add(${proj} LIST_SEPARATOR ${sep} - URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/cppunit-1.15.1.tar.gz - URL_MD5 9dc669e6145cadd9674873e24943e6dd - PATCH_COMMAND - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/${proj}config.h.cmake /config/config.h.cmake - COMMAND ${CMAKE_COMMAND} -Dproj=${proj} -Dproj_target:STRING=cppunit -P ${CMAKE_CURRENT_LIST_DIR}/GenerateDefaultCMakeBuildSystem.cmake + GIT_REPOSITORY https://github.com/MITK/CppUnit.git + GIT_TAG v1.15.1-patched CMAKE_GENERATOR ${gen} CMAKE_GENERATOR_PLATFORM ${gen_platform} CMAKE_ARGS ${ep_common_args} ${additional_args} CMAKE_CACHE_ARGS ${ep_common_cache_args} CMAKE_CACHE_DEFAULT_ARGS ${ep_common_cache_default_args} DEPENDS ${proj_DEPENDENCIES} ) set(${proj}_DIR ${ep_prefix}/lib/cmake/CppUnit) mitkFunctionInstallExternalCMakeProject(${proj}) else() mitkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}") endif() diff --git a/CMakeExternals/CppUnitCMakeLists.txt b/CMakeExternals/CppUnitCMakeLists.txt deleted file mode 100644 index 34577fe5f0..0000000000 --- a/CMakeExternals/CppUnitCMakeLists.txt +++ /dev/null @@ -1,223 +0,0 @@ -cmake_minimum_required(VERSION 3.18) - -project(CppUnit) - -set(${PROJECT_NAME}_MAJOR_VERSION 1) -set(${PROJECT_NAME}_MINOR_VERSION 15) -set(${PROJECT_NAME}_PATCH_VERSION 1) -set(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}.${${PROJECT_NAME}_PATCH_VERSION}) - -# Generates include/cppunit/config-auto.h -# This is originally done by autoconf - -include(CheckIncludeFile) -include(CheckIncludeFileCXX) -include(CheckCXXSourceCompiles) -include(CheckCSourceCompiles) -include(CheckLibraryExists) -include(CheckFunctionExists) - -#Not used == not seen in any *.h *.cpp files -#Not used FUNC_STRING_COMPARE_STRING_FIRST - -check_include_file_cxx(sstream CPPUNIT_HAVE_SSTREAM) -check_include_file_cxx(strstream CPPUNIT_HAVE_STRSTREAM) -set (CMAKE_REQUIRED_DEFINITIONS -DHAVE_STRSTREAM=CPPUNIT_HAVE_STRSTREAM) -check_cxx_source_compiles( -"#ifdef HAVE_STRSTREAM -#include -#else -#include -#endif -int main() { - std::ostrstream message; - message << \"Hello\"; - return 0; -}" CPPUNIT_HAVE_CLASS_STRSTREAM) - -check_include_file_cxx(cmath CPPUNIT_HAVE_CMATH) -#Not used, dld library is obsolete anyway HAVE_DLD -#Not used HAVE_DLERROR -check_include_file(dlfcn.h CPPUNIT_HAVE_DLFCN_H) - -check_c_source_compiles( -"#include -int main() { - return finite(3); -}" CPPUNIT_HAVE_FINITE) - -check_c_source_compiles( -"#include -int main() { - return _finite(3); -}" CPPUNIT_HAVE__FINITE) - -check_include_file_cxx(cxxabi.h CPPUNIT_HAVE_GCC_ABI_DEMANGLE) -#Not used HAVE_INTTYPES_H - -check_c_source_compiles( -"#include -int main() { - return isfinite(3); -}" CPPUNIT_HAVE_ISFINITE) - -check_library_exists(dl dlopen "" CPPUNIT_HAVE_LIBDL) -#Not used HAVE_MEMORY_H - -check_cxx_source_compiles( -"namespace Outer { - namespace Inner { - int i = 0; - } -} -using namespace Outer::Inner; -int main() { - return i; -}" CPPUNIT_HAVE_NAMESPACES) - -check_cxx_source_compiles( -"#include -class Base { -public: - Base() {} - virtual int f() { return 0; } -}; -class Derived : public Base { -public: - Derived() {} - virtual int f() { return 1; } -}; -int main() { - Derived d; - Base * ptr = &d; - return typeid(*ptr) == typeid(Derived); -}" CPPUNIT_HAVE_RTTI) - -check_library_exists(dl shl_load "" CPPUNIT_HAVE_SHL_LOAD) - -#Not used HAVE_STDINT_H -#Not used HAVE_STDLIB_H -#Not used HAVE_STRINGS_H -#Not used HAVE_STRING_H -#Not used HAVE_SYS_STAT_H -#Not used HAVE_SYS_TYPES_H -#Not used HAVE_UNISTD_H -#Not used PACKAGE -#Not used PACKAGE_BUGREPORT -#Not used PACKAGE_NAME -#Not used PACKAGE_STRING -#Not used PACKAGE_TARNAME -#Not used PACKAGE_VERSION -#Not used STDC_HEADERS -check_include_file_cxx(typeinfo CPPUNIT_USE_TYPEINFO_NAME) -#CPPUNIT_VERSION ok - -configure_file(config/config.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/include/cppunit/config-auto.h) -## - - -set(cppunit_SRCS - src/cppunit/AdditionalMessage.cpp - src/cppunit/Asserter.cpp - src/cppunit/BriefTestProgressListener.cpp - src/cppunit/CompilerOutputter.cpp - src/cppunit/DefaultProtector.h - src/cppunit/DefaultProtector.cpp - src/cppunit/DynamicLibraryManager.cpp - src/cppunit/DynamicLibraryManagerException.cpp - src/cppunit/Exception.cpp - src/cppunit/Message.cpp - src/cppunit/PlugInManager.cpp - src/cppunit/PlugInParameters.cpp - src/cppunit/Protector.cpp - src/cppunit/ProtectorChain.h - src/cppunit/ProtectorContext.h - src/cppunit/ProtectorChain.cpp - src/cppunit/RepeatedTest.cpp - src/cppunit/ShlDynamicLibraryManager.cpp - src/cppunit/SourceLine.cpp - src/cppunit/StringTools.cpp - src/cppunit/SynchronizedObject.cpp - src/cppunit/Test.cpp - src/cppunit/TestAssert.cpp - src/cppunit/TestCase.cpp - src/cppunit/TestCaseDecorator.cpp - src/cppunit/TestComposite.cpp - src/cppunit/TestDecorator.cpp - src/cppunit/TestFactoryRegistry.cpp - src/cppunit/TestFailure.cpp - src/cppunit/TestLeaf.cpp - src/cppunit/TestNamer.cpp - src/cppunit/TestPath.cpp - src/cppunit/TestPlugInDefaultImpl.cpp - src/cppunit/TestResult.cpp - src/cppunit/TestResultCollector.cpp - src/cppunit/TestRunner.cpp - src/cppunit/TestSetUp.cpp - src/cppunit/TestSuccessListener.cpp - src/cppunit/TestSuite.cpp - src/cppunit/TestSuiteBuilderContext.cpp - src/cppunit/TextOutputter.cpp - src/cppunit/TextTestProgressListener.cpp - src/cppunit/TextTestResult.cpp - src/cppunit/TextTestRunner.cpp - src/cppunit/TypeInfoHelper.cpp - src/cppunit/UnixDynamicLibraryManager.cpp - src/cppunit/Win32DynamicLibraryManager.cpp - src/cppunit/XmlDocument.cpp - src/cppunit/XmlElement.cpp - src/cppunit/XmlOutputter.cpp - src/cppunit/XmlOutputterHook.cpp -) - -add_library(cppunit SHARED ${cppunit_SRCS}) -target_include_directories(cppunit - PUBLIC "$" - "$" -) -target_compile_definitions(cppunit PRIVATE CPPUNIT_BUILD_DLL) - -set_target_properties(cppunit PROPERTIES - VERSION ${${PROJECT_NAME}_VERSION} - SOVERSION ${${PROJECT_NAME}_VERSION} -) - -set(${PROJECT_NAME}_LIBRARIES cppunit) - -# Install support - -install(TARGETS ${${PROJECT_NAME}_LIBRARIES} EXPORT ${PROJECT_NAME}_TARGETS - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - RUNTIME DESTINATION bin -) -install(DIRECTORY include/cppunit - DESTINATION include -) - -# Config files -configure_file( - ${PROJECT_NAME}Config.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake - @ONLY -) -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}ConfigVersion.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake - @ONLY -) - -export(EXPORT ${PROJECT_NAME}_TARGETS - FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake -) - -set(config_package_location lib/cmake/${PROJECT_NAME}) -install(EXPORT ${PROJECT_NAME}_TARGETS - FILE ${PROJECT_NAME}Targets.cmake - DESTINATION ${config_package_location} -) -install(FILES - "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" - DESTINATION ${config_package_location} -) diff --git a/CMakeExternals/CppUnitconfig.h.cmake b/CMakeExternals/CppUnitconfig.h.cmake deleted file mode 100644 index 4d7ba00387..0000000000 --- a/CMakeExternals/CppUnitconfig.h.cmake +++ /dev/null @@ -1,103 +0,0 @@ -/* Inspired by config/config.h.in, config.h.cmake is used by CMake. */ - -/* define if library uses std::string::compare(string,pos,n) */ -//Not used #undef FUNC_STRING_COMPARE_STRING_FIRST - -/* define to 1 if the library defines strstream */ -#cmakedefine01 CPPUNIT_HAVE_CLASS_STRSTREAM - -/* Define to 1 if you have the header file. */ -#cmakedefine01 CPPUNIT_HAVE_CMATH - -/* Define if you have the GNU dld library. */ -//Not used, dld library is obsolete anyway #undef HAVE_DLD - -/* Define to 1 if you have the `dlerror' function. */ -//Not used #undef HAVE_DLERROR - -/* Define to 1 if you have the header file. */ -#cmakedefine01 CPPUNIT_HAVE_DLFCN_H - -/* Define to 1 if you have the `finite' function. */ -#cmakedefine01 CPPUNIT_HAVE_FINITE - -/* Define to 1 if you have the `_finite' function. */ -#cmakedefine01 CPPUNIT_HAVE__FINITE - -/* define to 1 if the compiler supports GCC C ABI name demangling */ -#cmakedefine01 CPPUNIT_HAVE_GCC_ABI_DEMANGLE - -/* Define to 1 if you have the header file. */ -//Not used #undef HAVE_INTTYPES_H - -/* define if compiler has isfinite */ -#cmakedefine CPPUNIT_HAVE_ISFINITE - -/* Define if you have the libdl library or equivalent. */ -#cmakedefine CPPUNIT_HAVE_LIBDL - -/* Define to 1 if you have the header file. */ -//Not used #undef HAVE_MEMORY_H - -/* define to 1 if the compiler implements namespaces */ -#cmakedefine01 CPPUNIT_HAVE_NAMESPACES - -/* define to 1 if the compiler supports Run-Time Type Identification */ -#cmakedefine01 CPPUNIT_HAVE_RTTI - -/* Define if you have the shl_load function. */ -#cmakedefine CPPUNIT_HAVE_SHL_LOAD - -/* define to 1 if the compiler has stringstream */ -#cmakedefine01 CPPUNIT_HAVE_SSTREAM - -/* Define to 1 if you have the header file. */ -//Not used #undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -//Not used #undef HAVE_STDLIB_H - -/* Define to 1 if you have the header file. */ -//Not used #undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -//Not used #undef HAVE_STRING_H - -/* Define to 1 if you have the header file. */ -#cmakedefine01 CPPUNIT_HAVE_STRSTREAM - -/* Define to 1 if you have the header file. */ -//Not used #undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -//Not used #undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -//Not used #undef HAVE_UNISTD_H - -/* Name of package */ -//Not used #undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -//Not used #undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -//Not used #undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -//Not used #undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -//Not used #undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -//Not used #undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -//Not used #undef STDC_HEADERS - -/* Define to 1 to use type_info::name() for class names */ -#cmakedefine01 CPPUNIT_USE_TYPEINFO_NAME - -/* Version number of package */ -#define CPPUNIT_VERSION @CppUnit_VERSION@