aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2016-09-30 17:09:17 -0700
committerRobert Schumacher <roschuma@microsoft.com>2016-09-30 17:09:17 -0700
commit241ca8cd17929d53a5c10c4f366f6972d865ba4f (patch)
tree8cb34bbee67acd08742eb7f4dbf92f74e438ccc4
parentcddc4f612ee605788928dafcb6366c6478fdb401 (diff)
downloadvcpkg-241ca8cd17929d53a5c10c4f366f6972d865ba4f.tar.gz
vcpkg-241ca8cd17929d53a5c10c4f366f6972d865ba4f.zip
[vcpkg] Improve create command to generate initial CONTROL file
-rw-r--r--scripts/ports.cmake14
-rw-r--r--scripts/templates/CONTROL.in3
2 files changed, 13 insertions, 4 deletions
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