Commit 1fce7ee9 authored by Sylvain Thery's avatar Sylvain Thery

Ajout module CMake FindGLEW

Ajout/Modif option BUILD_SHARED_LIBS
Remplace DevIL par QImage
Ajout option WITH_ASSIMP (BOOL defaut ON)
Ajout option WITH_NUMERICAL dans ThirdParty (BOOL defaut ON)
Option avec -D ou cmake-gui ou ccmake
parent 89a02ff9
SET(EXECUTABLE_OUTPUT_PATH ${CGoGN_ROOT_DIR}/bin)
# define libs
SET (COMMON_LIBS ${OPENGL_LIBRARY} ${GLEW_LIBRARY} ${DEVIL_LIBRARIES} ${ZLIB_LIBRARIES} ${LIBXML2_LIBRARIES} ${Boost_REGEX_LIBRARY} ${Boost_THREAD_LIBRARY} gzstream assimp)
# define includes of external libs
SET(CGoGN_EXT_INCLUDES
${LIBXML2_INCLUDE_DIR}
${CGoGN_ROOT_DIR}/ThirdParty/Numerical
${CGoGN_ROOT_DIR}/ThirdParty/Numerical/UFconfig
${CGoGN_ROOT_DIR}/ThirdParty/gzstream
${CGoGN_ROOT_DIR}/ThirdParty/Zinri
${CGoGN_ROOT_DIR}/ThirdParty/glm
${CGoGN_ROOT_DIR}/ThirdParty/Assimp/include )
# FOR Qt4
SET(QT_USE_QTOPENGL TRUE)
INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS})
SET(CGoGN_LIBS_R topology algo container utils)
IF(WIN32)
SET(CGoGN_LIBS_D topology algo container utils) # libs have same name but in different place in Visual
add_subdirectory(Examples/Release)
add_subdirectory(Examples/Tests)
add_subdirectory(Tuto)
ELSE(WIN32)
SET(CGoGN_LIBS_D topologyD algoD containerD utilsD)
......
......@@ -19,7 +19,6 @@ link_directories(
IF(WIN32)
link_directories( ${CGoGN_ROOT_DIR}/lib/$(ConfigurationName) ${Boost_LIBRARY_DIRS})
ELSE(WIN32)
link_directories( ${CGoGN_ROOT_DIR}/lib/Debug ${CGoGN_ROOT_DIR}/lib/Release )
ENDIF(WIN32)
......@@ -28,47 +27,47 @@ ENDIF(WIN32)
QT4_WRAP_CPP(polyhedronsView_moc ../polyhedronsView.h)
add_executable( polyhedronsViewD ../polyhedronsView.cpp ${polyhedronsView_moc})
target_link_libraries( polyhedronsViewD
${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES} )
${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
QT4_WRAP_CPP(frame_manip_moc ../frame_manip.h)
add_executable( frame_manipD ../frame_manip.cpp ${frame_manip_moc})
target_link_libraries( frame_manipD
${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES} )
${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
QT4_WRAP_CPP(texturesExample_moc ../texturesExample.h)
add_executable( texturesExampleD ../texturesExample.cpp ${texturesExample_moc} )
target_link_libraries( texturesExampleD
${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES} )
${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
QT4_WRAP_CPP(simpleMap3_moc ../simpleMap3.h)
add_executable( simpleMap3D ../simpleMap3.cpp ${simpleMap3_moc} )
target_link_libraries( simpleMap3D
${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES} )
${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
QT4_WRAP_CPP(simpleGMap2_moc ../simpleGMap2.h)
add_executable( simpleGMap2D ../simpleGMap2.cpp ${simpleGMap2_moc} )
target_link_libraries( simpleGMap2D
${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES} )
${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
QT4_WRAP_CPP(simpleGMap3_moc ../simpleGMap3.h)
add_executable( simpleGMap3D ../simpleGMap3.cpp ${simpleGMap3_moc} )
target_link_libraries( simpleGMap3D
${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES} )
${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
QT4_WRAP_CPP(extrusionView_moc ../extrusionView.h)
add_executable( extrusionViewD ../extrusionView.cpp ${extrusionView_moc})
target_link_libraries( extrusionViewD
${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES} )
${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
QT4_WRAP_UI( viewer_ui ../viewer.ui )
QT4_WRAP_CPP( viewer_moc ../viewer.h )
add_executable( viewerD ../viewer.cpp ${viewer_moc} ${viewer_ui})
target_link_libraries( viewerD
${CGoGN_LIBS_D} ${NUMERICAL_LIBS} ${COMMON_LIBS} ${QT_LIBRARIES} )
${CGoGN_LIBS_D} ${NUMERICAL_LIBS} ${CGoGN_EXT_LIBS} )
QT4_WRAP_UI( clipping_ui ../clipping.ui )
QT4_WRAP_CPP( clipping_moc ../clipping.h )
add_executable( clippingD ../clipping.cpp ${clipping_ui} ${clipping_moc})
target_link_libraries( clippingD
${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES} )
${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
......@@ -26,42 +26,42 @@ ENDIF(WIN32)
QT4_WRAP_CPP(polyhedronsView_moc ../polyhedronsView.h)
add_executable( polyhedronsView ../polyhedronsView.cpp ${polyhedronsView_moc})
target_link_libraries( polyhedronsView
${CGoGN_LIBS_R} ${COMMON_LIBS} ${QT_LIBRARIES} )
${CGoGN_LIBS_R} ${CGoGN_EXT_LIBS} )
QT4_WRAP_CPP(frame_manip_moc ../frame_manip.h)
add_executable( frame_manip ../frame_manip.cpp ${frame_manip_moc})
target_link_libraries( frame_manip
${CGoGN_LIBS_R} ${COMMON_LIBS} ${QT_LIBRARIES} )
${CGoGN_LIBS_R} ${CGoGN_EXT_LIBS} )
QT4_WRAP_CPP(texturesExample_moc ../texturesExample.h)
add_executable( texturesExample ../texturesExample.cpp ${texturesExample_moc} )
target_link_libraries( texturesExample
${CGoGN_LIBS_R} ${COMMON_LIBS} ${QT_LIBRARIES} )
${CGoGN_LIBS_R} ${CGoGN_EXT_LIBS} )
QT4_WRAP_CPP(simpleGMap2_moc ../simpleGMap2.h)
add_executable( simpleGMap2 ../simpleGMap2.cpp ${simpleGMap2_moc} )
target_link_libraries( simpleGMap2
${CGoGN_LIBS_R} ${COMMON_LIBS} ${QT_LIBRARIES} )
${CGoGN_LIBS_R} ${CGoGN_EXT_LIBS} )
QT4_WRAP_CPP(simpleGMap3_moc ../simpleGMap3.h)
add_executable( simpleGMap3 ../simpleGMap3.cpp ${simpleGMap3_moc} )
target_link_libraries( simpleGMap3
${CGoGN_LIBS_R} ${COMMON_LIBS} ${QT_LIBRARIES} )
${CGoGN_LIBS_R} ${CGoGN_EXT_LIBS} )
QT4_WRAP_CPP(extrusionView_moc ../extrusionView.h)
add_executable( extrusionView ../extrusionView.cpp ${extrusionView_moc})
target_link_libraries( extrusionView
${CGoGN_LIBS_R} ${COMMON_LIBS} ${QT_LIBRARIES} )
${CGoGN_LIBS_R} ${CGoGN_EXT_LIBS} )
QT4_WRAP_UI( viewer_ui ../viewer.ui )
QT4_WRAP_CPP( viewer_moc ../viewer.h )
add_executable( viewer ../viewer.cpp ${viewer_moc} ${viewer_ui})
target_link_libraries( viewer
${CGoGN_LIBS_R} ${NUMERICAL_LIBS} ${COMMON_LIBS} ${QT_LIBRARIES} )
${CGoGN_LIBS_R} ${NUMERICAL_LIBS} ${CGoGN_EXT_LIBS} )
QT4_WRAP_UI( clipping_ui ../clipping.ui )
QT4_WRAP_CPP( clipping_moc ../clipping.h )
add_executable( clipping ../clipping.cpp ${clipping_ui} ${clipping_moc})
target_link_libraries( clipping
${CGoGN_LIBS_R} ${COMMON_LIBS} ${QT_LIBRARIES} )
${CGoGN_LIBS_R} ${CGoGN_EXT_LIBS} )
......@@ -4,28 +4,21 @@ project(geometryAssertD)
SET(CMAKE_BUILD_TYPE Debug)
#SET (COMMON_LIBS ${GLUT_LIBRARY} ${OPENGL_LIBRARY} ${GLEW_LIBRARY} ${DEVIL_LIBRARIES} ${ZLIB_LIBRARIES} ${LIBXML2_LIBRARIES} gzstream AntTweakBar openctm)
# FOR Qt4
FIND_PACKAGE(Qt4 REQUIRED)
SET(QT_USE_QTOPENGL TRUE)
INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS})
# define includes path
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CGoGN_ROOT_DIR}/include
/usr/include/libxml2/
${CGoGN_ROOT_DIR}/include
${CGoGN_ROOT_DIR}/ThirdParty/Numerical
${CGoGN_ROOT_DIR}/ThirdParty/Numerical/UFconfig
${CGoGN_ROOT_DIR}/ThirdParty/gzstream
${CGoGN_ROOT_DIR}/ThirdParty/Zinri
${CGoGN_ROOT_DIR}/ThirdParty/Assimp/include
${CGoGN_ROOT_DIR}/ThirdParty/glm
${CGoGN_EXT_INCLUDES}
)
# define libs path
link_directories(
${CGoGN_ROOT_DIR}/lib/Debug
......@@ -36,18 +29,18 @@ link_directories(
add_executable( Geom_orientationD ./Geom_orientation.cpp)
target_link_libraries( Geom_orientationD
${CGoGN_LIBS_D} ${COMMON_LIBS} )
${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS})
add_executable( Geom_inclusionD ./Geom_inclusion.cpp)
target_link_libraries( Geom_inclusionD
${CGoGN_LIBS_D} ${COMMON_LIBS} )
${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS})
add_executable( Geom_intersectionD ./Geom_intersection.cpp)
target_link_libraries( Geom_intersectionD
${CGoGN_LIBS_D} ${COMMON_LIBS} )
${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS})
QT4_WRAP_CPP(concave_rendering_moc concave_rendering.h)
add_executable( concave_renderingD concave_rendering.cpp ${concave_rendering_moc})
target_link_libraries( concave_renderingD
${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES} )
${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
......@@ -210,8 +210,6 @@ void TexView::computeImage()
int main(int argc, char**argv)
{
ilInit();
// interface:
QApplication app(argc, argv);
TexView tv;
......
......@@ -6,22 +6,12 @@ project(Tutos)
SET (CMAKE_BUILD_TYPE Debug)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOTOPOWARNING")
# FOR Qt4
FIND_PACKAGE(Qt4 REQUIRED)
SET(QT_USE_QTOPENGL TRUE)
INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS})
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
/usr/include/libxml2/
${CGoGN_ROOT_DIR}/ThirdParty/gzstream
${CGoGN_ROOT_DIR}/ThirdParty/OpenCTM
${CGoGN_ROOT_DIR}/ThirdParty/Assimp/include
${CGoGN_ROOT_DIR}/ThirdParty/glm
${CGoGN_ROOT_DIR}/include
${Boost_INCLUDE_DIRS}
${CGoGN_EXT_INCLUDES}
)
# define libs path
......@@ -32,48 +22,45 @@ ELSE(WIN32)
ENDIF(WIN32)
# define boost component usage (here only thread)
find_package(Boost COMPONENTS thread REQUIRED)
#define exec to compile
QT4_WRAP_CPP(tuto1_moc tuto1.h)
add_executable( tuto1 tuto1.cpp ${tuto1_moc})
target_link_libraries( tuto1
${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES} )
${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
QT4_WRAP_UI( tuto2_ui tuto2.ui )
QT4_WRAP_CPP(tuto2_moc tuto2.h)
add_executable( tuto2 tuto2.cpp tuto2.h ${tuto2_ui} ${tuto2_moc})
target_link_libraries( tuto2
${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES} )
${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
QT4_WRAP_CPP(tuto3_moc tuto3.h)
add_executable( tuto3 tuto3.cpp ${tuto3_moc})
target_link_libraries( tuto3
${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES})
${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
QT4_WRAP_UI( tuto4_ui tuto4.ui )
QT4_WRAP_CPP(tuto4_moc tuto4.h)
add_executable( tuto4 tuto4.cpp ${tuto4_ui} ${tuto4_moc})
target_link_libraries( tuto4
${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES} )
${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
QT4_WRAP_UI( tuto5_ui tuto5.ui )
QT4_WRAP_CPP(tuto5_moc tuto5.h)
add_executable( tuto5 tuto5.cpp ${tuto5_ui} ${tuto5_moc})
target_link_libraries( tuto5
${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES} )
${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
#add_executable( tuto_subdivision tuto_subdivision.cpp)
#target_link_libraries( tuto_subdivision
# ${CGoGN_LIBS_D} ${COMMON_LIBS} )
# ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
QT4_WRAP_CPP(tp_master_moc tp_master.h)
add_executable( tp_master tp_master.cpp ${tp_master_moc})
target_link_libraries( tp_master
${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES} )
${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
#BOOST_LIBS macro: allow using compiled boost in windows (see readme)
# -first argument variable that will contain the libs
......@@ -85,16 +72,16 @@ target_link_libraries( tp_master
QT4_WRAP_CPP(tuto_mt_moc tuto_mt.h)
add_executable( tuto_mt tuto_mt.cpp ${tuto_mt_moc})
target_link_libraries( tuto_mt
${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES} ${Boost_THREAD_LIBRARY})
${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} ${Boost_THREAD_LIBRARY})
QT4_WRAP_CPP(tuto_ogl3_moc tuto_ogl3.h)
add_executable( tuto_ogl3 tuto_ogl3.cpp ${tuto_ogl3_moc})
target_link_libraries( tuto_ogl3
${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES})
${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS})
#add_executable( tuto_ogl2 tuto_ogl2.cpp)
#target_link_libraries( tuto_ogl2
# ${CGoGN_LIBS_D} ${COMMON_LIBS} )
# ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
......@@ -6,13 +6,12 @@ project(CGoGN_ThirdParty)
SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/..)
SET(CMAKE_BUILD_TYPE Release)
SET ( BUILD_SHARED_LIBRARIES OFF CACHE BOOL
"if used all library are build as shared type (.so /dylib/dll)."
)
# for shared or not shared
SET (BUILD_SHARED_LIBS OFF CACHE BOOL
"if used all library are build as shared type (.so /dylib/dll).")
IF ( BUILD_SHARED_LIBRARIES )
SET (SHARED_OR_STATIC SHARED)
ENDIF ( BUILD_SHARED_LIBRARIES )
SET (WITH_ASSIMP ON CACHE BOOL "build CGoGN with Assimp")
SET (WITH_NUMERICAL ON CACHE BOOL "build CGoGN with numerical libs")
IF (APPLE)
......@@ -28,9 +27,13 @@ ENDIF(WIN32)
add_subdirectory(Zinri Zinri/build)
add_subdirectory(gzstream gzstream/build)
add_subdirectory(Numerical Numerical/build)
add_subdirectory(Tools Tools/build)
add_subdirectory(Assimp Assimp/build)
IF (WITH_ASSIMP)
add_subdirectory(Numerical Numerical/build)
ENDIF (WITH_ASSIMP)
IF (WITH_NUMERICAL)
add_subdirectory(Assimp Assimp/build)
ENDIF (WITH_NUMERICAL)
......@@ -11,7 +11,7 @@ include_directories(METIS UFconfig AMD CAMD COLAMD CCOLAMD CHOLMOD UMFPACK)
IF(APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_MACOSX -ObjC++ -D__PLACEMENT_NEW_INLINE")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_MACOSX -O3 -fno-strict-aliasing")
SET(PATHSDK "/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks")
SET(PATHSDK "/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks" CACHE STRING)
ELSE(APPLE)
IF(UNIX)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -fno-strict-aliasing -D_UNIX -D__PLACEMENT_NEW_INLINE ")
......@@ -31,5 +31,5 @@ AUX_SOURCE_DIRECTORY(UMFPACK SUB_SOURCES)
SET(SOURCES ${SOURCES} ${SUB_SOURCES})
ADD_LIBRARY(numerical ${SHARED_OR_STATIC} ${SOURCES})
ADD_LIBRARY(numerical ${SOURCES})
......@@ -136,7 +136,7 @@ if(BLAS_COMPLEX16)
endif()
add_library(blas ${SHARED_OR_STATIC} ${ALLOBJ})
add_library(blas ${ALLOBJ})
if(UNIX)
target_link_libraries(blas m)
endif()
......
......@@ -59,6 +59,6 @@ endif()
include_directories(${CLAPACK_SOURCE_DIR}/F2CLIBS/libf2c)
include_directories(${CLAPACK_BINARY_DIR}/F2CLIBS/libf2c)
add_library(f2c ${SHARED_OR_STATIC} ${OFILES} ${CMAKE_CURRENT_BINARY_DIR}/arith.h)
add_library(f2c ${OFILES} ${CMAKE_CURRENT_BINARY_DIR}/arith.h)
#set_property(TARGET f2c PROPERTY PREFIX lib)
#pb sous windows avec le prefix lib
......@@ -376,6 +376,6 @@ if(BUILD_COMPLEX16)
set(ALLOBJ ${ZLASRC} ${ALLAUX} ${DZLAUX})
endif()
add_library(lapack ${SHARED_OR_STATIC} ${ALLOBJ} ${ALLXOBJ})
add_library(lapack ${ALLOBJ} ${ALLXOBJ})
target_link_libraries(lapack blas)
......@@ -10,4 +10,4 @@ file(
${CMAKE_CURRENT_SOURCE_DIR}/*.c
)
add_library( Zinri ${SHARED_OR_STATIC} ${source_files} )
add_library( Zinri ${source_files} )
......@@ -10,4 +10,4 @@ file(
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
)
add_library( gzstream ${SHARED_OR_STATIC} ${source_files} )
add_library( gzstream ${source_files} )
......@@ -2,26 +2,22 @@ cmake_minimum_required(VERSION 2.8)
project(CGoGN)
# a decommenter si on veut voir ce qui se passe a la compilation
#set( CMAKE_VERBOSE_MAKEFILE 1 )
SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/..)
SET(CMAKE_MODULE_PATH " ${CMAKE_MODULE_PATH} ${CGoGN_ROOT_DIR}/cmake_modules/")
SET ( BUILD_SHARED_LIBRARIES OFF CACHE BOOL
"if used all library are build as shared type (.so /dylib/dll)."
)
# for GLEW
SET(CMAKE_MODULE_PATH ${CGoGN_ROOT_DIR}/cmake_modules/)
IF ( BUILD_SHARED_LIBRARIES )
SET (SHARED_OR_STATIC SHARED)
ENDIF ( BUILD_SHARED_LIBRARIES )
# for shared or not shared
SET (BUILD_SHARED_LIBS OFF CACHE BOOL
"if used all library are build as shared type (.so /dylib/dll).")
find_package(OpenGL REQUIRED)
find_package(Qt4 REQUIRED)
find_package(Boost COMPONENTS regex thread REQUIRED)
find_package(ZLIB REQUIRED)
find_package(LibXml2 REQUIRED)
find_package(GLEW REQUIRED)
IF (DEFINED ASSERTON)
......@@ -30,8 +26,54 @@ ELSE (DEFINED ASSERTON)
add_definitions(-DCGOGN_ASSERT_BOOL=false)
ENDIF (DEFINED ASSERTON)
SET ( WITH_ASSIMP ON CACHE BOOL "build CGoGN with Assimp ")
IF (WITH_ASSIMP)
add_definitions(-DWITH_ASSIMP)
ENDIF (WITH_ASSIMP)
# FOR Qt4
SET(QT_USE_QTOPENGL TRUE)
INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS})
add_definitions(-DSHADERPATH="${CGoGN_ROOT_DIR}/lib/Shaders/")
# define includes of external libs
SET(CGoGN_EXT_INCLUDES
${CGoGN_ROOT_DIR}/ThirdParty/Numerical
${CGoGN_ROOT_DIR}/ThirdParty/Numerical/UFconfig
${CGoGN_ROOT_DIR}/ThirdParty/gzstream
${CGoGN_ROOT_DIR}/ThirdParty/Zinri
${CGoGN_ROOT_DIR}/ThirdParty/glm
${CGoGN_ROOT_DIR}/ThirdParty/Assimp/include
${OPENGL_INCLUDE_DIR}
${GLEW_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS}
${LIBXML2_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
${QT_INCLUDE_DIR} )
IF (WITH_ASSIMP)
SET (CGoGN_EXT_INCLUDES ${CGoGN_EXT_INCLUDES} ThirdParty/Assimp/include)
ENDIF (WITH_ASSIMP)
# define libs for external libs
SET (CGoGN_EXT_LIBS
${OPENGL_LIBRARY}
${GLEW_LIBRARIES}
${ZLIB_LIBRARIES}
${LIBXML2_LIBRARIES}
${Boost_REGEX_LIBRARY}
${Boost_THREAD_LIBRARY}
${QT_LIBRARIES}
gzstream)
IF (WITH_ASSIMP)
SET (CGoGN_EXT_LIBS ${CGoGN_EXT_LIBS} assimp)
ENDIF (WITH_ASSIMP)
# qq definition specifiques pour mac
IF(APPLE)
# attention a changer pour chercher la bonne version automatiquement
......@@ -42,52 +84,16 @@ IF(APPLE)
ENDIF(APPLE)
IF(WIN32)
SET(GLEW_LIBRARY glew32)
SET(DEVIL_LIBRARIES DevIL ILU ILUT)
SET(ZLIB_LIBRARIES zlib)
SET(LIBXML2_LIBRARIES xml2)
# MACRO(BOOST_LIBS lib_lists names)
# SET (${lib_lists} "")
# FOREACH(name ${names})
# STRING(REGEX REPLACE "-mt" ${boost_extension} newname ${name})
# SET (${lib_lists} ${${lib_lists}} ${newname} )
# ENDFOREACH(name)
# ENDMACRO(BOOST_LIBS)
# set (BOOST_INCLUDE_PATH ${boost_path})
INCLUDE_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/include/)
LINK_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/lib/ ${boost_path}/lib)
add_subdirectory(Release)
add_subdirectory(${CGoGN_ROOT_DIR}/Apps Apps)
if (EXISTS "${CGoGN_ROOT_DIR}/Perso")
add_subdirectory(${CGoGN_ROOT_DIR}/Perso Perso)
endif (EXISTS "${CGoGN_ROOT_DIR}/Perso")
if(CMAKE_CONFIGURATION_TYPES)
set(CMAKE_CONFIGURATION_TYPES Release Debug)
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Only Release or Debug" FORCE)
endif()
ELSE(WIN32)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
find_package(DevIL)
find_package(ZLIB)
find_package(LibXml2)
SET(GLEW_LIBRARY GLEW)
IF (IL_LIBRARIES)
SET(DEVIL_LIBRARIES ${IL_LIBRARIES} ${ILU_LIBRARIES} ${ILUT_LIBRARIES})
ELSE(IL_LIBRARIES)
SET(DEVIL_LIBRARIES ${IL_LIBRARY} ${ILU_LIBRARY} ${ILUT_LIBRARY})
ENDIF(IL_LIBRARIES)
# MACRO(BOOST_LIBS lib_lists names)
# SET (${lib_lists})
# FOREACH(name ${names})
# SET (${lib_lists} ${${lib_lists}} ${name} )
# ENDFOREACH(name)
# ENDMACRO(BOOST_LIBS)
add_subdirectory(Release)
add_subdirectory(Debug)
add_subdirectory(${CGoGN_ROOT_DIR}/Apps Apps)
......
......@@ -10,7 +10,6 @@ ELSE(WIN32)
SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Debug)
ENDIF(WIN32)
#SET(BUILD_SHARED_LIBS,FALSE)
# FOR Qt4
SET(QT_USE_QTOPENGL TRUE)
......@@ -20,17 +19,11 @@ ADD_DEFINITIONS(${QT_DEFINITIONS})
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
/usr/include/libxml2
${CGoGN_ROOT_DIR}/include
${CGoGN_ROOT_DIR}/ThirdParty/Numerical
${CGoGN_ROOT_DIR}/ThirdParty/AntTweakBar/include
${CGoGN_ROOT_DIR}/ThirdParty/gzstream
${CGoGN_ROOT_DIR}/ThirdParty/Assimp/include
${CGoGN_ROOT_DIR}/ThirdParty/glm
${Boost_INCLUDE_DIRS}
${CGoGN_EXT_INCLUDES}
)
file(
GLOB_RECURSE
files_topology
......@@ -39,7 +32,7 @@ file(
${CGoGN_ROOT_DIR}/include/Topology/*.h
)
add_library(
topologyD ${SHARED_OR_STATIC}
topologyD
${files_topology}
)
......@@ -51,7 +44,7 @@ file(
${CGoGN_ROOT_DIR}/include/Container/*.h
)
add_library(
containerD ${SHARED_OR_STATIC}
containerD
${files_container}
)
......@@ -64,7 +57,7 @@ file(
${CGoGN_ROOT_DIR}/include/Algo/*.h
)
add_library(
algoD ${SHARED_OR_STATIC}
algoD
${files_algo}
)
......@@ -80,21 +73,16 @@ file(
${CGoGN_ROOT_DIR}/include/Utils/Shaders*.geom
)
IF(WIN32)
add_custom_target(shader_targetD ${CGoGN_ROOT_DIR}/bin/shader_to_h ${shaders_srcD}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
SOURCES ${shaders_srcD}
)
ELSE(WIN32)
#IF(WIN32)
add_custom_target(shader_targetD ${CGoGN_ROOT_DIR}/bin/shader_to_h ${shaders_srcD}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
SOURCES ${shaders_srcD}
)
ENDIF(WIN32)
SOURCES ${shaders_srcD} )
#ELSE(WIN32)
#add_custom_target(shader_targetD ${CGoGN_ROOT_DIR}/bin/shader_to_h ${shaders_srcD}
# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
# SOURCES ${shaders_srcD}
#)
#ENDIF(WIN32)
file(
......@@ -116,7 +104,7 @@ QT4_WRAP_CPP(UTILS_QT_HEADERS_MOC ${utils_qt_headers})
SET (files_utils_withQt ${files_utils} ${UTILS_QT_HEADERS_MOC})
add_library(
utilsD ${SHARED_OR_STATIC}
utilsD
${files_utils_withQt}
)
......
......@@ -10,9 +10,6 @@ ELSE(WIN32)
SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOTOPOWARNING")
ENDIF(WIN32)
#SET(BUILD_SHARED_LIBS,FALSE)
# FOR Qt4
SET(QT_USE_QTOPENGL TRUE)
......@@ -22,15 +19,8 @@ ADD_DEFINITIONS(${QT_DEFINITIONS})
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
/usr/include/libxml2
${CGoGN_ROOT_DIR}/include
${CGoGN_ROOT_DIR}/ThirdParty/Numerical
${CGoGN_ROOT_DIR}/ThirdParty/AntTweakBar/include
${CGoGN_ROOT_DIR}/ThirdParty/gzstream
${CGoGN_ROOT_DIR}/ThirdParty/Assimp/include
${CGoGN_ROOT_DIR}/ThirdParty/glm
${Boost_INCLUDE_DIRS}
${CGoGN_EXT_INCLUDES}
)
file(
......@@ -41,7 +31,7 @@ file(
${CGoGN_ROOT_DIR}/include/Topology/*.h
)
add_library(
topology ${SHARED_OR_STATIC}
topology
${files_topology}
)
......@@ -53,7 +43,7 @@ file(
${CGoGN_ROOT_DIR}/include/Container/*.h
)
add_library(
container ${SHARED_OR_STATIC}
container
${files_container}
)
......@@ -66,7 +56,7 @@ file(
${CGoGN_ROOT_DIR}/include/Algo/*.h
)
add_library(
algo ${SHARED_OR_STATIC}
algo
${files_algo}
)
......@@ -129,7 +119,7 @@ QT4_WRAP_CPP(UTILS_QT_HEADERS_MOC ${utils_qt_headers})
SET (files_utils_withQt ${files_utils} ${UTILS_QT_HEADERS_MOC})
add_library(
utils ${SHARED_OR_STATIC}
utils
${files_utils_withQt}
)
......
# - Find GLEW
# Find the GLEW includes and library
#
# GLEW_INCLUDE_DIRS - where to find glew.h, etc.
# GLEW_LIBRARIES - List of libraries when using GLEW.
# GLEW_FOUND - True if GLEW found.
FIND_PATH(GLEW_INCLUDE_DIR NAMES GL/glew.h)
SET(GLEW_NAMES GLEW glew32)
FIND_LIBRARY(GLEW_LIBRARY NAMES ${GLEW_NAMES} )
MARK_AS_ADVANCED(GLEW_LIBRARY GLEW_INCLUDE_DIR)
# handle the QUIETLY and REQUIRED arguments and set GLEW_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLEW DEFAULT_MSG GLEW_INCLUDE_DIR GLEW_LIBRARY)
IF (GLEW_FOUND)
SET(GLEW_INCLUDE_DIRS ${GLEW_INCLUDE_DIR})
SET(GLEW_LIBRARIES ${GLEW_LIBRARY})
ENDIF()
<
......@@ -34,9 +34,11 @@
#include "Geometry/vector_gen.h"
#include "Geometry/matrix.h"
#ifdef WITH_ASSIMP
#include "gzstream.h"
#include "assimp.h"
#include "aiScene.h"
#endif
namespace CGoGN
{
......@@ -82,7 +84,9 @@ protected: