如何将Windows路径(Boost,MySQL)添加到cmake? [英] How add Windows paths (Boost, MySQL) to cmake ?

查看:209
本文介绍了如何将Windows路径(Boost,MySQL)添加到cmake?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用SOCI的项目必须在Windows和Linux上可编辑。

我有cmake文件。在Linux上我生成了CodeBlocks项目:

cmake -DCMAKE_BUILD_TYPE = Debug -G" CodeBlocks - Unix Makefiles" 。$
在Windows上:

" c:\Program Files\CMake\bin\cmake.exe" -G"Visual Studio 14 2015 Win64" 。

但缺少一些include目录:c:\ boost for Boost和$
c:\Program Files \ Myyy \ MySQL Connector.C 6.1 \ include \
$
当我尝试在生成* .sln之后添加此目录时,项目看不到

这包括目录。

Project with SOCI must be compilable on Windows and on Linux.
I have cmake files. On Linux I generate CodeBlocks project:
cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" .
On Windows:
"c:\Program Files\CMake\bin\cmake.exe" -G "Visual Studio 14 2015 Win64" .
but is lack some include directory: c:\boost for Boost and
c:\Program Files\MySQL\MySQL Connector.C 6.1\include\
When I try add this directories after generating *.sln, project not see
this include directories.

我有附上最小的社会责任示例:
Google Drive minsoci.zip


I have attached minimal SOCI example: Google Drive minsoci.zip

推荐答案

嗨Borneq,

Hi Borneq,

感谢您在这里发帖。

>>在Windows上:

" c:\Program Files \ CMake\bin\cmake.exe" -G"Visual Studio 14 2015 Win64" 。

但是缺少一些包含目录:c:\ boost for Boost和

c:\ Program Files \MySQL \ MySQL Connector.C 6.1 \include \

当我尝试在生成* .sln之后添加此目录时,项目看不到

这包括目录。

包含目录被添加到当前CMakeLists文件的INCLUDE_DIRECTORIES目录属性中。它们还会添加到当前CMakeLists文件中每个目标的INCLUDE_DIRECTORIES目标属性中。目标属性值是
生成器使用的值。

The include directories are added to the INCLUDE_DIRECTORIES directory property for the current CMakeLists file. They are also added to the INCLUDE_DIRECTORIES target property for each target in the current CMakeLists file. The target property values are the ones used by the generators.

有关CMake中更有用的变量,请参阅下面的文档。

For more useful variables in CMake, please refer to this document below.

https://cmake.org/Wiki/CMake_Useful_Variables

希望这可能是你的帮助。

Hope this could be help of you.

最好的问候,

Sera Yu


这篇关于如何将Windows路径(Boost,MySQL)添加到cmake?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆