early-access version 2853
This commit is contained in:
51
externals/vcpkg/ports/cppunit/CMakeLists.txt
vendored
Executable file
51
externals/vcpkg/ports/cppunit/CMakeLists.txt
vendored
Executable file
@@ -0,0 +1,51 @@
|
||||
project(cppunit)
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
|
||||
set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin"
|
||||
CACHE PATH "Installation directory for executables"
|
||||
)
|
||||
set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib"
|
||||
CACHE PATH "Installation directory for libraries"
|
||||
)
|
||||
set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include"
|
||||
CACHE PATH "Installation directory for headers"
|
||||
)
|
||||
|
||||
file(GLOB CPPUNIT_SRC RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/cppunit/*.cpp")
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
|
||||
set(DLLPLUGINTESTER_SRC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/DllPlugInTester/CommandLineParser.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/DllPlugInTester/DllPlugInTester.cpp
|
||||
)
|
||||
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/DllPlugInTester)
|
||||
|
||||
if(WIN32)
|
||||
set(CMAKE_DEBUG_POSTFIX d)
|
||||
endif()
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
add_library(cppunit SHARED ${CPPUNIT_SRC})
|
||||
add_definitions(-DCPPUNIT_BUILD_DLL)
|
||||
else()
|
||||
add_library(cppunit STATIC ${CPPUNIT_SRC})
|
||||
endif()
|
||||
|
||||
add_executable(DllPlugInTester ${DLLPLUGINTESTER_SRC})
|
||||
target_link_libraries(DllPlugInTester cppunit)
|
||||
|
||||
install(TARGETS cppunit
|
||||
RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
|
||||
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
|
||||
LIBRARY DESTINATION "${INSTALL_LIB_DIR}"
|
||||
)
|
||||
|
||||
install(TARGETS DllPlugInTester
|
||||
RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
|
||||
)
|
||||
|
||||
install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/cppunit"
|
||||
DESTINATION "${INSTALL_INC_DIR}"
|
||||
)
|
83
externals/vcpkg/ports/cppunit/CppUnitConfig.cmake
vendored
Executable file
83
externals/vcpkg/ports/cppunit/CppUnitConfig.cmake
vendored
Executable file
@@ -0,0 +1,83 @@
|
||||
|
||||
include(SelectLibraryConfigurations)
|
||||
|
||||
find_path(CppUnit_INCLUDE_DIR TestCase.h PATH_SUFFIXES cppunit)
|
||||
find_library(CppUnit_LIBRARY_RELEASE NAMES cppunit PATHS "${CMAKE_CURRENT_LIST_DIR}/../../lib" NO_DEFAULT_PATH)
|
||||
find_library(CppUnit_LIBRARY_DEBUG NAMES cppunitd cppunit PATHS "${CMAKE_CURRENT_LIST_DIR}/../../debug/lib" NO_DEFAULT_PATH)
|
||||
select_library_configurations(CppUnit)
|
||||
|
||||
if(NOT CppUnit_LIBRARY)
|
||||
set(CppUnit_FOUND FALSE)
|
||||
set(CPPUNIT_FOUND FALSE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
find_file(CppUnit_LIBRARY_RELEASE_DLL NAMES cppunit.dll PATHS "${CMAKE_CURRENT_LIST_DIR}/../../bin" NO_DEFAULT_PATH)
|
||||
find_file(CppUnit_LIBRARY_DEBUG_DLL NAMES cppunitd.dll PATHS "${CMAKE_CURRENT_LIST_DIR}/../../debug/bin" NO_DEFAULT_PATH)
|
||||
endif()
|
||||
|
||||
# Manage Release Windows shared
|
||||
if(EXISTS "${CppUnit_LIBRARY_RELEASE_DLL}")
|
||||
add_library(CppUnit SHARED IMPORTED)
|
||||
set_target_properties(CppUnit PROPERTIES
|
||||
IMPORTED_CONFIGURATIONS Release
|
||||
IMPORTED_LOCATION_RELEASE "${CppUnit_LIBRARY_RELEASE_DLL}"
|
||||
IMPORTED_IMPLIB_RELEASE "${CppUnit_LIBRARY_RELEASE}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${CppUnit_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
# Manage Debug Windows shared
|
||||
if(EXISTS "${CppUnit_LIBRARY_DEBUG_DLL}")
|
||||
if(EXISTS "${CppUnit_LIBRARY_RELEASE_DLL}")
|
||||
set_target_properties(CppUnit PROPERTIES
|
||||
IMPORTED_CONFIGURATIONS "Release;Debug"
|
||||
IMPORTED_LOCATION_RELEASE "${CppUnit_LIBRARY_RELEASE_DLL}"
|
||||
IMPORTED_IMPLIB_RELEASE "${CppUnit_LIBRARY_RELEASE}"
|
||||
IMPORTED_LOCATION_DEBUG "${CppUnit_LIBRARY_DEBUG_DLL}"
|
||||
IMPORTED_IMPLIB_DEBUG "${CppUnit_LIBRARY_DEBUG}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${CppUnit_INCLUDE_DIR}"
|
||||
)
|
||||
else()
|
||||
add_library(CppUnit SHARED IMPORTED)
|
||||
set_target_properties(CppUnit PROPERTIES
|
||||
IMPORTED_CONFIGURATIONS Debug
|
||||
IMPORTED_LOCATION_DEBUG "${CppUnit_LIBRARY_DEBUG_DLL"
|
||||
IMPORTED_IMPLIB_DEBUG "${CppUnit_LIBRARY_DEBUG}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${CppUnit_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Manage Release Windows static and Linux shared/static
|
||||
if((NOT EXISTS "${CppUnit_LIBRARY_RELEASE_DLL}") AND (EXISTS "${CppUnit_LIBRARY_RELEASE}"))
|
||||
add_library(CppUnit UNKNOWN IMPORTED)
|
||||
set_target_properties(CppUnit PROPERTIES
|
||||
IMPORTED_CONFIGURATIONS Release
|
||||
IMPORTED_LOCATION_RELEASE "${CppUnit_LIBRARY_RELEASE}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${CppUnit_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
# Manage Debug Windows static and Linux shared/static
|
||||
if((NOT EXISTS "${CppUnit_LIBRARY_DEBUG_DLL}") AND (EXISTS "${CppUnit_LIBRARY_DEBUG}"))
|
||||
if(EXISTS "${CppUnit_LIBRARY_RELEASE}")
|
||||
set_target_properties(CppUnit PROPERTIES
|
||||
IMPORTED_CONFIGURATIONS "Release;Debug"
|
||||
IMPORTED_LOCATION_RELEASE "${CppUnit_LIBRARY_RELEASE}"
|
||||
IMPORTED_LOCATION_DEBUG "${CppUnit_LIBRARY_DEBUG}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${CppUnit_INCLUDE_DIR}"
|
||||
)
|
||||
else()
|
||||
add_library(CppUnit UNKNOWN IMPORTED)
|
||||
set_target_properties(CppUnit PROPERTIES
|
||||
IMPORTED_CONFIGURATIONS Debug
|
||||
IMPORTED_LOCATION_DEBUG "${CppUnit_LIBRARY_DEBUG}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${CppUnit_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CppUnit_FOUND TRUE)
|
||||
set(CPPUNIT_FOUND TRUE)
|
62
externals/vcpkg/ports/cppunit/portfile.cmake
vendored
Executable file
62
externals/vcpkg/ports/cppunit/portfile.cmake
vendored
Executable file
@@ -0,0 +1,62 @@
|
||||
vcpkg_download_distfile(ARCHIVE
|
||||
URLS "https://dev-www.libreoffice.org/src/cppunit-1.15.1.tar.gz"
|
||||
FILENAME "cppunit-1.15.1.tar.gz"
|
||||
SHA512 0feb47faec451357bb4c4e287efa17bb60fd3ad966d5350e9f25b414aaab79e94921024b0c0497672f8d3eeb22a599213d2d71d9e1d28b243b3e37f3a9a43691
|
||||
)
|
||||
|
||||
vcpkg_extract_source_archive_ex(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
ARCHIVE "${ARCHIVE}"
|
||||
)
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
# Use a simple CMakeLists.txt to build CppUnit on windows
|
||||
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
|
||||
# Move EXE to 'tools'
|
||||
vcpkg_copy_tools(TOOL_NAMES DllPlugInTester AUTO_CLEAN)
|
||||
else()
|
||||
# Use a configure on unix. It should be doable to use the cmake, but may require some patching
|
||||
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
||||
set(LINKAGE_DYNAMIC yes)
|
||||
set(LINKAGE_STATIC no)
|
||||
else()
|
||||
set(LINKAGE_DYNAMIC no)
|
||||
set(LINKAGE_STATIC yes)
|
||||
endif()
|
||||
|
||||
vcpkg_configure_make(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
AUTOCONFIG
|
||||
OPTIONS
|
||||
"--enable-shared=${LINKAGE_DYNAMIC}"
|
||||
"--enable-static=${LINKAGE_STATIC}"
|
||||
"--prefix=${CURRENT_INSTALLED_DIR}"
|
||||
"--disable-doxygen"
|
||||
OPTIONS_DEBUG
|
||||
"--enable-debug"
|
||||
)
|
||||
|
||||
vcpkg_install_make()
|
||||
endif()
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
# Handle copyright
|
||||
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
|
||||
# Install CppUnitConfig.cmake
|
||||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/CppUnitConfig.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
|
||||
# Cleanup
|
||||
file(REMOVE_RECURSE
|
||||
"${CURRENT_PACKAGES_DIR}/debug/include"
|
||||
"${CURRENT_PACKAGES_DIR}/debug/share"
|
||||
)
|
20
externals/vcpkg/ports/cppunit/vcpkg.json
vendored
Executable file
20
externals/vcpkg/ports/cppunit/vcpkg.json
vendored
Executable file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "cppunit",
|
||||
"version": "1.15.1",
|
||||
"port-version": 3,
|
||||
"description": "Unit testing framework module for the C++ programming language",
|
||||
"homepage": "https://www.freedesktop.org/wiki/Software/cppunit",
|
||||
"supports": "!uwp",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true,
|
||||
"platform": "windows"
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true,
|
||||
"platform": "windows"
|
||||
}
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user