vcpkg/scripts/cmake/vcpkg_install_nmake.cmake
Jack·Boos·Yu fdfe770571
[gdal] Update to 3.1.3 (#13449)
* [vcpkg_*_nmake] Add option INSTALL_COMMAND

* [gdal] Update to 3.1.3 and switch to vcpkg_*_nmake on Windows

* [vcpkg_build_make] Add option MAKEFILE

* fix install on windows, fix linux build

* fix options position

* [gdal] Fix linux build

* [gdal] Fix expat library name

* [gdal] Fix geos library name

* [gdal] Fix cmake wrapper

* [pdal] Fix dependency geos

* [pdal] Fix PDALConfig.cmake

* [gdal] Fix dependency cfitsio on *inx

* disable cfitsio temporary

* [gdal] Correct cmake wrapper and usage

* [gdal] Fix tools on windows-static

* Revert a9ac823007975485aacc7e1f3eb4053e295376e1

* Apply suggestions

* [vcpkg_build_nmake] Fix install command

* [vcpkg_build_nmake] Fix install command

* regenerate docs

* [gdal] Update dependency iconv and charset library names

* [gdal] add json-c as a dependency on non-windows

Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
Co-authored-by: Nicole Mazzuca <mazzucan@outlook.com>
2020-11-20 10:29:25 -08:00

95 lines
3.2 KiB
CMake

## # vcpkg_install_nmake
##
## Build and install a msvc makefile project.
##
## ## Usage:
## ```cmake
## vcpkg_install_nmake(
## SOURCE_PATH <${SOURCE_PATH}>
## [NO_DEBUG]
## [TARGET <all>]
## PROJECT_SUBPATH <${SUBPATH}>
## PROJECT_NAME <${MAKEFILE_NAME}>
## [PRERUN_SHELL <${SHELL_PATH}>]
## [PRERUN_SHELL_DEBUG <${SHELL_PATH}>]
## [PRERUN_SHELL_RELEASE <${SHELL_PATH}>]
## [OPTIONS <-DUSE_THIS_IN_ALL_BUILDS=1>...]
## [OPTIONS_RELEASE <-DOPTIMIZE=1>...]
## [OPTIONS_DEBUG <-DDEBUGGABLE=1>...]
## ```
##
## ## Parameters
## ### SOURCE_PATH
## Specifies the directory containing the source files.
## By convention, this is usually set in the portfile as the variable `SOURCE_PATH`.
##
## ### PROJECT_SUBPATH
## Specifies the sub directory containing the `makefile.vc`/`makefile.mak`/`makefile.msvc` or other msvc makefile.
##
## ### PROJECT_NAME
## Specifies the name of msvc makefile name.
## Default is makefile.vc
##
## ### NO_DEBUG
## This port doesn't support debug mode.
##
## ### PRERUN_SHELL
## Script that needs to be called before build
##
## ### PRERUN_SHELL_DEBUG
## Script that needs to be called before debug build
##
## ### PRERUN_SHELL_RELEASE
## Script that needs to be called before release build
##
## ### OPTIONS
## Additional options passed to generate during the generation.
##
## ### OPTIONS_RELEASE
## Additional options passed to generate during the Release generation. These are in addition to `OPTIONS`.
##
## ### OPTIONS_DEBUG
## Additional options passed to generate during the Debug generation. These are in addition to `OPTIONS`.
##
## ## Parameters:
## See [`vcpkg_build_nmake()`](vcpkg_build_nmake.md).
##
## ## Notes:
## This command transparently forwards to [`vcpkg_build_nmake()`](vcpkg_build_nmake.md), adding `ENABLE_INSTALL`
##
## ## Examples
##
## * [tcl](https://github.com/Microsoft/vcpkg/blob/master/ports/tcl/portfile.cmake)
## * [freexl](https://github.com/Microsoft/vcpkg/blob/master/ports/freexl/portfile.cmake)
function(vcpkg_install_nmake)
# parse parameters such that semicolons in options arguments to COMMAND don't get erased
cmake_parse_arguments(PARSE_ARGV 0 _in
"NO_DEBUG"
"SOURCE_PATH;PROJECT_SUBPATH;PROJECT_NAME"
"OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG;PRERUN_SHELL;PRERUN_SHELL_DEBUG;PRERUN_SHELL_RELEASE;TARGET"
)
if (NOT CMAKE_HOST_WIN32)
message(FATAL_ERROR "vcpkg_install_nmake only support windows.")
endif()
if (_in_NO_DEBUG)
set(NO_DEBUG NO_DEBUG)
endif()
if (NOT _in_TARGET)
set(INSTALL_TARGET "all")
else()
set(INSTALL_TARGET "${_in_TARGET}")
endif()
vcpkg_build_nmake(LOGFILE_ROOT ENABLE_INSTALL
${NO_DEBUG}
TARGET "${INSTALL_TARGET}"
SOURCE_PATH ${_in_SOURCE_PATH} PROJECT_SUBPATH ${_in_PROJECT_SUBPATH} PROJECT_NAME ${_in_PROJECT_NAME}
PRERUN_SHELL ${_in_PRERUN_SHELL} PRERUN_SHELL_DEBUG ${_in_PRERUN_SHELL_DEBUG} PRERUN_SHELL_RELEASE ${_in_PRERUN_SHELL_RELEASE}
OPTIONS ${_in_OPTIONS} OPTIONS_RELEASE ${_in_OPTIONS_RELEASE} OPTIONS_DEBUG ${_in_OPTIONS_DEBUG}
)
endfunction()