Skip to Content.
Sympa Menu

cgal-discuss - Res: Res: [cgal-discuss] Create CMakeListis.txt

Subject: CGAL users discussion list

List archive

Res: Res: [cgal-discuss] Create CMakeListis.txt


Chronological Thread 
  • From: Rogério Pozza <>
  • To:
  • Subject: Res: Res: [cgal-discuss] Create CMakeListis.txt
  • Date: Sun, 16 May 2010 07:18:54 -0700 (PDT)
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.br; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=jm37KU8vw9picDXAS5SuYKwyHDM2lYuE4JRqpL7dsF6rfA2rAjfJNORWDRxu1tgrM4QAT83/NKDome3Kg/IxP6r7WLYQSi9ccTPti1uwEduQ3e3PzwzyJ3nesAHrwkWO3WJuzFkDCsxhYoFq92rY4lBT2RbgRV5Lz0MUApGKjdY=;

This is the original CMakeLists.txt

# This is the CMake script for compiling a CGAL application.

project (GraphicsView)

cmake_minimum_required(VERSION 2.4)

set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)

if ( COMMAND cmake_policy )
  cmake_policy( SET CMP0003 NEW ) 
endif()

find_package(CGAL COMPONENTS Qt4)

include(${CGAL_USE_FILE})


set( QT_USE_QTXML    TRUE )
set( QT_USE_QTMAIN   TRUE )
set( QT_USE_QTSCRIPT  TRUE )
set( QT_USE_QTOPENGL  TRUE )

find_package(Qt4)

if ( CGAL_FOUND AND CGAL_Qt4_FOUND AND QT4_FOUND )

  include(${QT_USE_FILE})


  add_executable  ( min min.cpp )

  add_to_cached_list( CGAL_EXECUTABLE_TARGETS min )

  # Link with Qt libraries
  target_link_libraries( min ${QT_LIBRARIES} )
  # Link with CGAL
  target_link_libraries( min ${CGAL_LIBRARIES}  ${CGAL_3RD_PARTY_LIBRARIES})

else()

  message(STATUS "NOTICE: This demo requires CGAL and Qt4, and will not be compiled.")

endif()



And this is generated by cgal_create_cmake_script demo (doesn't work)



# Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application.


project( Graphics_demo )

CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5)

set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
 
if ( COMMAND cmake_policy )
  cmake_policy( SET CMP0003 NEW ) 
endif()
 
find_package(CGAL QUIET COMPONENTS Core Qt3 )

if ( CGAL_FOUND )

  include( ${CGAL_USE_FILE} )
 
  find_package(Qt3-patched QUIET )
  # FindQt3-patched.cmake is FindQt3.cmake patched by CGAL developers, so
  # that it can be used together with FindQt4: all its variables are prefixed
  # by "QT3_" instead of "QT_".
 
  if(CGAL_Qt3_FOUND AND QT3_FOUND)
 
    include( Qt3Macros-patched )
    qt3_automoc(  min.cpp )

    # Make sure the compiler can find generated .moc files
    include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
 
    include_directories( ${QT3_INCLUDE_DIR} )

    add_executable  (Graphics_demo  min.cpp)
 
    add_to_cached_list( CGAL_EXECUTABLE_TARGETS Graphics_demo )
 
 
    # Link the executable to CGAL and third-party libraries
    target_link_libraries(Graphics_demo ${QT3_LIBRARIES} ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} )
  else()
 
    message(STATUS "NOTICE: This demo requires Qt3 and the CGAL Qt3 library, and will not be compiled.")
 
  endif()
 
else()
 
    message(STATUS "NOTICE: This demo requires the CGAL library, and will not be compiled.")
 
endif()


De: Rogério Pozza <>
Para:
Enviadas: Domingo, 16 de Maio de 2010 11:13:29
Assunto: Res: [cgal-discuss] Create CMakeListis.txt

I used it but no sucess.
The program is simple:

#include <QtGui>
#include <CGAL/Qt/GraphicsViewNavigation.h>
#include <QLineF>
#include <QRectF>

int main(int argc, char **argv)
{
    QApplication app(argc, argv);


    QGraphicsScene scene;
    scene.setSceneRect(0,0, 100, 100);
    scene.addRect(QRectF(0,0, 100, 100));
    scene.addLine(QLineF(0,0, 100, 100));
    scene.addLine(QLineF(0,100, 100, 0));

    QGraphicsView* view = new QGraphicsView(&scene);
    CGAL::Qt::GraphicsViewNavigation navigation;
    view->installEventFilter(&navigation);
    view->viewport()->installEventFilter(&navigation);
    view->setRenderHint(QPainter::Antialiasing);

    view->show();
    return app.exec();
}

But the CMakeLists.txt is not right. I user cmake . and make. The errors:

Scanning dependencies of target Graphics_demo
[100%] Building CXX object CMakeFiles/Graphics_demo.dir/min.o
/tmp/Graphics/min.cpp:3:17: error: QtGui: No such file or directory
In file included from /tmp/Graphics/min.cpp:4:
/usr/include/CGAL/Qt/GraphicsViewNavigation.h:25:19: error: QObject:
No such file or directory
/usr/include/CGAL/Qt/GraphicsViewNavigation.h:26:19: error: QPointF: No such file or directory
/usr/include/CGAL/Qt/GraphicsViewNavigation.h:27:19: error: QString: No such file or directory
/usr/include/CGAL/Qt/GraphicsViewNavigation.h:28:19: error: QCursor: No such file or directory
/usr/include/CGAL/Qt/GraphicsViewNavigation.h:29:17: error: QRect: No such file or directory
/usr/include/CGAL/Qt/GraphicsViewNavigation.h:30:18: error: QRectF: No such file or directory
/tmp/Graphics/min.cpp:5:18: error: QLineF: No such file or directory
In file included from /tmp/Graphics/min.cpp:4:

And so on.


De: Eric Berberich <>
Para:
Enviadas: Domingo, 16 de Maio de 2010 11:00:26
Assunto: Re: [cgal-discuss] Create CMakeListis.txt

wrote:
> Hi,
>
> I'm writing a program with graphics interfaces (Ubuntu 10.4) and the command
> cgal_create_cmake_script creates a bad file. how can I do to create the CMakeLists.txt file?
>


Use "cgal_create_cmake_script demo"

eriC

-- You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss


 

 


Archive powered by MHonArc 2.6.16.

Top of Page