Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
David Cazier
CGoGN
Commits
f5529246
Commit
f5529246
authored
Jul 15, 2014
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Visual compilation
parent
6fd95536
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
55 additions
and
64 deletions
+55
-64
Apps/CMakeLists.txt
Apps/CMakeLists.txt
+7
-17
README_VISUAL.TXT
README_VISUAL.TXT
+14
-21
ThirdParty/CMakeLists.txt
ThirdParty/CMakeLists.txt
+15
-10
apps_cmake.txt
apps_cmake.txt
+10
-7
include/Container/convert.h
include/Container/convert.h
+1
-1
src/Utils/Shaders/shaderWallPaper.cpp
src/Utils/Shaders/shaderWallPaper.cpp
+4
-4
src/Utils/pickables.cpp
src/Utils/pickables.cpp
+4
-4
No files found.
Apps/CMakeLists.txt
View file @
f5529246
...
...
@@ -6,28 +6,18 @@ ELSE (ONELIB)
ENDIF
(
ONELIB
)
#IF(${CMAKE_BUILD_TYPE} MATCHES Release|release|RELEASE)
# SET(CGoGN_LIBS ${CGoGN_LIBS_R})
#ELSE()
# SET(CGoGN_LIBS ${CGoGN_LIBS_D})
#ENDIF()
#IF(WIN32)
# link_directories(${CGoGN_ROOT_DIR}/lib/$(ConfigurationName)
# ${Boost_LIBRARY_DIRS})
#ELSE(WIN32)
SET
(
EXECUTABLE_OUTPUT_PATH
${
CGoGN_ROOT_DIR
}
/bin/
${
CMAKE_BUILD_TYPE
}
)
link_directories
(
${
CGoGN_ROOT_DIR
}
/lib/
${
CMAKE_BUILD_TYPE
}
)
IF
(
WIN32
)
link_directories
(
${
CGoGN_ROOT_DIR
}
/lib/
${
ConfigurationName
}
${
Boost_LIBRARY_DIRS
}
)
SET
(
EXECUTABLE_OUTPUT_PATH
${
CGoGN_ROOT_DIR
}
/bin/
)
# Release/Debug added automatically by visual
ELSE
()
link_directories
(
${
CGoGN_ROOT_DIR
}
/lib/
${
CMAKE_BUILD_TYPE
}
)
SET
(
EXECUTABLE_OUTPUT_PATH
${
CGoGN_ROOT_DIR
}
/bin/
${
CMAKE_BUILD_TYPE
}
)
ENDIF
()
include_directories
(
${
CGoGN_ROOT_DIR
}
/include
${
CGoGN_EXT_INCLUDES
}
)
IF
(
COMPILE_SANDBOX
)
add_subdirectory
(
SandBox
)
ENDIF
()
...
...
README_VISUAL.TXT
View file @
f5529246
*** english version below ***
*** english version below ***
Compilation sous VisualExpress C++
Prérequis:
Visual Studio ou C++ Express
(testé avec 2010 express)
Visual Studio ou C++ Express
2013 (C++11
CMake (au moins 2.8)
Unziper le windows_dependencies.zip (http://iggservis.u-strasbg.fr/Data/) a la racine de CGoGN
...
...
@@ -11,32 +11,27 @@ Installer boost et Qt (4.8.x pas de 5.0 pour le moment)
Attention installer les binaires de Qt dans une version de compilateur differente (VS2008/VS2010)
permet d'executer mais pas de debugger !
Si vous utiliser BoostPro (http://www.boostpro.com) installer toutes les versions multithread dll
pour eviter les pb de compilation.
Le plus sur mais plus long est de compiler soi-même Qt et Boost (bon courage)
Pour les "ThirdParty libs":
Lancer CMake (gui)
Mettre le chemin de la racine de CGoGN + /ThirdParty pour les sources
Mettre le chemin de la racine de CGoGN + /ThirdParty/build pour le build en release
Mettre le chemin de la racine de CGoGN + /ThirdParty/buildDebug pour le build en debug
Sous windows les 2 versions sont nécessaires.
Mettre le chemin de la racine de CGoGN + /ThirdParty/build
La suite vaut pour les 2 répertoires:
Cliquer sur Configure
Choisir le bon compilateur (celui de votre version de Visual C++)
Modifier les variables en fonctions de ce que vous voulez compiler (README.TXT de ThirdParty)
Modifier le CMAKE_PREFIX_PATH si nécessaire (cf remarque dépendances)
Recliquer sur Configure
Cliquer sur Generate
Aller sous visual, charger et compiler
les 2 solutions
Aller sous visual, charger et compiler
en Release et Debug
Ne pas oublier de générer la cible INSTALL (une seule fois)
Pour CGoGN:
Relancer CMake
Mettre le chemin de la racine de CGoGN pour les sources
Mettre le chemin de la racine de CGoGN + /build
(par exemple)
pour le build
Mettre le chemin de la racine de CGoGN + /build pour le build
Cliquer sur Configure
Choisir le bon compilateur (celui de votre version de Visual C++)
Modifier les variables comme pour ThirdParty (et CMAKE_PREFIX_PATH si nécessaire)
...
...
@@ -44,6 +39,7 @@ Recliquer sur Configure
Cliquer sur Generate
Si il ne trouve pas Qt lui remplir la variable QT_QMAKE_EXECUTABLE
Si il ne trouve pas boost, remplir la variable Boost_INCLUDE_DIR (C:\Boost1.55\include par exemple)
Aller dans Visual et double-cliquer sur CGoGN.sln !!
...
...
@@ -61,7 +57,6 @@ Si vous voulez utiliser vos propre versions des dépendance (Zlib / glew / Boost
changer le CMAKE_PREFIX_PATH (voir ci dessous)
Attention pour Boost le prefix path ne marche pas (utiliser BOOST_ROOT et d'autres si nécessaire)
Compilation 64bits: TODO
...
...
@@ -81,34 +76,28 @@ Install boost and Qt
Warning installing the binaries of Qt in a version of different compilers (VS2008/VS2010)
allows you to run but not in debug mode!
If you use BoostPro (http://www.boostpro.com) install all versions multithreaded dll
to avoid the pb of compilation.
The safest but longest is to compile Qt yourself and Boost (good luck)
For the "ThirdParty libs"
Run CMake (gui)
Put the path to the root of CGoGN + / ThirdParty sources for
Put the path to the root of CGoGN + / ThirdParty / build to build in release
Put the path to the root of CGoGN + / ThirdParty / buildDebug to build in debug
Under windows the two versions are needed.
Put the path to the root of CGoGN + / ThirdParty sources for sources
Put the path to the root of CGoGN + / ThirdParty / build for build
The following applies to two directories:
Click on Configure
Choosing the right compiler (your version of Visual C + +)
Change the variables in functions that you want to compile (README.TXT for ThirdParty)
Edit CMAKE_PREFIX_PATH if necessary (see note dependencies)
Click again on Configure
Click on Generate
Go on visual, load and compile the
2
solution
s
Go on visual, load and compile the solution
in Release and Debug
Do not forgot to generate the target INSTALL (once)
For CGoGN:
Restart CMake
Put the path to the root of CGoGN for sources
Put the path to the root of CGoGN + / build
(for example)
to build
Put the path to the root of CGoGN + / build to build
Click on Configure
Choosing the right compiler (your version of Visual C + +)
Change the variables as ThirdParty (and CMAKE_PREFIX_PATH if necessary)
...
...
@@ -116,6 +105,10 @@ Click again on Configure
Click on Generate
Go to Visual and double-click on CGoGN.sln!
If it does not found Qt fill the QT_QMAKE_EXECUTABLE variable.
If it does not found boost, fill the Boost_INCLUDE_DIR variable (C:\Boost1.55\include for example)
WARNING: Problem of linking with QGLViewer in Debug
If you compile an example (tuto1 & viewer) in Debug you have to modifiy
the project: Configuration properties -> Linking Editor -> Entries -> Supplementary dependencies
...
...
ThirdParty/CMakeLists.txt
View file @
f5529246
cmake_minimum_required
(
VERSION 2.
6
)
cmake_minimum_required
(
VERSION 2.
8
)
project
(
CGoGN_ThirdParty
)
SET
(
CGoGN_ROOT_DIR
${
CMAKE_SOURCE_DIR
}
/..
)
IF
(
WIN32
)
set
(
CMAKE_PREFIX_PATH
${
CGoGN_ROOT_DIR
}
/windows_dependencies CACHE STRING
"path to dependencies"
)
ENDIF
(
WIN32
)
IF
(
${
CMAKE_CURRENT_BINARY_DIR
}
MATCHES
"(.*)Debug"
)
# SET(CMAKE_BUILD_TYPE Debug)
set
(
CMAKE_BUILD_TYPE
"Debug"
CACHE STRING
"Debug/Release"
FORCE
)
ELSE
()
# SET(CMAKE_BUILD_TYPE Release)
set
(
CMAKE_BUILD_TYPE
"Release"
CACHE STRING
"Debug/Release"
FORCE
)
ENDIF
()
IF
(
WIN32
)
set
(
CMAKE_PREFIX_PATH
${
CGoGN_ROOT_DIR
}
/windows_dependencies CACHE STRING
"path to dependencies"
)
INCLUDE_DIRECTORIES
(
${
CGoGN_ROOT_DIR
}
/windows_dependencies/include/
)
INCLUDE_DIRECTORIES
(
${
CGoGN_ROOT_DIR
}
/windows_dependencies/include/suitesparse
)
SET
(
LIBRARY_OUTPUT_PATH
${
CGoGN_ROOT_DIR
}
/lib
)
set
(
CMAKE_CONFIGURATION_TYPES Release Debug
)
# SET(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE})
# SET(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "" FORCE)
# MARK_AS_ADVANCED(CMAKE_CONFIGURATION_TYPES)
ELSE
()
SET
(
LIBRARY_OUTPUT_PATH
${
CGoGN_ROOT_DIR
}
/lib/
${
CMAKE_BUILD_TYPE
}
)
ENDIF
()
IF
(
WIN32
)
ENDIF
(
WIN32
)
SET
(
LIBRARY_OUTPUT_PATH
${
CGoGN_ROOT_DIR
}
/lib/
${
CMAKE_BUILD_TYPE
}
)
# for shared or not shared
SET
(
BUILD_SHARED_LIBS OFF CACHE BOOL
...
...
@@ -59,8 +68,4 @@ IF (WITH_ASSIMP)
ENDIF
(
WITH_ASSIMP
)
IF
(
WIN32
)
SET
(
CMAKE_CONFIGURATION_TYPES
${
CMAKE_BUILD_TYPE
}
)
SET
(
CMAKE_CONFIGURATION_TYPES
"
${
CMAKE_CONFIGURATION_TYPES
}
"
CACHE STRING
""
FORCE
)
MARK_AS_ADVANCED
(
CMAKE_CONFIGURATION_TYPES
)
ENDIF
(
WIN32
)
apps_cmake.txt
View file @
f5529246
...
...
@@ -116,7 +116,7 @@ IF(WIN32)
set(CMAKE_PREFIX_PATH ${CGoGN_ROOT_DIR}/windows_dependencies CACHE STRING "path to dependencies")
set(CMAKE_CONFIGURATION_TYPES Release Debug)
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Only Release or Debug" FORCE)
ELSE(
WIN32
)
ELSE()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -fPIC -std=c++11")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg")
...
...
@@ -125,17 +125,20 @@ ELSE(WIN32)
if (GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-local-typedefs")
endif(GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
endif(CMAKE_COMPILER_IS_GNUCXX)
ENDIF(WIN32)
endif()
endif()
ENDIF()
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE})
IF(WIN32)
link_directories( ${CGoGN_ROOT_DIR}/lib/ ${Boost_LIBRARY_DIRS} )
ELSE (WIN32)
link_directories( ${CGoGN_ROOT_DIR}/lib/${ConfigurationName} ${Boost_LIBRARY_DIRS})
SET(EXECUTABLE_OUTPUT_PATH ${CGoGN_ROOT_DIR}/bin/) # Release/Debug added automatically by visual
ELSE ()
link_directories( ${CGoGN_ROOT_DIR}/lib/${CMAKE_BUILD_TYPE})
ENDIF (WIN32)
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE})
ENDIF ()
IF(NOT CMAKE_BUILD_TYPE)
IF (${CMAKE_CURRENT_BINARY_DIR} MATCHES "(.*)Debug|(.*)debug")
...
...
include/Container/convert.h
View file @
f5529246
...
...
@@ -354,7 +354,7 @@ public:
for
(
unsigned
int
i
=
0
;
i
<
m_nb
;
++
i
)
{
const
Geom
::
Vec3d
&
vd
=
*
typedIn
++
;
*
typedOut
++
=
Geom
::
Vec3f
(
vd
[
0
],
vd
[
1
],
vd
[
2
]);
*
typedOut
++
=
Geom
::
Vec3f
(
float
(
vd
[
0
]),
float
(
vd
[
1
]),
float
(
vd
[
2
])
)
;
// Geom::Vec3f& vf = *typedOut++;
// vf[0]=vd[0];vf[1]=vd[1];vf[2]=vd[2];
}
...
...
src/Utils/Shaders/shaderWallPaper.cpp
View file @
f5529246
...
...
@@ -53,10 +53,10 @@ ShaderWallPaper::ShaderWallPaper():
m_vboPos
->
allocate
(
4
);
Geom
::
Vec3f
*
ptrPos
=
reinterpret_cast
<
Geom
::
Vec3f
*>
(
m_vboPos
->
lockPtr
());
ptrPos
[
0
]
=
Geom
::
Vec3f
(
-
1
,
-
1
,
0.9999999
);
ptrPos
[
1
]
=
Geom
::
Vec3f
(
1
,
-
1
,
0.9999999
);
ptrPos
[
2
]
=
Geom
::
Vec3f
(
1
,
1
,
0.9999999
);
ptrPos
[
3
]
=
Geom
::
Vec3f
(
-
1
,
1
,
0.9999999
);
ptrPos
[
0
]
=
Geom
::
Vec3f
(
-
1
,
-
1
,
0.9999999
f
);
ptrPos
[
1
]
=
Geom
::
Vec3f
(
1
,
-
1
,
0.9999999
f
);
ptrPos
[
2
]
=
Geom
::
Vec3f
(
1
,
1
,
0.9999999
f
);
ptrPos
[
3
]
=
Geom
::
Vec3f
(
-
1
,
1
,
0.9999999
f
);
m_vboPos
->
releasePtr
();
...
...
src/Utils/pickables.cpp
View file @
f5529246
...
...
@@ -422,14 +422,14 @@ void Sphere::changeTopo(unsigned int parp, unsigned int mer)
for
(
unsigned
int
i
=
0
;
i
<
parAll
;
++
i
)
{
float
beta
=
float
(
i
+
1
)
*
M_PI
/
float
(
parAll
+
1
);
float
beta
=
float
(
i
+
1
)
*
float
(
M_PI
)
/
float
(
parAll
+
1
);
float
z
=
-
cos
(
beta
);
float
radius
=
sin
(
beta
);
for
(
unsigned
int
j
=
0
;
j
<
merAll
;
++
j
)
{
float
alpha
=
2.0
f
*
float
(
j
)
*
M_PI
/
float
(
merAll
);
float
alpha
=
2.0
f
*
float
(
j
)
*
float
(
M_PI
)
/
float
(
merAll
);
float
x
=
radius
*
cos
(
alpha
);
float
y
=
radius
*
sin
(
alpha
);
points
.
push_back
(
Geom
::
Vec3f
(
x
,
y
,
z
));
...
...
@@ -555,7 +555,7 @@ void Cone::changeTopo(unsigned int par, unsigned int mer)
for
(
unsigned
int
j
=
0
;
j
<
merAll
;
++
j
)
{
float
alpha
=
2.0
f
*
float
(
j
)
*
M_PI
/
float
(
merAll
);
float
alpha
=
2.0
f
*
float
(
j
)
*
float
(
M_PI
)
/
float
(
merAll
);
float
x
=
radius
*
cos
(
alpha
);
float
y
=
radius
*
sin
(
alpha
);
points
.
push_back
(
Geom
::
Vec3f
(
x
,
y
,
z
));
...
...
@@ -689,7 +689,7 @@ void Cylinder::changeTopo(unsigned int parp, unsigned int mer)
for
(
unsigned
int
j
=
0
;
j
<
merAll
;
++
j
)
{
float
alpha
=
2.0
f
*
float
(
j
)
*
M_PI
/
float
(
merAll
);
float
alpha
=
2.0
f
*
float
(
j
)
*
float
(
M_PI
)
/
float
(
merAll
);
float
x
=
cos
(
alpha
);
float
y
=
sin
(
alpha
);
points
.
push_back
(
Geom
::
Vec3f
(
x
,
y
,
z
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment