A Maven project for the CMake build system. It can be used by including it as a plugin within your Maven project's pom.xml file.
This repository originally lived on Google Code and was migrated to GitHub (and Git) after Google Code shut down.
<plugin>
<groupId>com.googlecode.cmake-maven-project</groupId>
<artifactId>cmake-maven-plugin</artifactId>
<version>3.19.2-b1</version>
<executions>
<execution>
<id>cmake-generate</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<sourcePath>
<!-- The directory containing CMakeLists -->
</sourcePath>
<targetPath>
<!-- The directory write the project files to -->
</targetPath>
<generator>
<!--
Optional: Overrides the default generator used by cmake.
The list of available values can be found at
https://cmake.org/cmake/help/v3.16/manual/cmake-generators.7.html
-->
</generator>
<environmentVariables>
<!--
Optional: Additional environment variables to expose to cmake. If a variable was already set,
overrides the previous value.
-->
<key>value</key>
</environmentVariables>
<options>
<!--
Optional: One or more options found at https://cmake.org/cmake/help/v3.16/manual/cmake.1.html
For example:
-->
<option>-DBUILD_THIRDPARTY:bool=on</option>
</options>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.googlecode.cmake-maven-project</groupId>
<artifactId>cmake-maven-plugin</artifactId>
<version>3.19.2-b1</version>
<executions>
<execution>
<id>cmake-compile</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<config>
<!-- Optional: the build configuration (e.g. "x64|Release") -->
</config>
<target>
<!-- Optional: the build "target" -->
</target>
<projectDirectory>
<!-- "targetPath" from the "generate" goal -->
</projectDirectory>
<environmentVariables>
<key>value</key>
</environmentVariables>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.googlecode.cmake-maven-project</groupId>
<artifactId>cmake-maven-plugin</artifactId>
<version>3.19.2-b1</version>
<executions>
<execution>
<id>cmake-test</id>
<goals>
<goal>test</goal>
</goals>
<configuration>
<!-- "buildDirectory" is "targetPath" from the "generate" goal -->
<buildDirectory>${project.build.directory}</buildDirectory>
<!-- Optional: do not fail the build on test failures. false by default. -->
<testFailureIgnore>true</testFailureIgnore>
<!-- Optional: skip only ctest tests. false by default. -->
<ctest.skip.tests>true</ctest.skip.tests>
<!-- Optional: Skip all Maven tests. false by default -->
<maven.test.skip>true</maven.test.skip>
<!-- Optional: the number of threads tests should use -->
<threadCount>2</threadCount>
<!-- Optional: dashboard configuration; used with CTestConfig.cmake -->
<dashboard>Experimental</dashboard>
</configuration>
</execution>
</executions>
</plugin>
The following projects contain examples of how to use this plugin:
To build the plugin, run:
mvn install
To clean an old build, run:
mvn clean
By default, Maven will activate the right profile based on your JVM:
If detection does not work, or you wish to override it then set -P<profile>
.
For instance, when building for 64-bit Linux machines, use:
mvn -Plinux-x86_64 install
Sometimes it is preferable or necessary to use a preexisting CMake installation. cmake.org doesn't providebinaries for some platforms, such as Raspberry Pi. In such cases, users can install the binaries themselves(typically using package managers like apt-get
) and point the plugin at them.
${cmake.download}
to false
.${cmake.dir}
to the directory containing the binaries (e.g. /usr/bin
). Otherwise, theplugin will expect the binaries to be on the PATH.That's it! To learn more about CMake itself, consult the CMake.org website.
CMake-Maven-Project is released under an Apache License 2.0
CMake cmake是什么 CMake is an open-source, cross-platform family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and
在执行run as ->maven install 操作的时候报错:maven Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile。 解决方案: window -> performance ->java->installed JREs ->Execution Environment
maven打包的时候报错 Failed to execute goalcom.google.code.maven-svn-revision-number-plugin:svn-revision-number-maven-plugin:1.13:revision(default) on project omsp: svn: E155021: This client is too old to wor
CMake 接着上一篇,这篇介绍依赖库,在介绍依赖库之前,先看看如何添加源代码子目录。 添加源代码子目录 当前所在位置 test04# pwd /tmp/c/2019-09-12-cmaketest/test04 当前目录中的文件/文件夹,我们新建了一个src目录并将helloworld.cpp放在其中 test04# tree . ├── build // 用来存放中间文件的空文件夹 ├──
1、JDK8版本过高,换成JDK7; 2、换成命令行mvn package -Pdist,native -DskipTests-Dtar-Dmaven.javadoc.skip=true 注意:检查命令中-符号,而不是中文—,-Dmaven.javadoc.skip=true编译时略过创建javadoc (有可能遇到多次无法解决依赖报错,可先强制更新Maven所有依赖,执行命令:mvn clean
This plugin, in conjunction with sonar-cxx-plugin (experimental) allow seamless continuous integration process for c++ project (using for example Hudson server) cxx-maven-plugin plugin adds many GOAL
Failed to execute goal com.spotify:docker-maven-plugin:1.2.0:build (default-cli) on project security: Exception caught <build> <plugins> <plugin> <groupId>org.springframework.b
当我对Maven工程进行 compile 和 install 时出现如下错误: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile 在我 pom 文件中有如下配置: <build> <plugins> <plugin> <groupId>org.spring
[ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:3.2.2:cmake-compile (cmake-compile) on project hadoop-pipes: Error executing CMake: Cannot run program “cmake” (in directory “/Use
[ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:2.8.5:protoc (compile-protoc) on project hadoop-common: org.apache.maven.plugin.MojoExecutionException: protoc version is 'libprot
maven项目执行compile,报Failed to execute goal on project XXX:could not resolve dependencies for project. 原因:很简单,对应的的jar没有下载下来。 这时候很多人会说了,网络不好,jar包没有下载下来,确实有时候是会因为这个原因而导致compile报错。但我所遇到的并不是,而且可能是比这种问题更低级的问题
CMake 是一个跨平台的自动化构建系统,它使用一个名为 CMakeLists.txt 的文件来描述构建过程,可以产生标准的构建文件,如 Unix 的 Makefile 或Windows Visual C++ 的 projects/workspaces 。文件 CMakeLists.txt 需要手工编写,也可以通过编写脚本进行半自动的生成。CMake 提供了比 autoconfig 更简洁的语法。
?> Hello world,世界 你好 本节选择了一个最简单的例子 Helloworld 来演练一下 cmake 的完整构建过程,本节并不会深入的探讨 cmake,仅仅展示一个简单的例子,并加以粗略的解释。我们选择了Everest Linux 作为基本开发平台,因为这个只有一张 CD 的发行版本,包含了 gcc4.2/gtk/qt3/qt4等完整的开发环境,同时,系统默认集成了 cmake 最新
cmake-conan CMake wrapper for the Conan C and C++ package manager. This cmake module allows to launch conan install from cmake. The branches in this repo are: develop: PR are merged to this branch. La
CMake Cookbook This repository collects sources for the recipes contained in theCMake Cookbookpublished by Packt and authored by Radovan Bast andRoberto Di Remigio Contributing Testing Table of conten
learning-cmake This is a simple CMake tutorial project which contains some different scenarios. hello-world: Demo a simplest CMake project. hello-world-clear: Separate the output files and src files.
switch-cmake Extensible CMake toolchain for Switch homebrew development with devkitA64 and libnx. Table of Contents Introduction Why CMake Quick Start Switch Homebrew File Formats devkitPro Ecosystem