aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2018-01-03 20:11:35 -0800
committerRobert Schumacher <roschuma@microsoft.com>2018-01-03 20:11:35 -0800
commit0cf5bd657ef401319fa3ef60846189546a5c7a87 (patch)
tree83f7d662646d5db4f06189f19cf2f913582c5df5 /scripts
parent753a19c618dc4f763c3957a20b2421123c941fdd (diff)
downloadvcpkg-0cf5bd657ef401319fa3ef60846189546a5c7a87.tar.gz
vcpkg-0cf5bd657ef401319fa3ef60846189546a5c7a87.zip
[vcpkg-fixup-cmake-targets] Add TARGET_PATH option
Diffstat (limited to 'scripts')
-rw-r--r--scripts/cmake/vcpkg_build_cmake.cmake12
-rw-r--r--scripts/cmake/vcpkg_fixup_cmake_targets.cmake14
2 files changed, 15 insertions, 11 deletions
diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake
index 548e6cf46..66503f4b8 100644
--- a/scripts/cmake/vcpkg_build_cmake.cmake
+++ b/scripts/cmake/vcpkg_build_cmake.cmake
@@ -38,17 +38,13 @@ function(vcpkg_build_cmake)
if(_VCPKG_CMAKE_GENERATOR MATCHES "Ninja")
set(BUILD_ARGS "-v") # verbose output
- if (_bc_DISABLE_PARALLEL)
- set(NO_PARALLEL_ARG "-j1")
- endif()
+ set(NO_PARALLEL_ARG "-j1")
elseif(_VCPKG_CMAKE_GENERATOR MATCHES "Visual Studio")
set(BUILD_ARGS
"/p:VCPkgLocalAppDataDisabled=true"
"/p:UseIntelMKL=No"
)
- if (NOT _bc_DISABLE_PARALLEL)
- set(PARALLEL_ARG "/m")
- endif()
+ set(PARALLEL_ARG "/m")
elseif(_VCPKG_CMAKE_GENERATOR MATCHES "NMake")
# No options are currently added for nmake builds
else()
@@ -61,6 +57,10 @@ function(vcpkg_build_cmake)
set(TARGET_PARAM)
endif()
+ if(_bc_DISABLE_PARALLEL)
+ set(PARALLEL_ARG ${NO_PARALLEL_ARG})
+ endif()
+
foreach(BUILDTYPE "release" "debug")
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL BUILDTYPE)
if(BUILDTYPE STREQUAL "debug")
diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake
index f86ad0661..fead64d15 100644
--- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake
+++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake
@@ -14,14 +14,18 @@
#
function(vcpkg_fixup_cmake_targets)
- cmake_parse_arguments(_vfct "" "CONFIG_PATH" "" ${ARGN})
+ cmake_parse_arguments(_vfct "" "CONFIG_PATH;TARGET_PATH" "" ${ARGN})
if(_vfct_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "vcpkg_fixup_cmake_targets was passed extra arguments: ${_vfct_UNPARSED_ARGUMENTS}")
endif()
- set(DEBUG_SHARE ${CURRENT_PACKAGES_DIR}/debug/share/${PORT})
- set(RELEASE_SHARE ${CURRENT_PACKAGES_DIR}/share/${PORT})
+ if(NOT _vfct_TARGET_PATH)
+ set(_vfct_TARGET_PATH share/${PORT})
+ endif()
+
+ set(DEBUG_SHARE ${CURRENT_PACKAGES_DIR}/debug/${_vfct_TARGET_PATH})
+ set(RELEASE_SHARE ${CURRENT_PACKAGES_DIR}/${_vfct_TARGET_PATH})
if(_vfct_CONFIG_PATH AND NOT RELEASE_SHARE STREQUAL "${CURRENT_PACKAGES_DIR}/${_vfct_CONFIG_PATH}")
set(DEBUG_CONFIG ${CURRENT_PACKAGES_DIR}/debug/${_vfct_CONFIG_PATH})
@@ -114,7 +118,7 @@ function(vcpkg_fixup_cmake_targets)
string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \"]+\\.exe)" "\${_IMPORT_PREFIX}/tools/${PORT}/\\1" _contents "${_contents}")
string(REPLACE "\${_IMPORT_PREFIX}/lib" "\${_IMPORT_PREFIX}/debug/lib" _contents "${_contents}")
string(REPLACE "\${_IMPORT_PREFIX}/bin" "\${_IMPORT_PREFIX}/debug/bin" _contents "${_contents}")
- file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/${DEBUG_TARGET_NAME} "${_contents}")
+ file(WRITE ${CURRENT_PACKAGES_DIR}/${_vfct_TARGET_PATH}/${DEBUG_TARGET_NAME} "${_contents}")
file(REMOVE ${DEBUG_TARGET})
endforeach()
@@ -148,7 +152,7 @@ function(vcpkg_fixup_cmake_targets)
file(WRITE ${MAIN_CONFIG} "${_contents}")
endforeach()
- # Remove /debug/share/<port>/ if it's empty.
+ # Remove /debug/<target_path>/ if it's empty.
file(GLOB_RECURSE REMAINING_FILES "${DEBUG_SHARE}/*")
if(NOT REMAINING_FILES)
file(REMOVE_RECURSE ${DEBUG_SHARE})