aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-11-25 12:48:07 -0800
committerGitHub <noreply@github.com>2017-11-25 12:48:07 -0800
commita3ea74b9ed174c4682243114e98b4e4d460e1383 (patch)
tree863135ca41bdb1cfb29949a895ff525aec1ca103
parentfec269d594723bf605a1d65b0fb05f869d954906 (diff)
parent89983fe102520c7a063ff349ac824995b1832a97 (diff)
downloadvcpkg-a3ea74b9ed174c4682243114e98b4e4d460e1383.tar.gz
vcpkg-a3ea74b9ed174c4682243114e98b4e4d460e1383.zip
Merge pull request #2250 from AndyM84/master
Adding UnitTest++ Port
-rw-r--r--ports/unittest-cpp/CONTROL3
-rw-r--r--ports/unittest-cpp/portfile.cmake29
-rw-r--r--scripts/cmake/vcpkg_from_github.cmake10
3 files changed, 37 insertions, 5 deletions
diff --git a/ports/unittest-cpp/CONTROL b/ports/unittest-cpp/CONTROL
new file mode 100644
index 000000000..e24b8b774
--- /dev/null
+++ b/ports/unittest-cpp/CONTROL
@@ -0,0 +1,3 @@
+Source: unittest-cpp
+Version: 2.0.0
+Description: A lightweight unit testing framework for C++
diff --git a/ports/unittest-cpp/portfile.cmake b/ports/unittest-cpp/portfile.cmake
new file mode 100644
index 000000000..2a31852a9
--- /dev/null
+++ b/ports/unittest-cpp/portfile.cmake
@@ -0,0 +1,29 @@
+if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
+ message(STATUS "Warning: Dynamic building not supported by unittest-cpp yet. Building static.")
+ set(VCPKG_LIBRARY_LINKAGE static)
+endif()
+
+include(vcpkg_common_functions)
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO unittest-cpp/unittest-cpp
+ REF v2.0.0
+ SHA512 39318f4ed31534c116679a3257bf1438a6c4b3bef1894dfd40aea934950c6c8197af6a7f61539b8e9ddc67327c9388d7e8a6f8a3e0e966ad26c07554e2429cab
+ HEAD_REF master
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+)
+
+vcpkg_install_cmake()
+
+vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/UnitTest++)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/unittest-cpp ${CURRENT_PACKAGES_DIR}/share/unittest++)
+
+# Handle copyright
+file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/unittest-cpp RENAME copyright)
+
+# Remove duplicate includes
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
diff --git a/scripts/cmake/vcpkg_from_github.cmake b/scripts/cmake/vcpkg_from_github.cmake
index 5730ce39a..b71ab3838 100644
--- a/scripts/cmake/vcpkg_from_github.cmake
+++ b/scripts/cmake/vcpkg_from_github.cmake
@@ -54,19 +54,19 @@ function(vcpkg_from_github)
set(multipleValuesArgs)
cmake_parse_arguments(_vdud "" "${oneValueArgs}" "${multipleValuesArgs}" ${ARGN})
- if(NOT _vdud_OUT_SOURCE_PATH)
+ if(NOT DEFINED _vdud_OUT_SOURCE_PATH)
message(FATAL_ERROR "OUT_SOURCE_PATH must be specified.")
endif()
- if((_vdud_REF AND NOT _vdud_SHA512) OR (NOT _vdud_REF AND _vdud_SHA512))
+ if((DEFINED _vdud_REF AND NOT DEFINED _vdud_SHA512) OR (NOT DEFINED _vdud_REF AND DEFINED _vdud_SHA512))
message(FATAL_ERROR "SHA512 must be specified if REF is specified.")
endif()
- if(NOT _vdud_REPO)
+ if(NOT DEFINED _vdud_REPO)
message(FATAL_ERROR "The GitHub repository must be specified.")
endif()
- if(NOT _vdud_REF AND NOT _vdud_HEAD_REF)
+ if(NOT DEFINED _vdud_REF AND NOT DEFINED _vdud_HEAD_REF)
message(FATAL_ERROR "At least one of REF and HEAD_REF must be specified.")
endif()
@@ -90,7 +90,7 @@ function(vcpkg_from_github)
endif()
endmacro()
- if(VCPKG_USE_HEAD_VERSION AND NOT _vdud_HEAD_REF)
+ if(VCPKG_USE_HEAD_VERSION AND NOT DEFINED _vdud_HEAD_REF)
message(STATUS "Package does not specify HEAD_REF. Falling back to non-HEAD version.")
set(VCPKG_USE_HEAD_VERSION OFF)
endif()