Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Setting up cmake

Subject: CGAL users discussion list

List archive

[cgal-discuss] Setting up cmake


Chronological Thread 
  • From: Martin Baeker <>
  • To: CGAL Mailinglist <>
  • Subject: [cgal-discuss] Setting up cmake
  • Date: Thu, 4 Mar 2010 13:15:08 +0100 (CET)
  • Organization: Institut fuer Werkstoffe TU Braunschweig

Dear all,

I have a program library based on CGAL3.3. It consists of several
C++-Classes, each with its own .hpp and .cpp-file.

I am at a loss on how to achieve the same thing with newer versions of
CGAL that use cmake. The cgal_create_cmake_script is not sufficient because
I need to link to the library from my classes together when building
an executable. OTOH, I need correct compilation with all CGAL-stuff as
well.

Here is a very simple example (not meaningfulin itself) of what I want to do:

File Pointclass.H

#include <CGAL/Gmpq.h>
#include <CGAL/Cartesian.h>

typedef CGAL::Cartesian<CGAL::Gmpq> Kernel;
typedef Kernel::Point_3 Point;

class Mypoint: public Point
{
public:
int index;
Mypoint(int in);
};

File Pointclass.C

#include "Pointclass.H"

Mypoint::Mypoint(int in)
{
index = in;
}

File main.C

#include "Pointclass.H"

int main()
{
Mypoint p(1);
std::cout << p.index << std::endl;
return 0;

}


So how do I set up cmake so that main can be linked to Pointclass and
that the dependence of the two is known?

I suppose there is a simple way how to do this, but I'm not able to
find it...

Thanks for any help,

Martin.

Priv.-Doz. Dr. Martin Bäker
Institut für Werkstoffe
Technische Universität Braunschweig
Langer Kamp 8
38106 Braunschweig
Germany
Tel.: 00-49-531-391-3073
Fax 00-49-531-391-3058
e-mail
<>


Archive powered by MHonArc 2.6.16.

Top of Page