diff --git a/scripts/ports.cmake b/scripts/ports.cmake index be73209ad..fbe80cc20 100644 --- a/scripts/ports.cmake +++ b/scripts/ports.cmake @@ -39,16 +39,18 @@ macro(debug_message) endmacro() if(CMD MATCHES "^CREATE$") + file(TO_NATIVE_PATH ${VCPKG_ROOT_DIR} NATIVE_VCPKG_ROOT_DIR) + file(TO_NATIVE_PATH ${DOWNLOADS} NATIVE_DOWNLOADS) if(EXISTS ports/${PORT}/portfile.cmake) - message(FATAL_ERROR "Portfile already exists: '${VCPKG_ROOT_DIR}/ports/${PORT}/portfile.cmake'") + message(FATAL_ERROR "Portfile already exists: '${NATIVE_VCPKG_ROOT_DIR}\\ports\\${PORT}\\portfile.cmake'") endif() if(NOT FILENAME) get_filename_component(FILENAME "${URL}" NAME) endif() string(REGEX REPLACE "(\\.(zip|gz|tar|tgz|bz2))+\$" "" ROOT_NAME ${FILENAME}) if(EXISTS ${DOWNLOADS}/${FILENAME}) - message(STATUS "Using pre-downloaded: ${DOWNLOADS}/${FILENAME}") - message(STATUS "If this is not desired, delete the file and ${VCPKG_ROOT_DIR}/ports/${PORT}/portfile.cmake") + message(STATUS "Using pre-downloaded: ${NATIVE_DOWNLOADS}\\${FILENAME}") + message(STATUS "If this is not desired, delete the file and ${NATIVE_VCPKG_ROOT_DIR}\\ports\\${PORT}") else() include(vcpkg_download_distfile) file(DOWNLOAD ${URL} ${DOWNLOADS}/${FILENAME} STATUS error_code) @@ -60,8 +62,12 @@ if(CMD MATCHES "^CREATE$") file(MAKE_DIRECTORY ports/${PORT}) configure_file(scripts/templates/portfile.in.cmake ports/${PORT}/portfile.cmake @ONLY) + configure_file(scripts/templates/CONTROL.in ports/${PORT}/CONTROL @ONLY) - message(STATUS "Generated portfile: ${VCPKG_ROOT_DIR}/ports/${PORT}/portfile.cmake") + message(STATUS "Generated portfile: ${NATIVE_VCPKG_ROOT_DIR}\\ports\\${PORT}\\portfile.cmake") + message(STATUS "Generated CONTROL: ${NATIVE_VCPKG_ROOT_DIR}\\ports\\${PORT}\\CONTROL") + message(STATUS "To launch an editor for these new files, run") + message(STATUS " vcpkg edit ${PORT}") elseif(CMD MATCHES "^BUILD$") if(NOT DEFINED CURRENT_PORT_DIR) message(FATAL_ERROR "CURRENT_PORT_DIR was not defined") diff --git a/scripts/templates/CONTROL.in b/scripts/templates/CONTROL.in new file mode 100644 index 000000000..c5b706861 --- /dev/null +++ b/scripts/templates/CONTROL.in @@ -0,0 +1,3 @@ +Source: @PORT@ +Version: +Description: \ No newline at end of file