aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoratkawa7 <atkawa7@yahoo.com>2017-06-16 15:19:20 -0700
committeratkawa7 <atkawa7@yahoo.com>2017-06-16 15:19:20 -0700
commitbeda0c38321cca1f78dfa5ca4fedc06897e725ee (patch)
tree4cff10784820970b8588e27389822943b5a3f5c4
parente46dd1fd551a17a2900e09f52b8abd02a3758f4f (diff)
downloadvcpkg-beda0c38321cca1f78dfa5ca4fedc06897e725ee.tar.gz
vcpkg-beda0c38321cca1f78dfa5ca4fedc06897e725ee.zip
[cunit] new port required by #1122
-rw-r--r--ports/cunit/CMakeLists.txt42
-rw-r--r--ports/cunit/CONTROL3
-rw-r--r--ports/cunit/portfile.cmake58
3 files changed, 103 insertions, 0 deletions
diff --git a/ports/cunit/CMakeLists.txt b/ports/cunit/CMakeLists.txt
new file mode 100644
index 000000000..0de2e3b30
--- /dev/null
+++ b/ports/cunit/CMakeLists.txt
@@ -0,0 +1,42 @@
+cmake_minimum_required (VERSION 3.8.0)
+project (libcunit C CXX)
+set(CMAKE_CXX_STANDARD 11)
+
+
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+set(HEADERS_DIR "${PROJECT_SOURCE_DIR}/CUnit/Headers")
+set(SOURCES_DIR "${PROJECT_SOURCE_DIR}/CUnit/Sources")
+set(EXAMPLES_DIR "${PROJECT_SOURCE_DIR}/Examples")
+
+configure_file(
+ "${HEADERS_DIR}/CUnit.h.in"
+ "${PROJECT_BINARY_DIR}/CUnit.h"
+)
+include_directories("${PROJECT_BINARY_DIR}")
+include_directories(${HEADERS_DIR})
+include_directories(${EXAMPLES_DIR})
+
+file(GLOB TARGET_SRC
+ "${SOURCES_DIR}/Automated/Automated.c"
+ "${SOURCES_DIR}/Basic/Basic.c"
+ "${SOURCES_DIR}/Console/Console.c"
+ "${SOURCES_DIR}/Framework/CUError.c"
+ "${SOURCES_DIR}/Framework/MyMem.c"
+ "${SOURCES_DIR}/Framework/TestDB.c"
+ "${SOURCES_DIR}/Framework/TestRun.c"
+ "${SOURCES_DIR}/Framework/Util.c"
+)
+
+add_library(libcunit SHARED ${TARGET_SRC})
+
+if (MSVC)
+ add_definitions( "/W3 /D_CRT_SECURE_NO_WARNINGS /wd4005 /wd4996 /nologo /DCU_BUILD_DLL /DCU_DLL" )
+endif()
+
+add_executable(AutomatedTest ${EXAMPLES_DIR}/AutomatedTest/AutomatedTest.c "${EXAMPLES_DIR}/ExampleTests.c")
+add_executable(BasicTest ${EXAMPLES_DIR}/BasicTest/BasicTest.c "${EXAMPLES_DIR}/ExampleTests.c")
+add_executable(ConsoleTest ${EXAMPLES_DIR}/ConsoleTest/ConsoleTest.c "${EXAMPLES_DIR}/ExampleTests.c")
+
+target_link_libraries(AutomatedTest libcunit)
+target_link_libraries(BasicTest libcunit)
+target_link_libraries(ConsoleTest libcunit)
diff --git a/ports/cunit/CONTROL b/ports/cunit/CONTROL
new file mode 100644
index 000000000..6f2b56cf7
--- /dev/null
+++ b/ports/cunit/CONTROL
@@ -0,0 +1,3 @@
+Source: cunit
+Version: 2.1.3
+Description: CUnit is a lightweight system for writing, administering, and running unit tests in C. It provides C programmers a basic testing functionality with a flexible variety of user interfaces
diff --git a/ports/cunit/portfile.cmake b/ports/cunit/portfile.cmake
new file mode 100644
index 000000000..0e1955efa
--- /dev/null
+++ b/ports/cunit/portfile.cmake
@@ -0,0 +1,58 @@
+include(vcpkg_common_functions)
+
+set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/CUnit-2.1-3)
+vcpkg_download_distfile(ARCHIVE
+ URLS "http://downloads.sourceforge.net/project/cunit/CUnit/2.1-3/CUnit-2.1-3.tar.bz2"
+ FILENAME "CUnit-2.1-3.tar.bz2"
+ SHA512 547b417109332446dfab8fda17bf4ccd2da841dc93f824dc90a20635bcf1fb80fb2176500d8a0906940f3f3d3e2f77b2d70a71090c9ab84ad9af43f3582bc487
+)
+vcpkg_extract_source_archive(${ARCHIVE})
+
+vcpkg_execute_required_process(COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt ${SOURCE_PATH}/CMakeLists.txt WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR})
+
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+)
+
+vcpkg_build_cmake()
+
+file(GLOB HEADERS "${SOURCE_PATH}/CUnit/Headers/*.h")
+file(INSTALL ${HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include/cunit)
+file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/cunit RENAME copyright)
+
+
+file(GLOB DLLS
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.dll"
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Release/*.dll"
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*/Release/*.dll"
+)
+file(GLOB LIBS
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.lib"
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Release/*.lib"
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*/Release/*.lib"
+)
+file(GLOB DEBUG_DLLS
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.dll"
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/Debug/*.dll"
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*/Debug/*.dll"
+)
+file(GLOB DEBUG_LIBS
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.lib"
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/Debug/*.lib"
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*/Debug/*.lib"
+)
+
+if(DLLS)
+ file(INSTALL ${DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
+endif()
+file(INSTALL ${LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
+if(DEBUG_DLLS)
+ file(INSTALL ${DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
+endif()
+file(INSTALL ${DEBUG_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
+endif()
+vcpkg_copy_pdbs()