Commit ed0de08f authored by Sylvain Thery's avatar Sylvain Thery

finalize compilation changes

parent 6e8009c7
...@@ -142,7 +142,7 @@ IF (WITH_QT) ...@@ -142,7 +142,7 @@ IF (WITH_QT)
ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(${QT_DEFINITIONS})
find_package(QGLViewer REQUIRED) find_package(QGLViewer REQUIRED)
SET (CGoGN_EXT_INCLUDES ${CGoGN_EXT_INCLUDES} ${QT_INCLUDE_DIR} ${QGLVIEWER_INCLUDE_DIR} ) SET (CGoGN_EXT_INCLUDES ${CGoGN_EXT_INCLUDES} ${QT_INCLUDE_DIR} ${QGLVIEWER_INCLUDE_DIR} )
SET (CGoGN_EXT_LIBS ${QT_LIBRARIES} ${QGLVIEWER_LIBRARIES} ${CGoGN_EXT_LIBS}) SET (CGoGN_EXT_LIBS ${QT_LIBRARIES} ${QGLVIEWER_LIBRARIES} ${CGoGN_EXT_LIBS})
ENDIF (WITH_QT) ENDIF (WITH_QT)
IF (WITH_GLEWMX) IF (WITH_GLEWMX)
...@@ -173,11 +173,138 @@ ELSE() ...@@ -173,11 +173,138 @@ ELSE()
endif() endif()
ENDIF() ENDIF()
add_subdirectory(Release)
add_subdirectory(${CGoGN_ROOT_DIR}/Apps Apps)
#INSTALL (DIRECTORY ${CGoGN_ROOT_DIR}/include ${CGoGN_ROOT_DIR}/lib ${CGoGN_ROOT_DIR}/bin DESTINATION .)
#INSTALL (DIRECTORY ThirdParty/glm DESTINATION include) IF(WIN32)
#INSTALL (DIRECTORY cmake_modules DESTINATION .) SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib)
#INSTALL (FILES apps_cmake.txt DESTINATION .) ELSE()
SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/${CMAKE_BUILD_TYPE})
ENDIF()
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CGoGN_ROOT_DIR}/include
${CGoGN_EXT_INCLUDES}
)
file(
GLOB_RECURSE
files_topology
${CGoGN_ROOT_DIR}/src/Topology/*.cpp
${CGoGN_ROOT_DIR}/include/Topology/*.hpp
${CGoGN_ROOT_DIR}/include/Topology/*.h
)
file(
GLOB_RECURSE
files_container
${CGoGN_ROOT_DIR}/src/Container/*.cpp
${CGoGN_ROOT_DIR}/include/Container/*.hpp
${CGoGN_ROOT_DIR}/include/Container/*.h
)
file(
GLOB_RECURSE
files_algo
${CGoGN_ROOT_DIR}/src/Algo/*.cpp
${CGoGN_ROOT_DIR}/src/Algo/*.c
${CGoGN_ROOT_DIR}/include/Algo/*.hpp
${CGoGN_ROOT_DIR}/include/Algo/*.h
)
file(
GLOB
shaders_src
${CGoGN_ROOT_DIR}/include/Utils/*.frag
${CGoGN_ROOT_DIR}/include/Utils/*.vert
${CGoGN_ROOT_DIR}/include/Utils/*.geom
${CGoGN_ROOT_DIR}/include/Utils/Shaders/*.frag
${CGoGN_ROOT_DIR}/include/Utils/Shaders/*.vert
${CGoGN_ROOT_DIR}/include/Utils/Shaders/*.geom
)
IF(WIN32)
add_custom_target(shader_target ${CGoGN_ROOT_DIR}/ThirdParty/bin/Release/shader_to_h ${shaders_src}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
SOURCES ${shaders_src} )
ELSE()
add_custom_target(shader_target ${CGoGN_ROOT_DIR}/ThirdParty/bin/shader_to_h ${shaders_src}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
SOURCES ${shaders_src} )
ENDIF()
file(
GLOB # WARNING NO MORE RECURSE TO AVOID TAKING QT FILES
files_utils
${CGoGN_ROOT_DIR}/src/Utils/*.cpp
${CGoGN_ROOT_DIR}/include/Utils/*.hpp
${CGoGN_ROOT_DIR}/include/Utils/*.h
${CGoGN_ROOT_DIR}/src/Utils/Shaders/*.cpp
${CGoGN_ROOT_DIR}/include/Utils/Shaders/*.hpp
${CGoGN_ROOT_DIR}/include/Utils/Shaders/*.h
)
IF(WITH_QT)
file(
GLOB
files_utils_qt
${CGoGN_ROOT_DIR}/src/Utils/Qt/*.cpp
${CGoGN_ROOT_DIR}/include/Utils/Qt/*.hpp
${CGoGN_ROOT_DIR}/include/Utils/Qt/*.h
)
file(
GLOB
utils_qt_headers
${CGoGN_ROOT_DIR}/include/Utils/Qt/qtgl.h
${CGoGN_ROOT_DIR}/include/Utils/Qt/qtSimple.h
${CGoGN_ROOT_DIR}/include/Utils/Qt/qtQGLV_glw.h
${CGoGN_ROOT_DIR}/include/Utils/Qt/qtQGLV.h
${CGoGN_ROOT_DIR}/include/Utils/Qt/qtpopup.h
${CGoGN_ROOT_DIR}/include/Utils/Qt/qthistodraw.h
${CGoGN_ROOT_DIR}/include/Utils/Qt/qtcolorschooser.h
)
QT4_WRAP_CPP(UTILS_QT_HEADERS_MOC ${utils_qt_headers})
SET (files_utils_withQt ${files_utils} ${files_utils_qt} ${UTILS_QT_HEADERS_MOC})
ENDIF()
file( GLOB_RECURSE
files_geometry
${CGoGN_ROOT_DIR}/include/Geometry/*.h
${CGoGN_ROOT_DIR}/include/Geometry/*.hpp
)
file( GLOB_RECURSE
files_thirdParty
${CGoGN_ROOT_DIR}/ThirdParty/include/*.h
${CGoGN_ROOT_DIR}/ThirdParty/include/*.hpp
)
IF (ONELIB)
IF(WITH_QT)
add_library( cgogn ${files_topology} ${files_container} ${files_algo} ${files_utils_withQt})
ELSE()
add_library( cgogn ${files_topology} ${files_container} ${files_algo} ${files_utils} )
ENDIF()
add_dependencies(cgogn shader_target )
ELSE()
add_library( container ${files_container})
add_library( topology ${files_topology})
add_library( algo ${files_algo})
IF (WITH_QT)
add_library( utils ${files_utils_withQt} )
ELSE()
add_library( utils ${files_utils} )
ENDIF()
add_custom_target( Geometry SOURCES ${files_geometry} )
add_custom_target( ThirdParty SOURCES ${files_thirdParty} )
add_dependencies( utils shader_target )
ENDIF()
add_subdirectory(${CGoGN_ROOT_DIR}/Apps Apps)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorCodeStyle>
<!-- Written by QtCreator 2.8.1, 2014-07-11T16:03:10. -->
<qtcreator>
<data>
<variable>CodeStyleData</variable>
<valuemap type="QVariantMap">
<value type="bool" key="AlignAssignments">false</value>
<value type="bool" key="AutoSpacesForTabs">false</value>
<value type="bool" key="BindStarToIdentifier">false</value>
<value type="bool" key="BindStarToLeftSpecifier">false</value>
<value type="bool" key="BindStarToRightSpecifier">false</value>
<value type="bool" key="BindStarToTypeName">true</value>
<value type="bool" key="ExtraPaddingForConditionsIfConfusingAlign">true</value>
<value type="bool" key="IndentAccessSpecifiers">false</value>
<value type="bool" key="IndentBlockBody">true</value>
<value type="bool" key="IndentBlockBraces">false</value>
<value type="bool" key="IndentBlocksRelativeToSwitchLabels">false</value>
<value type="bool" key="IndentClassBraces">false</value>
<value type="bool" key="IndentControlFlowRelativeToSwitchLabels">true</value>
<value type="bool" key="IndentDeclarationsRelativeToAccessSpecifiers">true</value>
<value type="bool" key="IndentEnumBraces">false</value>
<value type="bool" key="IndentFunctionBody">true</value>
<value type="bool" key="IndentFunctionBraces">false</value>
<value type="bool" key="IndentNamespaceBody">false</value>
<value type="bool" key="IndentNamespaceBraces">false</value>
<value type="int" key="IndentSize">4</value>
<value type="bool" key="IndentStatementsRelativeToSwitchLabels">true</value>
<value type="bool" key="IndentSwitchLabels">true</value>
<value type="int" key="PaddingMode">2</value>
<value type="bool" key="SpacesForTabs">false</value>
<value type="int" key="TabSize">4</value>
</valuemap>
</data>
<data>
<variable>DisplayName</variable>
<value type="QString">IGGstyle</value>
</data>
</qtcreator>
...@@ -11,8 +11,12 @@ Pour compiler CGoGN: ...@@ -11,8 +11,12 @@ Pour compiler CGoGN:
make (-j x si vous avez x cores) make (-j x si vous avez x cores)
make install make install
La même chose en debug:
cd ../buildDebug
cmake ..
make (-j x si vous avez x cores)
On peut fixer certaines option pour ne pas tout compiler (cf le README.TXT dans ThirdParty) On peut fixer certaines option pour ne pas tout compiler (cf le README.TXT dans ThirdParty)
On peut aussi compiler en debug en compilant dans un répertoire dont le nom finit par Debug ("buildDebug" par exemple)
- ensuite on compile CGoGN (compile les libs dans CGoGN/lib et des exemples dans CGoGN/bin) : - ensuite on compile CGoGN (compile les libs dans CGoGN/lib et des exemples dans CGoGN/bin) :
...@@ -20,18 +24,19 @@ Pour compiler CGoGN: ...@@ -20,18 +24,19 @@ Pour compiler CGoGN:
cmake .. cmake ..
make (-j x si vous avez x cores) make (-j x si vous avez x cores)
Et en Debug avec:
cd ../buildDebug
cmake ..
make (-j x si vous avez x cores)
-> certaines options sont disponibles : -> certaines options sont disponibles :
BUILD_SHARED_LIBS (F) experimental ! BUILD_SHARED_LIBS (F) experimental !
WITH_ASSIMP (T) WITH_ASSIMP (T)
WITH_NUMERICAL (T)
WITH_ZINRI (T) WITH_ZINRI (T)
WITH_QT (T) WITH_QT (T)
-> afin de limiter les dépendances et le temps de compilation -> afin de limiter les dépendances et le temps de compilation
FORCE_MR (0)
-> permet de compiler dans 2 modes: mono-resolution(0), multi-resolution(1)
ONELIB (F) ONELIB (F)
-> permet de forcer la compilation en une seule lib (libcgogn.a) au lieu de quatre. -> permet de forcer la compilation en une seule lib (libcgogn.a) au lieu de quatre.
...@@ -41,6 +46,15 @@ Pour compiler CGoGN: ...@@ -41,6 +46,15 @@ Pour compiler CGoGN:
cmake .. cmake ..
make (-j x si vous avez x cores) make (-j x si vous avez x cores)
Et en Debug avec:
cd ../buildDebug
cmake ..
make (-j x si vous avez x cores)
Les librairies sont generees dans lib/Release et lib/Debug
Les binaires sont generes dans bin/Release et bin/Debug
Des exemples de données (fichiers trianbgz, off, etc..) sont accessible à l'adresse suivante: Des exemples de données (fichiers trianbgz, off, etc..) sont accessible à l'adresse suivante:
https://iggservis.u-strasbg.fr/Data/data.zip https://iggservis.u-strasbg.fr/Data/data.zip
...@@ -63,6 +77,11 @@ To compile CGoGN: ...@@ -63,6 +77,11 @@ To compile CGoGN:
make (-j x if you have x cores) make (-j x if you have x cores)
make install make install
In debug mode
cd ../buildDebug
cmake ..
make
Some options are available to not compile everything (see the README.TXT in ThirdParty) Some options are available to not compile everything (see the README.TXT in ThirdParty)
- then compile CGoGN (the libs are generated in CGoGN/lib and some examples in CGoGN/bin): - then compile CGoGN (the libs are generated in CGoGN/lib and some examples in CGoGN/bin):
...@@ -71,18 +90,19 @@ To compile CGoGN: ...@@ -71,18 +90,19 @@ To compile CGoGN:
cmake .. cmake ..
make (-j x if you have x cores) make (-j x if you have x cores)
in debug mode:
cd ../buildDebug
cmake ..
make
-> some options are available:. -> some options are available:.
BUILD_SHARED_LIBS (F) experimental ! BUILD_SHARED_LIBS (F) experimental !
WITH_ASSIMP (T) WITH_ASSIMP (T)
WITH_NUMERICAL (T)
WITH_ZINRI (T) WITH_ZINRI (T)
WITH_QT (T) WITH_QT (T)
-> to minimize dependencies and compilation time -> to minimize dependencies and compilation time
FORCE_MR (0)
-> allows the compilation in 2 modes: mono-resolution(0), multi-resolution(1)
ONELIB (F) ONELIB (F)
-> allow compilation in one lib (libcgogn.a) instead of four. -> allow compilation in one lib (libcgogn.a) instead of four.
...@@ -92,6 +112,14 @@ To compile CGoGN: ...@@ -92,6 +112,14 @@ To compile CGoGN:
cmake .. cmake ..
make (-j x if you have x cores) make (-j x if you have x cores)
in debug mode:
cd ../buildDebug
cmake ..
make
Libraries are generated in lib/Release and lib/Debug
Binaries are generated in bin/Release and bin/Debug
Examples of data (trianbgz, off, etc.. files) are available at the following address: Examples of data (trianbgz, off, etc.. files) are available at the following address:
https://iggservis.u-strasbg.fr/Data/data.zip https://iggservis.u-strasbg.fr/Data/data.zip
Principe des applications dans CGoGN_Apps (english version below) Principe des applications dans CGoGN_Apps (english version below)
Faire un repertoire CGoGN_Apps ou on veut. Y mettre des sous répertoires Faire un repertoire CGoGN_Apps ou on veut. Y mettre des sous répertoires
contenant chacun une application/ contenant chacun une application/
Le CMakeLists.txt a la racine de l'application doit commencer par Le CMakeLists.txt a la racine de l'application doit commencer par
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 2.8)
PROJECT(NOM_DE_L_APPLICATION)
SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/../../CGoGN CACHE STRING "CGoGN root dir")
INCLUDE(${CGoGN_ROOT_DIR}/apps_cmake.txt)
Le ../../CGoGN correspond au chemin relatif vers votre version de CGoGN
(ici placée au même niveau que CGoGN_Apps)
Si vous voulez faire des sous répertoires release et debug:
add_subdirectory(${CMAKE_SOURCE_DIR}/Release Release)
IF (NOT WIN32)
add_subdirectory(${CMAKE_SOURCE_DIR}/Debug Debug)
ENDIF (NOT WIN32)
Le CMakeLists (Release par exemple) doit ensuite contenir:
SET(CMAKE_BUILD_TYPE Release) project(APPLICATION_NAME)
IF(WIN32) SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/../../CGoGN CACHE STRING "CGoGN root dir")
link_directories( ${CGoGN_ROOT_DIR}/lib/$(ConfigurationName) ) include(${CGoGN_ROOT_DIR}/apps_cmake.txt)
ELSE (WIN32)
link_directories( ${CGoGN_ROOT_DIR}/lib/Release/ )
ENDIF (WIN32)
# Attention pour la version debug, deux solutions:
# soit mettre Debug et Release si on veut utiliser les ThirdParty en release
# soit mettre uniquement Debug, mais il faut avoir compiler les ThirdParty en debug
include_directories( include_directories(
${CGoGN_ROOT_DIR}/include # for CGoGN ${CGoGN_ROOT_DIR}/include
${COMMON_INCLUDES} # for thirdparty & system ${COMMON_INCLUDES}
${CMAKE_CURRENT_SOURCE_DIR} # for application ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR} # for qt (ui,moc,etc.) if necessary ${CMAKE_CURRENT_BINARY_DIR}
)
# Pour une appli QT
QT4_WRAP_UI( source_ui ../source.ui )
QT4_WRAP_CPP( source_moc ../source.h )
add_executable( mon_exec
${CMAKE_SOURCE_DIR}/mon_source.cpp
# Pour une appli QT
${source_moc}
${source_ui}
) )
target_link_libraries( mon_exec ${CGoGN_LIBS_R} ${COMMON_LIBS})
Pour le compiler le plus propre est de faire un repertoire build,
d'aller à l'interieur et de faire ccmake .. (j'ai bien ecrit "..")
ccmake (ou un equivalent type cmake-gui) permet de mettre à jour les variables,
ici WITH_QT, WITH_ASSIMP, WITH_NUMERICAL, WITH_ZINRI.
Ceci ajoutera automatiquement tout ce qu'il faut aux variables COMMON_INCLUDES
et COMMON_LIBS.
On peut aussi utiliser cmake avec l'option -D (moins pratique).
Faire un repertoire build et buildDebug
Pour compiler en release
cd build
cmake ..
make
Pour compiler en debug:
cd buildDebug
cmake ..
make
========================================================================================= =========================================================================================
ENGLISH VERSION ENGLISH VERSION
...@@ -77,66 +40,33 @@ Create a directory CGoGN_Apps where you want. Inside create subdirectories, one ...@@ -77,66 +40,33 @@ Create a directory CGoGN_Apps where you want. Inside create subdirectories, one
The CMakeLists.txt to the root of the application must begin with The CMakeLists.txt to the root of the application must begin with
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 2.8)
PROJECT(NOM_DE_L_APPLICATION)
SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/../../CGoGN CACHE STRING "CGoGN root dir")
INCLUDE(${CGoGN_ROOT_DIR}/apps_cmake.txt)
The .. / .. / CGoGN corresponds to the relative path to your version of CGoGN project(APPLICATION_NAME)
(here placed at the same level as CGoGN_Apps)
If you want to do in release and debug directories:
add_subdirectory(${CMAKE_SOURCE_DIR}/Release Release)
IF (NOT WIN32)
add_subdirectory(${CMAKE_SOURCE_DIR}/Debug Debug)
ENDIF (NOT WIN32)
The CMakeLists (here in Release) must then contain:
SET(CMAKE_BUILD_TYPE Release)
IF(WIN32)
link_directories( ${CGoGN_ROOT_DIR}/lib/$(ConfigurationName) )
ELSE (WIN32)
link_directories( ${CGoGN_ROOT_DIR}/lib/Release/ )
ENDIF (WIN32)
# Watch out for the debug version, two solutions: SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/../../CGoGN CACHE STRING "CGoGN root dir")
# Debug and Release to be if you want to use ThirdParty in release version include(${CGoGN_ROOT_DIR}/apps_cmake.txt)
# or Debug only, but you have to compile ThirdParty in debug
include_directories( include_directories(
${CGoGN_ROOT_DIR}/include # for CGoGN ${CGoGN_ROOT_DIR}/include
${COMMON_INCLUDES} # for thirdparty & system ${COMMON_INCLUDES}
${CMAKE_CURRENT_SOURCE_DIR} # for application ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR} # for qt (ui,moc,etc.) if necessary ${CMAKE_CURRENT_BINARY_DIR}
)
# for a QT application
QT4_WRAP_UI( source_ui ../source.ui )
QT4_WRAP_CPP( source_moc ../source.h )
add_executable( mon_exec
${CMAKE_SOURCE_DIR}/mon_source.cpp
# for a QT application
${source_moc}
${source_ui}
) )
target_link_libraries( mon_exec ${CGoGN_LIBS_R} ${COMMON_LIBS}) The .. / .. / CGoGN corresponds to the relative path to your version of CGoGN
(here placed at the same level as CGoGN_Apps)
To compile the cleanest way is to build a directory, to go inside and make ccmake .. (I have written "..") Create directories build and buildDebug
ccmake (or an equivalent type cmake-gui) is used to update the variables, WITH_QT here, WITH_ASSIMP, To compile in release mode:
WITH_NUMERICAL, WITH_ZINRI. cd build
This will automatically add it all the variables COMMON_INCLUDES and COMMON_LIBS. cmake ..
You can also use cmake with -D option (less convenient). make
To compile in debug mode:
cd buildDebug
cmake ..
make
......
*** english version below ***
Pour utiliser Eclipse (testé avec la version Helios, Galileo, Indigo & Juno)
* Configurer un projet dans Eclipse :
- Faire un nouveau projet C++
- Choisir Makefile project -> Empty Project
- Choisir Comme "Location": la racine de CGoGN
- Choisir Toolchains: Linux GCC
* Compilation avec le petit marteau ;) (l'icone)
Dans les propriétés du projet:
-> C/C++ Build:
Dans la configuration Default | Active:
ajouter au chemin de Build Directory /build
on peut ensuite ajouter des configurations pour compiler ce que l'on veut
en changeant juste le Build directory:
CGoGNRelease: build/Release (compile la lib en release)
CGoGNDebug: build/Debug (compile la lib en debug)
Apps: build/Apps (compile les exemples et les tutos)
Tuto: build/Apps/Tuto (compile les tutos)
etc..
Ceci ajoute dans le repertoire de CGoGN un .project et un .cproject.
* Dépendances inter-projets et autocomplétion
Si le projet X dépend d'un autre projet, alors :
Projet X -> Properties -> Project references : cocher le projet dont il dépend.
* Dépendances de Qt :
Afin d'éviter qu'Eclipse ne rejette les syntaxes Qt (les includes de Qt, les Q_OBJECT, les callbacks) :
- Télécharger le plugin Qt "eclipse-integration" http://qt.nokia.com/developer/eclipse-integration/
- Décompresser l'archive et copier son contenu dans le répertoire d'installation d'Eclipse (plugins et features)
- Relancer Eclipse au moins une fois avec l'option "-clean" (relecture des répertoires locaux)
Normalement, dans Window --> Preferences de Eclipse, Qt apparait dans le menu.
- Y ajouter le répertoire de Qt (/usr/bin sur Debian/Ubuntu) et le répertoire d'include (/usr/include/qt4).
Ensuite, pour chaque projet, ajouter les includes suivants dans Properties -> C/C++ general -> Paths and Symbols
parmi les includes de C++ :
- /usr/include/qt4
- /usr/include/qt4/Qt
- /usr/include/qt4/QtCore
- /usr/include/qt4/QtGui
- /usr/include/qt4/QtOpenGL
REMARQUE : en bas de cette fenêtre, le bouton "Export Settings" permet d'exporter en XML la configuration afin
de l'importer dans les autres projets.
- Pour finir, un petit clic-droit sur le projet -> Index -> Freshen all files et le tour est joué.
* Coloration syntaxique des shaders
- Télécharger et décompresser EclipseShaders : http://sourceforge.net/projects/glshaders/
- Copier les répertoires plugins et features dans le répertoire d'installation eclipse
- Relancer Eclipse au moins une fois avec l'option --clean (relecture des répertoires locaux)
Eclipse reconnaîtra désormais les fichiers .frag et .vert.
Pour associer d'autres fichiers au programme GLSLeditor :
- Preferences -> General -> Editors -> File Associations
Dans Preferences -> Shaders Preferences, on peut désormais configurer certaines options liées au shaders.
* Coloration syntaxique des fichiers CMake
- Installer CMakeEditor pour Eclipse en ajoutant l'URL dans Help -> Install New Software ... : http://cmakeed.sourceforge.net/eclipse/
- Installer et redémarrer
- Dans Preferences -> General -> Editors -> File Associations il est possible d'associer les CMakeLists.txt à ce logiciel d'édition
* Problème indexeur
Si l'indexeur plante avec comme message "Out of memory" (c'est la cas par défaut sur Juno lors de l'indexation totale de CGoGN),
relancer eclipse avec l'option "/opt/eclipse/eclipse -vmargs -Xms512m -Xmx1024M" avant de refaire une indexation globale.
=========================================================================================
ENGLISH VERSION
=========================================================================================
To use Eclipse (tested with version Helios, Galileoi, Indigo & Juno)
* Setting up a project in Eclipse:
- Make a new C + + project
- Select Makefile project -> Empty Project
- Choose As "Location": root CGoGN
- Select Toolchain: GCC Linux
* Compilation with the small hammer (icon)
In the project properties:
-> C / C + + Build:
In the configuration Default | Active:
add to Build Directory path /build
you can then add configurations to compile what we want by just changing the Build directory:
CGoGNRelease: build / Release (compile the lib release)
CGoGNDebug: build / Debug (compiles in debug lib)
Apps: build / Apps (compile the examples and tutorials)
Tutorial: Build / Apps / Tutorial (compiles tutorials)
etc. ..
This adds a .project. and .cproject files to the CGoGN directory.
* Project inter-dependencies and autocompletion
If project X depends on another project, then:
Project X -> Properties -> Project references: check the project which it depends.
* Qt dependencies:
To avoid Eclipse rejecting the Qt syntax (includes, Q_OBJECT, callbacks):
- Download the Qt plugin "eclipse-integration" http://qt.nokia.com/developer/eclipse-integration/
- Unzip the archive and copy its contents into the installation directory of Eclipse (plugins and features)
- Restart Eclipse at least once with the "-clean" (proofreading local directories)
Normally in Window --> Preferences of Eclipse, Qt appears in the menu.
- Add the Qt directory (/ usr / bin on Debian / Ubuntu) and the directory include (/ usr/include/qt4).
Then, for each project, add the following includes in Properties -> C / C + + general -> Paths and Symbols
among the C + + includes:
- / Usr/include/qt4
- / Usr/include/qt4/Qt
- / Usr/include/qt4/QtCore
- / Usr/include/qt4/QtGui
- / Usr/include/qt4/QtOpenGL
NOTE: at the bottom of this window, the button "Export Settings" allows you to export the configuration to XML
import it into other projects.
- Finally, a small right-click the project -> Index -> Freshen all files and go.
* Syntax of shaders
- Download and unzip EclipseShaders: http://sourceforge.net/projects/glshaders/
- Copy the directories features and plugins in the eclipse installation directory
- Restart Eclipse at least once with the - clean (proofreading local directories)
Eclipse will now recognize the files. And frag. Green.
To assign other files in the program GLSLeditor:
- Preferences -> General -> Editors -> File Associations
In Preferences -> Shaders Preferences, you can now configure some options related to the shader.
* Syntax highlighting for CMake files
- Install CMakeEditor for Eclipse by adding the URL in Help -> Install New Software ... : Http://cmakeed.sourceforge.net/eclipse/
- Install and restart
- In Preferences -> General -> Editors -> File Associations You can associate the CMakeLists.txt to editing software
* Indexer problem
If the indexer fails with an "Out of Memory" error (this is the case when indexing CGoGN fully on eclipse Juno for instance),
then relaunch eclipse using some options to use a bigger heap "/opt/eclipse/eclipse -vmargs -Xms512m -Xmx1024M" before indexing
CGoGN globally.
cmake_minimum_required(VERSION 2.8)
project(CGoGNLibrary)
# SET(CMAKE_BUILD_TYPE Release)
#IF(WIN32)
# SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib)
#ELSE(WIN32)
# SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release)
# ADD_DEFINITIONS(-DNOTOPOWARNING)
#ENDIF(WIN32)
IF(WIN32)
SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib)
ELSE()
SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/${CMAKE_BUILD_TYPE})
ENDIF()
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CGoGN_ROOT_DIR}/include
${CGoGN_EXT_INCLUDES}
)
file(
GLOB_RECURSE
files_topology
${CGoGN_ROOT_DIR}/src/Topology/*.cpp
${CGoGN_ROOT_DIR}/include/Topology/*.hpp
${CGoGN_ROOT_DIR}/include/Topology/*.h
)
file(
GLOB_RECURSE
files_container
${CGoGN_ROOT_DIR}/src/Container/*.cpp
${CGoGN_ROOT_DIR}/include/Container/*.hpp
${CGoGN_ROOT_DIR}/include/Container/*.h
)
file(
GLOB_RECURSE
files_algo
${CGoGN_ROOT_DIR}/src/Algo/*.cpp
${CGoGN_ROOT_DIR}/src/Algo/*.c
${CGoGN_ROOT_DIR}/include/Algo/*.hpp
${CGoGN_ROOT_DIR}/include/Algo/*.h
)
file(
GLOB
shaders_src
${CGoGN_ROOT_DIR}/include/Utils/*.frag
${CGoGN_ROOT_DIR}/include/Utils/*.vert
${CGoGN_ROOT_DIR}/include/Utils/*.geom
${CGoGN_ROOT_DIR}/include/Utils/Shaders/*.frag
${CGoGN_ROOT_DIR}/include/Utils/Shaders/*.vert
${CGoGN_ROOT_DIR}/include/Utils/Shaders/*.geom
)
IF(WIN32)
add_custom_target(shader_target ${CGoGN_ROOT_DIR}/ThirdParty/bin/Release/shader_to_h ${shaders_src}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
SOURCES ${shaders_src} )
ELSE()
add_custom_target(shader_target ${CGoGN_ROOT_DIR}/ThirdParty/bin/shader_to_h ${shaders_src}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
SOURCES ${shaders_src} )
ENDIF()
file(
GLOB # WARNING NO MORE RECURSE TO AVOID TAKING QT FILES
files_utils
${CGoGN_ROOT_DIR}/src/Utils/*.cpp
${CGoGN_ROOT_DIR}/include/Utils/*.hpp
${CGoGN_ROOT_DIR}/include/Utils/*.h
${CGoGN_ROOT_DIR}/src/Utils/Shaders/*.cpp
${CGoGN_ROOT_DIR}/include/Utils/Shaders/*.hpp
${CGoGN_ROOT_DIR}/include/Utils/Shaders/*.h
)
IF(WITH_QT)
file(
GLOB
files_utils_qt
${CGoGN_ROOT_DIR}/src/Utils/Qt/*.cpp
${CGoGN_ROOT_DIR}/include/Utils/Qt/*.hpp
${CGoGN_ROOT_DIR}/include/Utils/Qt/*.h
)
file(
GLOB
utils_qt_headers
${CGoGN_ROOT_DIR}/include/Utils/Qt/qtgl.h
${CGoGN_ROOT_DIR}/include/Utils/Qt/qtSimple.h
${CGoGN_ROOT_DIR}/include/Utils/Qt/qtQGLV_glw.h
${CGoGN_ROOT_DIR}/include/Utils/Qt/qtQGLV.h
${CGoGN_ROOT_DIR}/include/Utils/Qt/qtpopup.h
${CGoGN_ROOT_DIR}/include/Utils/Qt/qthistodraw.h
${CGoGN_ROOT_DIR}/include/Utils/Qt/qtcolorschooser.h
)
QT4_WRAP_CPP(UTILS_QT_HEADERS_MOC ${utils_qt_headers})
SET (files_utils_withQt ${files_utils} ${files_utils_qt} ${UTILS_QT_HEADERS_MOC})
ENDIF()
file( GLOB_RECURSE
files_geometry
${CGoGN_ROOT_DIR}/include/Geometry/*.h
${CGoGN_ROOT_DIR}/include/Geometry/*.hpp
)
file( GLOB_RECURSE