2017-05-10 23:54:27 +08:00
include ( vcpkg_common_functions )
2019-10-08 01:35:13 +08:00
if ( NOT VCPKG_TARGET_IS_WINDOWS )
message ( FATAL_ERROR "\n${PORT} does not support your system, only Windows for now. Please open a ticket issue on github.com/microsoft/vcpkg if necessary\n" )
endif ( )
2017-11-30 05:12:11 +08:00
set ( VERSION 1.14.0 )
2019-10-08 01:35:13 +08:00
if ( VCPKG_CRT_LINKAGE STREQUAL static )
set ( STATIC_PATCH "0001-static-crt-linkage.patch" )
endif ( )
2017-05-10 23:54:27 +08:00
vcpkg_download_distfile ( ARCHIVE
2017-11-30 05:12:11 +08:00
U R L S " h t t p : / / d e v - w w w . l i b r e o f f i c e . o r g / s r c / c p p u n i t - $ { V E R S I O N } . t a r . g z "
F I L E N A M E " c p p u n i t - $ { V E R S I O N } . t a r . g z "
S H A 5 1 2 4 e a 1 d a 4 2 3 c 6 f 7 a b 3 7 e 4 1 4 4 6 8 9 f 5 9 3 3 9 6 8 2 9 c e 7 4 d 4 3 8 7 2 d 6 b 1 0 7 0 9 c 1 a d 5 f b d a 4 e e 9 4 5 8 4 2 f 7 e 9 8 0 3 5 9 2 5 2 0 e f 8 1 a c 7 1 3 e 9 5 a 3 f e 1 3 0 2 9 5 b f 0 4 8 c d 3 2 a 6 0 5 d 1 9 5 9 8 8 2 e
2017-05-10 23:54:27 +08:00
)
2017-05-19 11:32:17 +08:00
2019-10-08 01:35:13 +08:00
vcpkg_extract_source_archive_ex (
O U T _ S O U R C E _ P A T H S O U R C E _ P A T H
A R C H I V E $ { A R C H I V E }
P A T C H E S
$ { S T A T I C _ P A T C H }
)
2017-05-10 23:54:27 +08:00
if ( VCPKG_TARGET_ARCHITECTURE MATCHES "x86" )
set ( BUILD_ARCH "Win32" )
set ( OUTPUT_DIR "Win32" )
elseif ( VCPKG_TARGET_ARCHITECTURE MATCHES "x64" )
set ( BUILD_ARCH "x64" )
else ( )
message ( FATAL_ERROR "Unsupported architecture: ${VCPKG_TARGET_ARCHITECTURE}" )
endif ( )
if ( VCPKG_LIBRARY_LINKAGE STREQUAL dynamic )
vcpkg_build_msbuild (
P R O J E C T _ P A T H $ { S O U R C E _ P A T H } / s r c / c p p u n i t / c p p u n i t _ d l l . v c x p r o j
P L A T F O R M $ { B U I L D _ A R C H } )
elseif ( VCPKG_LIBRARY_LINKAGE STREQUAL static )
vcpkg_build_msbuild (
P R O J E C T _ P A T H $ { S O U R C E _ P A T H } / s r c / c p p u n i t / c p p u n i t . v c x p r o j
P L A T F O R M $ { B U I L D _ A R C H } )
endif ( )
file ( COPY ${ SOURCE_PATH } /include/cppunit DESTINATION ${ CURRENT_PACKAGES_DIR } /include FILES_MATCHING PATTERN *.h )
if ( VCPKG_LIBRARY_LINKAGE STREQUAL dynamic )
file ( COPY ${ SOURCE_PATH } /lib/cppunitd_dll.dll DESTINATION ${ CURRENT_PACKAGES_DIR } /debug/bin )
file ( COPY ${ SOURCE_PATH } /lib/cppunitd_dll.lib DESTINATION ${ CURRENT_PACKAGES_DIR } /debug/lib )
file ( COPY ${ SOURCE_PATH } /lib/cppunit_dll.dll DESTINATION ${ CURRENT_PACKAGES_DIR } /bin )
file ( COPY ${ SOURCE_PATH } /lib/cppunit_dll.lib DESTINATION ${ CURRENT_PACKAGES_DIR } /lib )
elseif ( VCPKG_LIBRARY_LINKAGE STREQUAL static )
file ( COPY ${ SOURCE_PATH } /lib/cppunitd.lib DESTINATION ${ CURRENT_PACKAGES_DIR } /debug/lib )
file ( COPY ${ SOURCE_PATH } /lib/cppunit.lib DESTINATION ${ CURRENT_PACKAGES_DIR } /lib )
endif ( )
2019-10-08 01:35:13 +08:00
vcpkg_copy_pdbs ( )
2017-05-10 23:54:27 +08:00
2019-10-08 01:35:13 +08:00
file ( INSTALL ${ SOURCE_PATH } /COPYING DESTINATION ${ CURRENT_PACKAGES_DIR } /share/cppunit RENAME copyright )