2016-10-28 14:13:50 +08:00
|
|
|
|
2016-10-20 12:29:38 +08:00
|
|
|
include(vcpkg_common_functions)
|
2016-10-21 12:32:17 +08:00
|
|
|
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src)
|
2016-10-20 12:29:38 +08:00
|
|
|
find_program(NMAKE nmake)
|
|
|
|
|
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2016-10-21 12:32:17 +08:00
|
|
|
URLS "http://downloads.sourceforge.net/project/pdcurses/pdcurses/3.4/pdcurs34.zip"
|
2016-10-20 12:29:38 +08:00
|
|
|
FILENAME "pdcurs34.zip"
|
2016-10-21 12:32:17 +08:00
|
|
|
SHA512 0b916bfe37517abb80df7313608cc4e1ed7659a41ce82763000dfdfa5b8311ffd439193c74fc84a591f343147212bf1caf89e7db71f1f7e4fa70f534834cb039
|
2016-10-20 12:29:38 +08:00
|
|
|
)
|
|
|
|
vcpkg_extract_source_archive(${ARCHIVE})
|
|
|
|
|
2016-11-16 03:50:38 +08:00
|
|
|
set(PDC_NMAKE_CMD ${NMAKE} /A -f vcpkg.mak WIDE=Y UTF8=Y)
|
2016-10-28 12:12:52 +08:00
|
|
|
set(PDC_NMAKE_CWD ${SOURCE_PATH}/win32)
|
|
|
|
set(PDC_PDCLIB ${SOURCE_PATH}/win32/pdcurses)
|
|
|
|
|
2016-11-16 03:33:02 +08:00
|
|
|
file(READ ${SOURCE_PATH}/win32/vcwin32.mak PDC_MAK)
|
|
|
|
string(REPLACE " -pdb:none" "" PDC_MAK ${PDC_MAK})
|
|
|
|
string(REPLACE "/MACHINE:IX86 " "" PDC_MAK ${PDC_MAK})
|
2016-11-16 03:50:38 +08:00
|
|
|
file(WRITE ${SOURCE_PATH}/win32/vcpkg.mak ${PDC_MAK})
|
2016-11-16 03:33:02 +08:00
|
|
|
|
2016-11-01 00:48:58 +08:00
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
2016-10-28 12:12:52 +08:00
|
|
|
set(PDC_NMAKE_CMD ${PDC_NMAKE_CMD} DLL=Y)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
message(STATUS "Build ${TARGET_TRIPLET}-rel")
|
|
|
|
vcpkg_execute_required_process(
|
|
|
|
COMMAND ${PDC_NMAKE_CMD}
|
|
|
|
WORKING_DIRECTORY ${PDC_NMAKE_CWD}
|
|
|
|
LOGNAME build-${TARGET_TRIPLET}-rel
|
|
|
|
)
|
|
|
|
message(STATUS "Build ${TARGET_TRIPLET}-rel done")
|
2016-11-01 00:48:58 +08:00
|
|
|
|
2016-10-28 12:12:52 +08:00
|
|
|
file (
|
2016-11-01 00:48:58 +08:00
|
|
|
COPY ${PDC_PDCLIB}.lib
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/lib
|
2016-10-28 12:12:52 +08:00
|
|
|
)
|
2016-11-01 00:48:58 +08:00
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
|
|
|
file (
|
|
|
|
COPY ${PDC_PDCLIB}.dll
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/bin
|
|
|
|
)
|
|
|
|
endif()
|
2016-10-28 12:12:52 +08:00
|
|
|
|
|
|
|
message(STATUS "Build ${TARGET_TRIPLET}-dbg")
|
2016-10-20 12:29:38 +08:00
|
|
|
vcpkg_execute_required_process(
|
2016-10-28 12:12:52 +08:00
|
|
|
COMMAND ${PDC_NMAKE_CMD} DEBUG=Y
|
|
|
|
WORKING_DIRECTORY ${PDC_NMAKE_CWD}
|
|
|
|
LOGNAME build-${TARGET_TRIPLET}-dbg
|
|
|
|
)
|
|
|
|
message(STATUS "Build ${TARGET_TRIPLET}-dbg done")
|
2016-11-01 00:48:58 +08:00
|
|
|
|
2016-10-28 12:12:52 +08:00
|
|
|
file (
|
2016-11-01 00:48:58 +08:00
|
|
|
COPY ${PDC_PDCLIB}.lib
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib
|
2016-10-20 12:29:38 +08:00
|
|
|
)
|
2016-11-01 00:48:58 +08:00
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
|
|
|
file (
|
|
|
|
COPY ${PDC_PDCLIB}.dll
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin
|
|
|
|
)
|
|
|
|
endif()
|
2016-10-20 12:29:38 +08:00
|
|
|
|
2016-10-28 12:12:52 +08:00
|
|
|
file(
|
|
|
|
COPY ${SOURCE_PATH}/curses.h ${SOURCE_PATH}/panel.h ${SOURCE_PATH}/term.h
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/include
|
|
|
|
)
|
2016-10-20 12:29:38 +08:00
|
|
|
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/pdcurses RENAME copyright)
|
2016-11-01 00:48:58 +08:00
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|