cmake不移动目标安装目录

时间:2019-02-09 16:38:56

标签: cmake

我的项目结构如下

ProjDir
| - CMakeLists.txt
| - SubDir1
| | - CMakeLists.txt
| | - src
| | - inc
| - SubDir2
| | - CMakeLists.txt
| | - src
| | - inc

我在每个子目录中都有目标,并且子目录包含在主CMakeLists.txt中,如下所示。

add_subdirectory(${CMAKE_SOURCE_DIR}/SubDir1)
add_subdirectory(${CMAKE_SOURCE_DIR}/SubDir2)

我的每个子目录中的目标都使用cmake函数install安装。这些命令位于各个子目录的CMakeLists.txt中,并按目标指定(请参见this帖子)。

install(TARGETS exe1 DESTINATION ${CMAKE_INSTALL_PREFIX}/bin CONFIGURATIONS Release)

虽然我能够成功编译,但是install命令不会将二进制文件移至${CMAKE_INSTALL_PREFIX}/bin,而是在生成输出后完成:

Install the project...
-- Install configuration: ""

我该如何解决?

1 个答案:

答案 0 :(得分:1)

在Linux上,默认的构建配置为:既没有调试,也没有发布等。可以从CMake输出中轻松找到它:

install

由于您的Release命令已使用from selenium import webdriver from selenium.webdriver.chrome.options import Options options = Options() options.add_argument("user-data-dir=C:\\Users\\me\\AppData\\Local\\Google\\Chrome\\User Data\\Profile 19") driver = webdriver.Chrome(executable_path=r'path\to\chromedriver.exe', options = options) 配置进行了“标记”,因此默认情况下不会触发(使用 empty 配置)。

相关问题