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

Mise en place compilation sans Qt

parent 1fce7ee9
...@@ -10,9 +10,9 @@ SET(CMAKE_BUILD_TYPE Release) ...@@ -10,9 +10,9 @@ SET(CMAKE_BUILD_TYPE Release)
SET (BUILD_SHARED_LIBS OFF CACHE BOOL SET (BUILD_SHARED_LIBS OFF CACHE BOOL
"if used all library are build as shared type (.so /dylib/dll).") "if used all library are build as shared type (.so /dylib/dll).")
SET (WITH_ASSIMP ON CACHE BOOL "build CGoGN with Assimp") SET (WITH_ASSIMP ON CACHE BOOL "build with Assimp")
SET (WITH_NUMERICAL ON CACHE BOOL "build CGoGN with numerical libs") SET (WITH_NUMERICAL ON CACHE BOOL "build with numerical libs")
SET (WITH_ZINRI ON CACHE BOOL "build with Zinri libs")
IF (APPLE) IF (APPLE)
SET(CMAKE_OSX_ARCHITECTURES x86_64) SET(CMAKE_OSX_ARCHITECTURES x86_64)
...@@ -25,15 +25,20 @@ ELSE(WIN32) ...@@ -25,15 +25,20 @@ ELSE(WIN32)
SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release) SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release)
ENDIF(WIN32) ENDIF(WIN32)
add_subdirectory(Zinri Zinri/build)
add_subdirectory(gzstream gzstream/build)
add_subdirectory(Tools Tools/build) add_subdirectory(Tools Tools/build)
# add_subdirectory(gzstream gzstream/build)
IF (WITH_ZINRI)
add_subdirectory(Zinri Zinri/build)
ENDIF(WITH_ZINRI)
IF (WITH_ASSIMP) IF (WITH_ASSIMP)
add_subdirectory(Numerical Numerical/build) add_subdirectory(Assimp Assimp/build)
ENDIF (WITH_ASSIMP) ENDIF (WITH_ASSIMP)
IF (WITH_NUMERICAL) IF (WITH_NUMERICAL)
add_subdirectory(Assimp Assimp/build) add_subdirectory(Numerical Numerical/build)
ENDIF (WITH_NUMERICAL) ENDIF (WITH_NUMERICAL)
...@@ -8,12 +8,13 @@ SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/..) ...@@ -8,12 +8,13 @@ SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/..)
SET(CMAKE_MODULE_PATH ${CGoGN_ROOT_DIR}/cmake_modules/) SET(CMAKE_MODULE_PATH ${CGoGN_ROOT_DIR}/cmake_modules/)
# for shared or not shared # for shared or not shared
SET (BUILD_SHARED_LIBS OFF CACHE BOOL SET ( BUILD_SHARED_LIBS OFF CACHE BOOL "if used all library are build as shared type (.so /dylib/dll).")
"if used all library are build as shared type (.so /dylib/dll).") SET ( WITH_ASSIMP ON CACHE BOOL "build CGoGN with Assimp ")
SET ( WITH_NUMERICAL ON CACHE BOOL "build CGoGN with Numerical libs support ")
SET ( WITH_ZINRI ON CACHE BOOL "build CGoGN with Zinri lib ")
SET ( WITH_QT ON CACHE BOOL "build CGoGN with Qt lib ")
find_package(OpenGL REQUIRED) find_package(OpenGL 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(ZLIB REQUIRED)
find_package(LibXml2 REQUIRED) find_package(LibXml2 REQUIRED)
...@@ -26,37 +27,17 @@ ELSE (DEFINED ASSERTON) ...@@ -26,37 +27,17 @@ 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 # define includes of external libs
SET(CGoGN_EXT_INCLUDES 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/glm
${CGoGN_ROOT_DIR}/ThirdParty/Assimp/include
${OPENGL_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR}
${GLEW_INCLUDE_DIRS} ${GLEW_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS}
${LIBXML2_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR}
${Boost_INCLUDE_DIRS} ${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 # define libs for external libs
SET (CGoGN_EXT_LIBS SET (CGoGN_EXT_LIBS
...@@ -65,14 +46,37 @@ SET (CGoGN_EXT_LIBS ...@@ -65,14 +46,37 @@ SET (CGoGN_EXT_LIBS
${ZLIB_LIBRARIES} ${ZLIB_LIBRARIES}
${LIBXML2_LIBRARIES} ${LIBXML2_LIBRARIES}
${Boost_REGEX_LIBRARY} ${Boost_REGEX_LIBRARY}
${Boost_THREAD_LIBRARY} ${Boost_THREAD_LIBRARY} )
${QT_LIBRARIES}
gzstream) #optionnal libs
IF (WITH_ASSIMP) IF (WITH_ASSIMP)
SET (CGoGN_EXT_LIBS ${CGoGN_EXT_LIBS} assimp) add_definitions(-DWITH_ASSIMP)
SET (CGoGN_EXT_INCLUDES ${CGoGN_EXT_INCLUDES} ThirdParty/Assimp/include)
SET (CGoGN_EXT_LIBS ${CGoGN_EXT_LIBS} assimp
ENDIF (WITH_ASSIMP) ENDIF (WITH_ASSIMP)
IF (WITH_NUMERICAL)
# add_definitions(-DWITH_NUMERICAL)
SET (CGoGN_EXT_INCLUDES ${CGoGN_EXT_INCLUDES} ${CGoGN_ROOT_DIR}/ThirdParty/Numerical ${CGoGN_ROOT_DIR}/ThirdParty/Numerical/UFconfig)
SET (CGoGN_EXT_LIBS ${CGoGN_EXT_LIBS} numerical)
ENDIF (WITH_NUMERICAL)
IF (WITH_ZINRI)
add_definitions(-DWITH_ZINRI)
SET (CGoGN_EXT_INCLUDES ${CGoGN_EXT_INCLUDES} ${CGoGN_ROOT_DIR}/ThirdParty/Zinri)
SET (CGoGN_EXT_LIBS ${CGoGN_EXT_LIBS} Zinri)
ENDIF (WITH_ZINRI)
IF (WITH_QT)
find_package(Qt4 REQUIRED)
add_definitions(-DWITH_QT)
SET(QT_USE_QTOPENGL TRUE)
INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS})
SET (CGoGN_EXT_INCLUDES ${CGoGN_EXT_INCLUDES} ${QT_INCLUDE_DIR})
SET (CGoGN_EXT_LIBS ${CGoGN_EXT_LIBS} ${QT_LIBRARIES})
ENDIF (WITH_QT)
# qq definition specifiques pour mac # qq definition specifiques pour mac
IF(APPLE) IF(APPLE)
......
...@@ -108,20 +108,28 @@ file( ...@@ -108,20 +108,28 @@ file(
${CGoGN_ROOT_DIR}/include/Utils/*.h ${CGoGN_ROOT_DIR}/include/Utils/*.h
) )
file( IF(WITH_QT)
GLOB_RECURSE file(
utils_qt_headers GLOB_RECURSE
${CGoGN_ROOT_DIR}/include/Utils/qt*.h ${CGoGN_ROOT_DIR}/src/Utils/Qt/*.cpp
) ${CGoGN_ROOT_DIR}/include/Utils/Qt/*.hpp
${CGoGN_ROOT_DIR}/include/Utils/Qt/*.h
QT4_WRAP_CPP(UTILS_QT_HEADERS_MOC ${utils_qt_headers}) )
file(
GLOB_RECURSE
utils_qt_headers
${CGoGN_ROOT_DIR}/include/Utils/qt*.h
)
QT4_WRAP_CPP(UTILS_QT_HEADERS_MOC ${utils_qt_headers})
SET (files_utils_withQt ${files_utils} ${UTILS_QT_HEADERS_MOC})
add_library( utils ${files_utils_withQt} )
ELSE(WITH_QT)
add_library( utils ${files_utils} )
ENDIF (WITH_QT)
SET (files_utils_withQt ${files_utils} ${UTILS_QT_HEADERS_MOC})
add_library(
utils
${files_utils_withQt}
)
add_dependencies(utils shader_target ) add_dependencies(utils shader_target )
......
...@@ -34,8 +34,9 @@ ...@@ -34,8 +34,9 @@
#include "Geometry/vector_gen.h" #include "Geometry/vector_gen.h"
#include "Geometry/matrix.h" #include "Geometry/matrix.h"
#include "Utils/gzstream.h"
#ifdef WITH_ASSIMP #ifdef WITH_ASSIMP
#include "gzstream.h"
#include "assimp.h" #include "assimp.h"
#include "aiScene.h" #include "aiScene.h"
#endif #endif
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#ifndef _SIZEBLOCK_H_ #ifndef _SIZEBLOCK_H_
#define _SIZEBLOCK_H_ #define _SIZEBLOCK_H_
#include "gzstream.h" #include "Utils/gzstream.h"
#include "Utils/cgognStream.h" #include "Utils/cgognStream.h"
#define _BLOCKSIZE_ 4096 #define _BLOCKSIZE_ 4096
......
...@@ -51,7 +51,7 @@ void allToStd(bool yes = true); ...@@ -51,7 +51,7 @@ void allToStd(bool yes = true);
*/ */
void allToFile(const std::string& filename); void allToFile(const std::string& filename);
#ifndef NO_QT #ifdef WITH_QT
/** /**
* set all outputs to status bar of Qt interface * set all outputs to status bar of Qt interface
*/ */
...@@ -89,13 +89,15 @@ protected: ...@@ -89,13 +89,15 @@ protected:
int m_out_mode; int m_out_mode;
std::stringstream m_buffer; std::stringstream m_buffer;
#ifndef NO_QT
#ifdef WITH_QT
Utils::QT::SimpleQT* m_sqt_bar; Utils::QT::SimpleQT* m_sqt_bar;
Utils::QT::SimpleQT* m_sqt_console; Utils::QT::SimpleQT* m_sqt_console;
QTextEdit* m_qte; QTextEdit* m_qte;
#endif #endif
std::ofstream* m_ofs; std::ofstream* m_ofs;
std::stringstream* m_oss; std::stringstream* m_oss;
...@@ -123,6 +125,7 @@ public: ...@@ -123,6 +125,7 @@ public:
*/ */
void toFile(const std::string& filename); void toFile(const std::string& filename);
#ifdef WITH_QT
/** /**
* set output to status bar of Qt interface * set output to status bar of Qt interface
*/ */
...@@ -132,6 +135,7 @@ public: ...@@ -132,6 +135,7 @@ public:
* set output to console of Qt interface * set output to console of Qt interface
*/ */
void toConsole(Utils::QT::SimpleQT* sqt); void toConsole(Utils::QT::SimpleQT* sqt);
#endif
/** /**
* set output to string stream buffer * set output to string stream buffer
......
...@@ -55,7 +55,7 @@ void allToFile(const std::string& filename ) ...@@ -55,7 +55,7 @@ void allToFile(const std::string& filename )
} }
#ifndef NO_QT #ifdef WITH_QT
void allToStatusBar(Utils::QT::SimpleQT* sqt) void allToStatusBar(Utils::QT::SimpleQT* sqt)
{ {
CGoGNout.toStatusBar(sqt); CGoGNout.toStatusBar(sqt);
...@@ -87,7 +87,7 @@ void allToBuffer(std::stringstream* ss) ...@@ -87,7 +87,7 @@ void allToBuffer(std::stringstream* ss)
Out::Out(): Out::Out():
m_out_mode(STDOUT), m_out_mode(STDOUT),
#ifndef NO_QT #ifdef WITH_QT
m_sqt_bar(NULL), m_sqt_bar(NULL),
m_sqt_console(NULL), m_sqt_console(NULL),
m_qte(NULL), m_qte(NULL),
...@@ -144,7 +144,7 @@ void Out::toFile(const std::string& filename ) ...@@ -144,7 +144,7 @@ void Out::toFile(const std::string& filename )
m_ofs = new std::ofstream(filename.c_str()); m_ofs = new std::ofstream(filename.c_str());
} }
#ifndef NO_QT #ifdef WITH_QT
void Out::toStatusBar(Utils::QT::SimpleQT* sqt) void Out::toStatusBar(Utils::QT::SimpleQT* sqt)
{ {
if (sqt != NULL) if (sqt != NULL)
...@@ -211,7 +211,7 @@ Out& Out::operator<< (Special& os ) ...@@ -211,7 +211,7 @@ Out& Out::operator<< (Special& os )
*m_ofs << bufc << std::endl; *m_ofs << bufc << std::endl;
} }
} }
#ifndef NO_QT #ifdef WITH_QT
if (m_out_mode & QTSTATUSBAR) if (m_out_mode & QTSTATUSBAR)
{ {
while (! m_buffer.eof()) while (! m_buffer.eof())
...@@ -267,7 +267,7 @@ Out& Out::operator<< (Special& os ) ...@@ -267,7 +267,7 @@ Out& Out::operator<< (Special& os )
*m_ofs << bufc << std::flush; *m_ofs << bufc << std::flush;
} }
} }
#ifndef NO_QT #ifdef WITH_QT
if (m_out_mode & QTSTATUSBAR) if (m_out_mode & QTSTATUSBAR)
{ {
while (! m_buffer.eof()) while (! m_buffer.eof())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment