#!/bin/bashrm -fdr buildmkdir buildcd buildCC=gcc cmake ..makectest -V
cmake_minimum_required(VERSION 2.6.2)project( googletest-distribution )#enable_testing()include(CTest)option(BUILD_GTEST "Builds the googletest subproject" OFF)#Note that googlemock target already builds googletestoption(BUILD_GMOCK "Builds the googlemock subproject" ON)if(BUILD_GMOCK)add_subdirectory( googlemock )elseif(BUILD_GTEST)add_subdirectory( googletest )endif()
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0<modelVersion>4.0.0</modelVersion><groupId>com.ciena.bp</groupId><artifactId>coe</artifactId><version>0.0.4</version><packaging>pom</packaging><!--<parent><groupId>com.ciena.bp</groupId><artifactId>maven-parent-pom</artifactId><version>0.0.3</version></parent> --><build><plugins><plugin><groupId>com.googlecode.cmake-maven-project</groupId><artifactId>cmake-maven-plugin</artifactId><version>3.4.1-b1</version><executions><execution><id>cmake-generate</id><goals><goal>generate</goal></goals><configuration><sourcePath>./</sourcePath><targetPath>./build</targetPath><generator>Unix Makefiles</generator><options><option>-DBUILD_THIRDPARTY:bool=on</option></options></configuration></execution><execution><id>cmake-test</id><goals><goal>test</goal></goals><configuration><!-- "buildDirectory" is "targetPath" from the "generate" goal --><buildDirectory>${project.build.directory}</buildDirectory><!-- Optional way to not fail the build on test failures --><!-- <testFailureIgnore>true</testFailureIgnore> --><!-- Optional way to skip just the ctest tests --><!-- <ctest.skip.tests>true</ctest.skip.tests> --><!-- Optional/standard way to skip all Maven tests --><!-- <maven.test.skip>true</maven.test.skip> --><!-- Optional way to configure number of threads tests should use --><!-- <threadCount>2</threadCount> --><!-- Optional dashboard configuration; used with CTestConfig.cmake --><!-- <dashboard>Experimental</dashboard> --></configuration></execution></executions></plugin></plugins></build></project>
I am using cmake-maven to build the cmake project that I have. The build works fine. But there are three issues I am facing.1. How to clean the build folder before each maven install?
2. I also need to run make so that I can hook it up with Teamcity. Is there any way to run make as well from the build folder. Right now, I am using build.sh but I want to replace it with pom.xml.#!/bin/bashrm -fdr buildmkdir buildcd buildCC=gcc cmake ..makectest -V