CMake/CPack/Examples/Linux/DEB: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
(Created page with "==DistanceBetweenPoints.cxx== <source lang="cpp"> #include <vtkMath.h> int main(int, char *[]) { // Create two points. double p0[3] = {0.0, 0.0, 0.0}; double p1[3] = {1.0...")
 
(Replace content with link to new CMake community wiki)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==DistanceBetweenPoints.cxx==
{{CMake/Template/Moved}}
<source lang="cpp">
#include <vtkMath.h>
int main(int, char *[])
{
  // Create two points.
  double p0[3] = {0.0, 0.0, 0.0};
  double p1[3] = {1.0, 1.0, 1.0};
  // Find the squared distance between the points.
  double squaredDistance = vtkMath::Distance2BetweenPoints(p0, p1);


  // Take the square root to get the Euclidean distance between the points.
This page has moved [https://gitlab.kitware.com/cmake/community/wikis/doc/cpack/examples/linux/DEB here].
  double distance = sqrt(squaredDistance);
  // Output the results.
  std::cout << "SquaredDistance = " << squaredDistance << std::endl;
  std::cout << "Distance = " << distance << std::endl;
 
  return EXIT_SUCCESS;
}
</source>
 
==CMakeLists.txt==
<source lang="cmake">
cmake_minimum_required(VERSION 2.6)
 
PROJECT(DistanceBetweenPoints)
 
FIND_PACKAGE(VTK REQUIRED)
INCLUDE(${VTK_USE_FILE})
 
ADD_EXECUTABLE(DistanceBetweenPoints DistanceBetweenPoints.cxx)
 
SET(CPACK_GENERATOR "RPM")
INCLUDE(CPack)
 
</source>

Latest revision as of 15:40, 30 April 2018


The CMake community Wiki has moved to the Kitware GitLab Instance.

This page has moved here.