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) 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 # FOR Qt4
SET(QT_USE_QTOPENGL TRUE) SET(QT_USE_QTOPENGL TRUE)
INCLUDE(${QT_USE_FILE}) INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(${QT_DEFINITIONS})
SET(CGoGN_LIBS_R topology algo container utils) SET(CGoGN_LIBS_R topology algo container utils)
IF(WIN32) IF(WIN32)
SET(CGoGN_LIBS_D topology algo container utils) # libs have same name but in different place in Visual 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/Release)
add_subdirectory(Examples/Tests)
add_subdirectory(Tuto) add_subdirectory(Tuto)
ELSE(WIN32) ELSE(WIN32)
SET(CGoGN_LIBS_D topologyD algoD containerD utilsD) SET(CGoGN_LIBS_D topologyD algoD containerD utilsD)
......
...@@ -19,7 +19,6 @@ link_directories( ...@@ -19,7 +19,6 @@ link_directories(
IF(WIN32) IF(WIN32)
link_directories( ${CGoGN_ROOT_DIR}/lib/$(ConfigurationName) ${Boost_LIBRARY_DIRS}) link_directories( ${CGoGN_ROOT_DIR}/lib/$(ConfigurationName) ${Boost_LIBRARY_DIRS})
ELSE(WIN32) ELSE(WIN32)
link_directories( ${CGoGN_ROOT_DIR}/lib/Debug ${CGoGN_ROOT_DIR}/lib/Release ) link_directories( ${CGoGN_ROOT_DIR}/lib/Debug ${CGoGN_ROOT_DIR}/lib/Release )
ENDIF(WIN32) ENDIF(WIN32)
...@@ -28,47 +27,47 @@ ENDIF(WIN32) ...@@ -28,47 +27,47 @@ ENDIF(WIN32)
QT4_WRAP_CPP(polyhedronsView_moc ../polyhedronsView.h) QT4_WRAP_CPP(polyhedronsView_moc ../polyhedronsView.h)
add_executable( polyhedronsViewD ../polyhedronsView.cpp ${polyhedronsView_moc}) add_executable( polyhedronsViewD ../polyhedronsView.cpp ${polyhedronsView_moc})
target_link_libraries( polyhedronsViewD 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) QT4_WRAP_CPP(frame_manip_moc ../frame_manip.h)
add_executable( frame_manipD ../frame_manip.cpp ${frame_manip_moc}) add_executable( frame_manipD ../frame_manip.cpp ${frame_manip_moc})
target_link_libraries( frame_manipD 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) QT4_WRAP_CPP(texturesExample_moc ../texturesExample.h)
add_executable( texturesExampleD ../texturesExample.cpp ${texturesExample_moc} ) add_executable( texturesExampleD ../texturesExample.cpp ${texturesExample_moc} )
target_link_libraries( texturesExampleD target_link_libraries( texturesExampleD
${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES} ) ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
QT4_WRAP_CPP(simpleMap3_moc ../simpleMap3.h) QT4_WRAP_CPP(simpleMap3_moc ../simpleMap3.h)
add_executable( simpleMap3D ../simpleMap3.cpp ${simpleMap3_moc} ) add_executable( simpleMap3D ../simpleMap3.cpp ${simpleMap3_moc} )
target_link_libraries( simpleMap3D target_link_libraries( simpleMap3D
${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES} ) ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
QT4_WRAP_CPP(simpleGMap2_moc ../simpleGMap2.h) QT4_WRAP_CPP(simpleGMap2_moc ../simpleGMap2.h)
add_executable( simpleGMap2D ../simpleGMap2.cpp ${simpleGMap2_moc} ) add_executable( simpleGMap2D ../simpleGMap2.cpp ${simpleGMap2_moc} )
target_link_libraries( simpleGMap2D target_link_libraries( simpleGMap2D
${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES} ) ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
QT4_WRAP_CPP(simpleGMap3_moc ../simpleGMap3.h) QT4_WRAP_CPP(simpleGMap3_moc ../simpleGMap3.h)
add_executable( simpleGMap3D ../simpleGMap3.cpp ${simpleGMap3_moc} ) add_executable( simpleGMap3D ../simpleGMap3.cpp ${simpleGMap3_moc} )
target_link_libraries( simpleGMap3D target_link_libraries( simpleGMap3D
${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES} ) ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
QT4_WRAP_CPP(extrusionView_moc ../extrusionView.h) QT4_WRAP_CPP(extrusionView_moc ../extrusionView.h)
add_executable( extrusionViewD ../extrusionView.cpp ${extrusionView_moc}) add_executable( extrusionViewD ../extrusionView.cpp ${extrusionView_moc})
target_link_libraries( extrusionViewD 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_UI( viewer_ui ../viewer.ui )
QT4_WRAP_CPP( viewer_moc ../viewer.h ) QT4_WRAP_CPP( viewer_moc ../viewer.h )
add_executable( viewerD ../viewer.cpp ${viewer_moc} ${viewer_ui}) add_executable( viewerD ../viewer.cpp ${viewer_moc} ${viewer_ui})
target_link_libraries( viewerD 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_UI( clipping_ui ../clipping.ui )
QT4_WRAP_CPP( clipping_moc ../clipping.h ) QT4_WRAP_CPP( clipping_moc ../clipping.h )
add_executable( clippingD ../clipping.cpp ${clipping_ui} ${clipping_moc}) add_executable( clippingD ../clipping.cpp ${clipping_ui} ${clipping_moc})
target_link_libraries( clippingD target_link_libraries( clippingD
${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES} ) ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
...@@ -26,42 +26,42 @@ ENDIF(WIN32) ...@@ -26,42 +26,42 @@ ENDIF(WIN32)
QT4_WRAP_CPP(polyhedronsView_moc ../polyhedronsView.h) QT4_WRAP_CPP(polyhedronsView_moc ../polyhedronsView.h)
add_executable( polyhedronsView ../polyhedronsView.cpp ${polyhedronsView_moc}) add_executable( polyhedronsView ../polyhedronsView.cpp ${polyhedronsView_moc})
target_link_libraries( polyhedronsView 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) QT4_WRAP_CPP(frame_manip_moc ../frame_manip.h)
add_executable( frame_manip ../frame_manip.cpp ${frame_manip_moc}) add_executable( frame_manip ../frame_manip.cpp ${frame_manip_moc})
target_link_libraries( frame_manip 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) QT4_WRAP_CPP(texturesExample_moc ../texturesExample.h)
add_executable( texturesExample ../texturesExample.cpp ${texturesExample_moc} ) add_executable( texturesExample ../texturesExample.cpp ${texturesExample_moc} )
target_link_libraries( texturesExample target_link_libraries( texturesExample
${CGoGN_LIBS_R} ${COMMON_LIBS} ${QT_LIBRARIES} ) ${CGoGN_LIBS_R} ${CGoGN_EXT_LIBS} )
QT4_WRAP_CPP(simpleGMap2_moc ../simpleGMap2.h) QT4_WRAP_CPP(simpleGMap2_moc ../simpleGMap2.h)
add_executable( simpleGMap2 ../simpleGMap2.cpp ${simpleGMap2_moc} ) add_executable( simpleGMap2 ../simpleGMap2.cpp ${simpleGMap2_moc} )
target_link_libraries( simpleGMap2 target_link_libraries( simpleGMap2
${CGoGN_LIBS_R} ${COMMON_LIBS} ${QT_LIBRARIES} ) ${CGoGN_LIBS_R} ${CGoGN_EXT_LIBS} )
QT4_WRAP_CPP(simpleGMap3_moc ../simpleGMap3.h) QT4_WRAP_CPP(simpleGMap3_moc ../simpleGMap3.h)
add_executable( simpleGMap3 ../simpleGMap3.cpp ${simpleGMap3_moc} ) add_executable( simpleGMap3 ../simpleGMap3.cpp ${simpleGMap3_moc} )
target_link_libraries( simpleGMap3 target_link_libraries( simpleGMap3
${CGoGN_LIBS_R} ${COMMON_LIBS} ${QT_LIBRARIES} ) ${CGoGN_LIBS_R} ${CGoGN_EXT_LIBS} )
QT4_WRAP_CPP(extrusionView_moc ../extrusionView.h) QT4_WRAP_CPP(extrusionView_moc ../extrusionView.h)
add_executable( extrusionView ../extrusionView.cpp ${extrusionView_moc}) add_executable( extrusionView ../extrusionView.cpp ${extrusionView_moc})
target_link_libraries( extrusionView 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_UI( viewer_ui ../viewer.ui )
QT4_WRAP_CPP( viewer_moc ../viewer.h ) QT4_WRAP_CPP( viewer_moc ../viewer.h )
add_executable( viewer ../viewer.cpp ${viewer_moc} ${viewer_ui}) add_executable( viewer ../viewer.cpp ${viewer_moc} ${viewer_ui})
target_link_libraries( viewer 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_UI( clipping_ui ../clipping.ui )
QT4_WRAP_CPP( clipping_moc ../clipping.h ) QT4_WRAP_CPP( clipping_moc ../clipping.h )
add_executable( clipping ../clipping.cpp ${clipping_ui} ${clipping_moc}) add_executable( clipping ../clipping.cpp ${clipping_ui} ${clipping_moc})
target_link_libraries( clipping target_link_libraries( clipping
${CGoGN_LIBS_R} ${COMMON_LIBS} ${QT_LIBRARIES} ) ${CGoGN_LIBS_R} ${CGoGN_EXT_LIBS} )
...@@ -4,28 +4,21 @@ project(geometryAssertD) ...@@ -4,28 +4,21 @@ project(geometryAssertD)
SET(CMAKE_BUILD_TYPE Debug) 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 # FOR Qt4
FIND_PACKAGE(Qt4 REQUIRED)
SET(QT_USE_QTOPENGL TRUE) SET(QT_USE_QTOPENGL TRUE)
INCLUDE(${QT_USE_FILE}) INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(${QT_DEFINITIONS})
# define includes path
include_directories( include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CGoGN_ROOT_DIR}/include ${CGoGN_ROOT_DIR}/include
/usr/include/libxml2/ ${CGoGN_EXT_INCLUDES}
${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
) )
# define libs path # define libs path
link_directories( link_directories(
${CGoGN_ROOT_DIR}/lib/Debug ${CGoGN_ROOT_DIR}/lib/Debug
...@@ -36,18 +29,18 @@ link_directories( ...@@ -36,18 +29,18 @@ link_directories(
add_executable( Geom_orientationD ./Geom_orientation.cpp) add_executable( Geom_orientationD ./Geom_orientation.cpp)
target_link_libraries( Geom_orientationD target_link_libraries( Geom_orientationD
${CGoGN_LIBS_D} ${COMMON_LIBS} ) ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS})
add_executable( Geom_inclusionD ./Geom_inclusion.cpp) add_executable( Geom_inclusionD ./Geom_inclusion.cpp)
target_link_libraries( Geom_inclusionD target_link_libraries( Geom_inclusionD
${CGoGN_LIBS_D} ${COMMON_LIBS} ) ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS})
add_executable( Geom_intersectionD ./Geom_intersection.cpp) add_executable( Geom_intersectionD ./Geom_intersection.cpp)
target_link_libraries( Geom_intersectionD 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) QT4_WRAP_CPP(concave_rendering_moc concave_rendering.h)
add_executable( concave_renderingD concave_rendering.cpp ${concave_rendering_moc}) add_executable( concave_renderingD concave_rendering.cpp ${concave_rendering_moc})
target_link_libraries( concave_renderingD 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() ...@@ -210,8 +210,6 @@ void TexView::computeImage()
int main(int argc, char**argv) int main(int argc, char**argv)
{ {
ilInit();
// interface: // interface:
QApplication app(argc, argv); QApplication app(argc, argv);
TexView tv; TexView tv;
......
...@@ -6,22 +6,12 @@ project(Tutos) ...@@ -6,22 +6,12 @@ project(Tutos)
SET (CMAKE_BUILD_TYPE Debug) SET (CMAKE_BUILD_TYPE Debug)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOTOPOWARNING") 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( include_directories(
${CMAKE_CURRENT_BINARY_DIR} ${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 ${CGoGN_ROOT_DIR}/include
${Boost_INCLUDE_DIRS} ${CGoGN_EXT_INCLUDES}
) )
# define libs path # define libs path
...@@ -32,48 +22,45 @@ ELSE(WIN32) ...@@ -32,48 +22,45 @@ ELSE(WIN32)
ENDIF(WIN32) ENDIF(WIN32)
# define boost component usage (here only thread)
find_package(Boost COMPONENTS thread REQUIRED)
#define exec to compile #define exec to compile
QT4_WRAP_CPP(tuto1_moc tuto1.h) QT4_WRAP_CPP(tuto1_moc tuto1.h)
add_executable( tuto1 tuto1.cpp ${tuto1_moc}) add_executable( tuto1 tuto1.cpp ${tuto1_moc})
target_link_libraries( tuto1 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_UI( tuto2_ui tuto2.ui )
QT4_WRAP_CPP(tuto2_moc tuto2.h) QT4_WRAP_CPP(tuto2_moc tuto2.h)
add_executable( tuto2 tuto2.cpp tuto2.h ${tuto2_ui} ${tuto2_moc}) add_executable( tuto2 tuto2.cpp tuto2.h ${tuto2_ui} ${tuto2_moc})
target_link_libraries( tuto2 target_link_libraries( tuto2
${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES} ) ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
QT4_WRAP_CPP(tuto3_moc tuto3.h) QT4_WRAP_CPP(tuto3_moc tuto3.h)
add_executable( tuto3 tuto3.cpp ${tuto3_moc}) add_executable( tuto3 tuto3.cpp ${tuto3_moc})
target_link_libraries( tuto3 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_UI( tuto4_ui tuto4.ui )
QT4_WRAP_CPP(tuto4_moc tuto4.h) QT4_WRAP_CPP(tuto4_moc tuto4.h)
add_executable( tuto4 tuto4.cpp ${tuto4_ui} ${tuto4_moc}) add_executable( tuto4 tuto4.cpp ${tuto4_ui} ${tuto4_moc})
target_link_libraries( tuto4 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_UI( tuto5_ui tuto5.ui )
QT4_WRAP_CPP(tuto5_moc tuto5.h) QT4_WRAP_CPP(tuto5_moc tuto5.h)
add_executable( tuto5 tuto5.cpp ${tuto5_ui} ${tuto5_moc}) add_executable( tuto5 tuto5.cpp ${tuto5_ui} ${tuto5_moc})
target_link_libraries( tuto5 target_link_libraries( tuto5
${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES} ) ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
#add_executable( tuto_subdivision tuto_subdivision.cpp) #add_executable( tuto_subdivision tuto_subdivision.cpp)
#target_link_libraries( tuto_subdivision #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) QT4_WRAP_CPP(tp_master_moc tp_master.h)
add_executable( tp_master tp_master.cpp ${tp_master_moc}) add_executable( tp_master tp_master.cpp ${tp_master_moc})
target_link_libraries( tp_master 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) #BOOST_LIBS macro: allow using compiled boost in windows (see readme)
# -first argument variable that will contain the libs # -first argument variable that will contain the libs
...@@ -85,16 +72,16 @@ target_link_libraries( tp_master ...@@ -85,16 +72,16 @@ target_link_libraries( tp_master
QT4_WRAP_CPP(tuto_mt_moc tuto_mt.h) QT4_WRAP_CPP(tuto_mt_moc tuto_mt.h)
add_executable( tuto_mt tuto_mt.cpp ${tuto_mt_moc}) add_executable( tuto_mt tuto_mt.cpp ${tuto_mt_moc})
target_link_libraries( tuto_mt 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) QT4_WRAP_CPP(tuto_ogl3_moc tuto_ogl3.h)
add_executable( tuto_ogl3 tuto_ogl3.cpp ${tuto_ogl3_moc}) add_executable( tuto_ogl3 tuto_ogl3.cpp ${tuto_ogl3_moc})
target_link_libraries( tuto_ogl3 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) #add_executable( tuto_ogl2 tuto_ogl2.cpp)
#target_link_libraries( tuto_ogl2 #target_link_libraries( tuto_ogl2
# ${CGoGN_LIBS_D} ${COMMON_LIBS} ) # ${CGoGN_LIBS_D} ${CGoGN_EXT_LIBS} )
...@@ -6,13 +6,12 @@ project(CGoGN_ThirdParty) ...@@ -6,13 +6,12 @@ project(CGoGN_ThirdParty)
SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/..) SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/..)
SET(CMAKE_BUILD_TYPE Release) SET(CMAKE_BUILD_TYPE Release)
SET ( BUILD_SHARED_LIBRARIES OFF CACHE BOOL # for shared or not shared
"if used all library are build as shared type (.so /dylib/dll)." SET (BUILD_SHARED_LIBS OFF CACHE BOOL
) "if used all library are build as shared type (.so /dylib/dll).")
IF ( BUILD_SHARED_LIBRARIES ) SET (WITH_ASSIMP ON CACHE BOOL "build CGoGN with Assimp")
SET (SHARED_OR_STATIC SHARED) SET (WITH_NUMERICAL ON CACHE BOOL "build CGoGN with numerical libs")
ENDIF ( BUILD_SHARED_LIBRARIES )
IF (APPLE) IF (APPLE)
...@@ -28,9 +27,13 @@ ENDIF(WIN32) ...@@ -28,9 +27,13 @@ ENDIF(WIN32)
add_subdirectory(Zinri Zinri/build) add_subdirectory(Zinri Zinri/build)
add_subdirectory(gzstream gzstream/build) add_subdirectory(gzstream gzstream/build)
add_subdirectory(Numerical Numerical/build)
add_subdirectory(Tools Tools/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) ...@@ -11,7 +11,7 @@ include_directories(METIS UFconfig AMD CAMD COLAMD CCOLAMD CHOLMOD UMFPACK)
IF(APPLE) IF(APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_MACOSX -ObjC++ -D__PLACEMENT_NEW_INLINE") 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(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) ELSE(APPLE)
IF(UNIX) IF(UNIX)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -fno-strict-aliasing -D_UNIX -D__PLACEMENT_NEW_INLINE ") 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) ...@@ -31,5 +31,5 @@ AUX_SOURCE_DIRECTORY(UMFPACK SUB_SOURCES)
SET(SOURCES ${SOURCES} ${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) ...@@ -136,7 +136,7 @@ if(BLAS_COMPLEX16)
endif() endif()
add_library(blas ${SHARED_OR_STATIC} ${ALLOBJ}) add_library(blas ${ALLOBJ})
if(UNIX) if(UNIX)
target_link_libraries(blas m) target_link_libraries(blas m)
endif() endif()
......
...@@ -59,6 +59,6 @@ endif() ...@@ -59,6 +59,6 @@ endif()
include_directories(${CLAPACK_SOURCE_DIR}/F2CLIBS/libf2c) include_directories(${CLAPACK_SOURCE_DIR}/F2CLIBS/libf2c)
include_directories(${CLAPACK_BINARY_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) #set_property(TARGET f2c PROPERTY PREFIX lib)
#pb sous windows avec le prefix lib #pb sous windows avec le prefix lib
...@@ -376,6 +376,6 @@ if(BUILD_COMPLEX16) ...@@ -376,6 +376,6 @@ if(BUILD_COMPLEX16)
set(ALLOBJ ${ZLASRC} ${ALLAUX} ${DZLAUX}) set(ALLOBJ ${ZLASRC} ${ALLAUX} ${DZLAUX})
endif() endif()
add_library(lapack ${SHARED_OR_STATIC} ${ALLOBJ} ${ALLXOBJ}) add_library(lapack ${ALLOBJ} ${ALLXOBJ})
target_link_libraries(lapack blas) target_link_libraries(lapack blas)
...@@ -10,4 +10,4 @@ file( ...@@ -10,4 +10,4 @@ file(
${CMAKE_CURRENT_SOURCE_DIR}/*.c ${CMAKE_CURRENT_SOURCE_DIR}/*.c
) )
add_library( Zinri ${SHARED_OR_STATIC} ${source_files} ) add_library( Zinri ${source_files} )
...@@ -10,4 +10,4 @@ file( ...@@ -10,4 +10,4 @@ file(
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp ${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) ...@@ -2,26 +2,22 @@ cmake_minimum_required(VERSION 2.8)
project(CGoGN) 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(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/..)
SET(CMAKE_MODULE_PATH " ${CMAKE_MODULE_PATH} ${CGoGN_ROOT_DIR}/cmake_modules/") # for GLEW
SET(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)."
)
IF ( BUILD_SHARED_LIBRARIES ) # for shared or not shared
SET (SHARED_OR_STATIC SHARED) SET (BUILD_SHARED_LIBS OFF CACHE BOOL
ENDIF ( BUILD_SHARED_LIBRARIES ) "if used all library are build as shared type (.so /dylib/dll).")
find_package(OpenGL REQUIRED) find_package(OpenGL REQUIRED)
find_package(Qt4 REQUIRED) find_package(Qt4 REQUIRED)
find_package(Boost COMPONENTS regex thread REQUIRED) find_package(Boost COMPONENTS regex thread REQUIRED)
find_package(ZLIB REQUIRED)
find_package(LibXml2 REQUIRED)
find_package(GLEW REQUIRED)
IF (DEFINED ASSERTON) IF (DEFINED ASSERTON)
...@@ -30,8 +26,54 @@ ELSE (DEFINED ASSERTON) ...@@ -30,8 +26,54 @@ ELSE (DEFINED ASSERTON)
add_definitions(-DCGOGN_ASSERT_BOOL=false) add_definitions(-DCGOGN_ASSERT_BOOL=false)
ENDIF (DEFINED ASSERTON) 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/") 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 # qq definition specifiques pour mac
IF(APPLE) IF(APPLE)
# attention a changer pour chercher la bonne version automatiquement # attention a changer pour chercher la bonne version automatiquement
...@@ -42,52 +84,16 @@ IF(APPLE) ...@@ -42,52 +84,16 @@ IF(APPLE)
ENDIF(APPLE) ENDIF(APPLE)
IF(WIN32) 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/) INCLUDE_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/include/)
LINK_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/lib/ ${boost_path}/lib) LINK_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/lib/ ${boost_path}/lib)
add_subdirectory(Release) add_subdirectory(Release)
add_subdirectory(${CGoGN_ROOT_DIR}/Apps Apps) 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) if(CMAKE_CONFIGURATION_TYPES)
set(CMAKE_CONFIGURATION_TYPES Release Debug) set(CMAKE_CONFIGURATION_TYPES Release Debug)
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Only Release or Debug" FORCE) set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Only Release or Debug" FORCE)
endif() endif()
ELSE(WIN32) ELSE(WIN32)