Search …
Get the Software
You can either download binaries or source code archives for the latest stable or previous release or access the current development (aka nightly) distribution through Git. This software may not be exported in violation of any U.S. export laws or regulations. For more information regarding Export Control matters please go to https://www.kitware.com/legal.
Join the mailing list
CMake
success stories
Attend a training course
Buy the book
Purchase support
Latest Release (3.9.2)
The release was packaged with CPack which is included as part of the release. The .sh files are self extracting gziped tar files. To install a .sh file, run it with /bin/sh and follow the directions. The OS-machine.tar.gz files are gziped tar files of the install tree. The OS-machine.tar.Z files are compressed tar files of the install tree. The tar file distributions can be untared in any directory. They are prefixed by the version of
CMake
. For example, the Linux-x86_64 tar file is all under the directory
cmake
–Linux-x86_64. This prefix can be removed as long as the share, bin, man and doc directories are moved relative to each other. To build the source distributions, unpack them with zip or tar and follow the instructions in Readme.txt at the top of the source tree. See also the
CMake
3.9 Release
Notes
. Source distributions:
Platform Files
Unix/Linux Source (has \n line feeds)
cmake
-3.9.2.tar.gz
cmake
-3.9.2.tar.Z
Windows Source (has \r\n line feeds)
cmake
-3.9.2.zip
https://
cmake
.org/files/v3.9/
cmake
-3.9.2.tar.gz
The release was packaged with CPack which is included as part of the release. The .sh files are self extracting gziped tar files. To install a .sh file, run it with /bin/sh and follow the directions. The OS-machine.tar.gz files are gziped tar files of the install tree. The OS-machine.tar.Z files are compressed tar files of the install tree. The tar file distributions can be untared in any directory. They are prefixed by the version of
CMake
. For example, the Linux-x86_64 tar file is all under the directory
cmake
–Linux-x86_64. This prefix can be removed as long as the share, bin, man and doc directories are moved relative to each other. To build the source distributions, unpack them with zip or tar and follow the instructions in Readme.txt at the top of the source tree. See also the
CMake
3.10 Release
Notes
.
2、Creating and using shared libraries with different compilers on different operating systems
http://gernotklingler.com/blog/...
官方原版说明:
The release was packaged with CPack which is included as part of the release. The .sh files are self extracting gziped tar files. To install a .sh file, run it with /bin/sh and follow the directions. The OS-machine.tar.gz files are gziped tar files of the install tree. The OS-machine.tar.Z files are compressed tar files of the install tree. The tar file distributions can be untared in any directory. They are prefixed by the version of
CMake
. For example, the Linux-x86_64 tar file is all under the directory
cmake
–Linux-x86_64. This prefix can be removed as long as the share, bin, man and doc directories are moved relative to each other. To build the source distributions, unpack them with zip or tar and follow the instructions in Readme.txt at the top of the source tree. See also the
CMake
3.17 Release
Notes
.
mac Qt 默认的 lib 工程 qmake 输出会生成带版本号的软链接。一般我们只需要一个 lib 文件,可以增加设置:CONFIG += unversioned_libname unversioned_soname
unversioned_libname 去掉了 lib 的版本号,unversioned_soname 去掉了链接里的版本号。网上有的是用 CONFIG += plugin,这样写QMAKE_SONAME_PREFIX 设置 rpath 就没生效。
编译器是我们开发人员与机器指令之间的翻译,现在编译器越来越优化,而且基于一些开源的编译器项目(gcc,clang)等,相继出现不同platform下的编译器。
此外,各种芯片、开发板层出不穷,各个商业公司都针对自己出产的开发板定制特定的编译链条。例如华为hisi系列的himix100中提供的编译链中,包括编译器,链接器,打包器之外,还提供了nm,gdb,gcov,gprof等等开发工具。
目录[学习] windows 下,创建静态、动态库准备文件1. 不链接任何库,构建项目2. 生成静态库3. 生成动态库(同时生成动态库,同名)4. 生成静态+动态库(TODO)5. 生成同名静态+动态库(TODO)[未解决] LNK1112 module machine type 'x86' conflicts with target machine type 'x64'参考
[学习] windows 下,创建静态、动态库
工具 visual studio 2019
cmake
main.
CMake
是一个跨平台的开源构建工具,可用于管理C ++和其他编程语言的构建过程。使用
CMake
,您可以生成支持不同平台和编译器的本地构建系统,而无需更改代码或构建脚本。
以下是使用
CMake
的基本步骤:
1. 安装
CMake
您可以从
CMake
官方网站下载适用于您的操作系统的最新版本。安装后,您可以在终端中通过运行“
cmake
-version”命令来验证是否正确安装了
CMake
。
2. 创建
CMake
Lists.txt文件
在您的项目根目录中创建一个名为“
CMake
Lists.txt”的文件。在此文件中,您将定义项目的构建规则,包括源文件,目标文件,编译器选项等。
3. 创建构建目录
在您的项目根目录外创建一个名为“build”的目录,并移动到该目录中。这是您将在其中构建项目的目录。
4. 运行
CMake
在终端中,使用以下命令运行
CMake
:
cmake
/path/to/source
其中“/path/to/source”是您的项目源代码目录的路径。
CMake
将读取
CMake
Lists.txt文件并生成构建系统文件。
5. 构建项目
在终端中,使用以下命令构建您的项目:
cmake
--build .
这将使用
CMake
生成的构建系统文件构建您的项目。
这是使用
CMake
的基本步骤,您可以根据需要进行更改和自定义。