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)
SET (BUILD_SHARED_LIBS OFF CACHE BOOL
"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")
SET (WITH_ASSIMP ON CACHE BOOL "build with Assimp")
SET (WITH_NUMERICAL ON CACHE BOOL "build with numerical libs")
SET (WITH_ZINRI ON CACHE BOOL "build with Zinri libs")
IF (APPLE)
SET(CMAKE_OSX_ARCHITECTURES x86_64)
......@@ -25,15 +25,20 @@ ELSE(WIN32)
SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release)
ENDIF(WIN32)
add_subdirectory(Zinri Zinri/build)
add_subdirectory(gzstream gzstream/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)
add_subdirectory(Numerical Numerical/build)
add_subdirectory(Assimp Assimp/build)
ENDIF (WITH_ASSIMP)
IF (WITH_NUMERICAL)
add_subdirectory(Assimp Assimp/build)
add_subdirectory(Numerical Numerical/build)
ENDIF (WITH_NUMERICAL)
......@@ -8,12 +8,13 @@ SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/..)
SET(CMAKE_MODULE_PATH ${CGoGN_ROOT_DIR}/cmake_modules/)
# for shared or not shared
SET (BUILD_SHARED_LIBS OFF CACHE BOOL
"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).")
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(Qt4 REQUIRED)
find_package(Boost COMPONENTS regex thread REQUIRED)
find_package(ZLIB REQUIRED)
find_package(LibXml2 REQUIRED)
......@@ -26,37 +27,17 @@ 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)
${Boost_INCLUDE_DIRS} )
# define libs for external libs
SET (CGoGN_EXT_LIBS
......@@ -65,14 +46,37 @@ SET (CGoGN_EXT_LIBS
${ZLIB_LIBRARIES}
${LIBXML2_LIBRARIES}
${Boost_REGEX_LIBRARY}
${Boost_THREAD_LIBRARY}
${QT_LIBRARIES}
gzstream)
${Boost_THREAD_LIBRARY} )
#optionnal libs
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)
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
IF(APPLE)
......
......@@ -108,20 +108,28 @@ file(
${CGoGN_ROOT_DIR}/include/Utils/*.h
)
file(
GLOB_RECURSE
utils_qt_headers
${CGoGN_ROOT_DIR}/include/Utils/qt*.h
)
QT4_WRAP_CPP(UTILS_QT_HEADERS_MOC ${utils_qt_headers})
IF(WITH_QT)
file(
GLOB_RECURSE
${CGoGN_ROOT_DIR}/src/Utils/Qt/*.cpp
${CGoGN_ROOT_DIR}/include/Utils/Qt/*.hpp
${CGoGN_ROOT_DIR}/include/Utils/Qt/*.h
)
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 )
......
......@@ -34,8 +34,9 @@
#include "Geometry/vector_gen.h"
#include "Geometry/matrix.h"
#include "Utils/gzstream.h"
#ifdef WITH_ASSIMP
#include "gzstream.h"
#include "assimp.h"
#include "aiScene.h"
#endif
......
......@@ -25,7 +25,7 @@
#ifndef _SIZEBLOCK_H_
#define _SIZEBLOCK_H_
#include "gzstream.h"
#include "Utils/gzstream.h"
#include "Utils/cgognStream.h"
#define _BLOCKSIZE_ 4096
......
......@@ -51,7 +51,7 @@ void allToStd(bool yes = true);
*/
void allToFile(const std::string& filename);
#ifndef NO_QT
#ifdef WITH_QT
/**
* set all outputs to status bar of Qt interface
*/
......@@ -89,13 +89,15 @@ protected:
int m_out_mode;
std::stringstream m_buffer;
#ifndef NO_QT
#ifdef WITH_QT
Utils::QT::SimpleQT* m_sqt_bar;
Utils::QT::SimpleQT* m_sqt_console;
QTextEdit* m_qte;
#endif
std::ofstream* m_ofs;
std::stringstream* m_oss;
......@@ -123,6 +125,7 @@ public:
*/
void toFile(const std::string& filename);
#ifdef WITH_QT
/**
* set output to status bar of Qt interface
*/
......@@ -132,6 +135,7 @@ public:
* set output to console of Qt interface
*/
void toConsole(Utils::QT::SimpleQT* sqt);
#endif
/**
* set output to string stream buffer
......
......@@ -55,7 +55,7 @@ void allToFile(const std::string& filename )
}
#ifndef NO_QT
#ifdef WITH_QT
void allToStatusBar(Utils::QT::SimpleQT* sqt)
{
CGoGNout.toStatusBar(sqt);
......@@ -87,7 +87,7 @@ void allToBuffer(std::stringstream* ss)
Out::Out():
m_out_mode(STDOUT),
#ifndef NO_QT
#ifdef WITH_QT
m_sqt_bar(NULL),
m_sqt_console(NULL),
m_qte(NULL),
......@@ -144,7 +144,7 @@ void Out::toFile(const std::string& filename )
m_ofs = new std::ofstream(filename.c_str());
}
#ifndef NO_QT
#ifdef WITH_QT
void Out::toStatusBar(Utils::QT::SimpleQT* sqt)
{
if (sqt != NULL)
......@@ -211,7 +211,7 @@ Out& Out::operator<< (Special& os )
*m_ofs << bufc << std::endl;
}
}
#ifndef NO_QT
#ifdef WITH_QT
if (m_out_mode & QTSTATUSBAR)
{
while (! m_buffer.eof())
......@@ -267,7 +267,7 @@ Out& Out::operator<< (Special& os )
*m_ofs << bufc << std::flush;
}
}
#ifndef NO_QT
#ifdef WITH_QT
if (m_out_mode & QTSTATUSBAR)
{
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