IF(NOT VCPKG_TARGET_IS_OSX)
    #message(FATAL_ERROR "${PORT} only builds on OSX")
endif()

## requires AUTOCONF, LIBTOOL and PKCONF
vcpkg_from_gitlab(
    GITLAB_URL https://gitlab.freedesktop.org/xorg
    OUT_SOURCE_PATH SOURCE_PATH
    REPO lib/libxcwm
    REF  ff4c47ac4e22dd561d888ef14de5c92268b4ca78 #head
    SHA512 711611ff8ed7fa192b8c4c1c017bf0e0177e71cc246c80393aa5a3d99c161a3dea6a526499ff0ee24e7c08e98cf0b1b216700f85927616b921be314cb7e0beb8
    HEAD_REF master # branch name
) 
#file(TOUCH ${SOURCE_PATH}/m4/dummy)
set(ENV{ACLOCAL} "aclocal -I \"${CURRENT_INSTALLED_DIR}/share/xorg/aclocal/\"")

vcpkg_configure_make(
    SOURCE_PATH ${SOURCE_PATH}
    AUTOCONFIG
)

vcpkg_install_make()
vcpkg_fixup_pkgconfig()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)

# # Handle copyright
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/${PORT}/")
file(TOUCH "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright") #already installed by xproto

