最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

windows - CMake '--install' installs wrong configuration - Stack Overflow

programmeradmin3浏览0评论

I've built ONNX Runtime for Windows from scratch by cloning and running the build.bat script. It successfully called down to CMake and compiled and generated a bunch of files into the build/Windows/RelWithDebInfo directory.

Now I want to install the library to my system.

I'm used to the Linux world where there is usually a Makefile and then I can run sudo make install.

I've ran cmake --install . from the RelWithDebInfo directory, but this produced

cmake --install .
-- Install configuration: "Release"
CMake Error at cmake_install.cmake:36 (file):
  file cannot create directory: C:/Program
  Files/onnxruntime/include/onnxruntime.  Maybe need administrative
  privileges.

This is strange because the configuration is wrong. It's not supposed to be "Release" it's supposed to be "RelWithDebInfo."

How to install proper configuration?

I've built ONNX Runtime for Windows from scratch by cloning https://github/microsoft/onnxruntime and running the build.bat script. It successfully called down to CMake and compiled and generated a bunch of files into the build/Windows/RelWithDebInfo directory.

Now I want to install the library to my system.

I'm used to the Linux world where there is usually a Makefile and then I can run sudo make install.

I've ran cmake --install . from the RelWithDebInfo directory, but this produced

cmake --install .
-- Install configuration: "Release"
CMake Error at cmake_install.cmake:36 (file):
  file cannot create directory: C:/Program
  Files/onnxruntime/include/onnxruntime.  Maybe need administrative
  privileges.

This is strange because the configuration is wrong. It's not supposed to be "Release" it's supposed to be "RelWithDebInfo."

How to install proper configuration?

Share Improve this question edited Mar 7 at 7:51 Tsyvarev 66.6k18 gold badges135 silver badges176 bronze badges asked Mar 6 at 3:37 MarkMark 5,5118 gold badges45 silver badges78 bronze badges 1
  • It worked! If you submit your comment as an answer I will accept it. – Mark Commented Mar 6 at 15:51
Add a comment  | 

1 Answer 1

Reset to default 1

You configure the project for Visual Studio generator, which is multi-configuration one. Because of that, it is pretty irrelevant what name has the directory with your build files (build/Windows/RelWithDebInfo): this directory contains build files sufficient for build the project in any configuration (supported by the project).

For install a specific configuration of the project with cmake --install just pass appropriate --config parameter:

  cmake --install . --config RelWithDebInfo
发布评论

评论列表(0)

  1. 暂无评论