diff options
| author | ruki <[email protected]> | 2020-09-24 23:53:49 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-09-24 23:53:49 +0800 |
| commit | 4b906d273d9bfb0b51f5f0d16f3dfa0f4f5676a7 (patch) | |
| tree | cca8b864031a4ff5a7e2ac64526d96cef74eab8f | |
| parent | e3659747443021e53a71992710b28c12fb76adc4 (diff) | |
support CMAKE_GENERATOR
| -rw-r--r-- | xmake/modules/package/tools/cmake.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua index 742adcf61..7709eea4f 100644 --- a/xmake/modules/package/tools/cmake.lua +++ b/xmake/modules/package/tools/cmake.lua @@ -384,6 +384,12 @@ function build(package, configs, opt) -- local argv = {"-DCMAKE_INSTALL_PREFIX=" .. path.absolute("install"), "-DCMAKE_INSTALL_LIBDIR=" .. path.absolute("install/lib")} + -- exists $CMAKE_GENERATOR? use it + local cmake_generator_env = os.getenv("CMAKE_GENERATOR") + if not opt.cmake_generator and cmake_generator_env then + opt.cmake_generator = cmake_generator_env + end + -- pass configurations for name, value in pairs(_get_configs(package, configs, opt)) do value = tostring(value):trim() @@ -440,6 +446,12 @@ function install(package, configs, opt) -- local argv = {"-DCMAKE_INSTALL_PREFIX=" .. path.absolute("install"), "-DCMAKE_INSTALL_LIBDIR=" .. path.absolute("install/lib")} + -- exists $CMAKE_GENERATOR? use it + local cmake_generator_env = os.getenv("CMAKE_GENERATOR") + if not opt.cmake_generator and cmake_generator_env then + opt.cmake_generator = cmake_generator_env + end + -- pass configurations for name, value in pairs(_get_configs(package, configs, opt)) do value = tostring(value):trim() |
