2016-10-28 14:13:50 +08:00
|
|
|
|
2017-06-10 10:34:07 +08:00
|
|
|
if(NOT VCPKG_CRT_LINKAGE STREQUAL "dynamic")
|
|
|
|
message(FATAL_ERROR "PDCurses only supports dynamic CRT linkage")
|
|
|
|
endif()
|
|
|
|
|
2016-10-20 12:29:38 +08:00
|
|
|
include(vcpkg_common_functions)
|
|
|
|
find_program(NMAKE nmake)
|
|
|
|
|
2018-03-22 16:50:38 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO wmcbrine/PDCurses
|
2018-06-02 07:26:55 +08:00
|
|
|
REF 3.6
|
|
|
|
SHA512 1ed34e7eb791c9e00aae60878339e79f6b3af086c45d88d2b59d9b2b4020481ff5a5c21e078e59ae24f2de3b4d412f0240f21a50eb743f7e172c832a7e17ed5e
|
2018-03-22 16:50:38 +08:00
|
|
|
HEAD_REF master
|
2016-10-20 12:29:38 +08:00
|
|
|
)
|
|
|
|
|
2018-03-22 16:50:38 +08:00
|
|
|
file(REMOVE_RECURSE
|
|
|
|
${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}
|
|
|
|
)
|
|
|
|
|
|
|
|
file(GLOB SOURCES ${SOURCE_PATH}/*)
|
|
|
|
|
|
|
|
file(COPY ${SOURCES} DESTINATION ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET})
|
2017-05-23 11:26:56 +08:00
|
|
|
|
2018-03-22 16:50:38 +08:00
|
|
|
set(SOURCE_PATH "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}")
|
2017-05-23 11:26:56 +08:00
|
|
|
|
2018-06-02 07:26:55 +08:00
|
|
|
set(PDC_NMAKE_CMD ${NMAKE} /A -f ${SOURCE_PATH}/wincon/Makefile.vc WIDE=Y UTF8=Y)
|
|
|
|
|
2017-05-23 11:26:56 +08:00
|
|
|
|
2018-06-02 07:26:55 +08:00
|
|
|
set(PDC_NMAKE_CWD ${SOURCE_PATH}/wincon)
|
|
|
|
set(PDC_PDCLIB ${SOURCE_PATH}/wincon/pdcurses)
|
2016-10-28 12:12:52 +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()
|