Commit 3826f6ad authored by Sylvain Thery's avatar Sylvain Thery
Browse files

compilation choice for float/double in SCHNApps

parent dc15e100
...@@ -3,6 +3,9 @@ cmake_minimum_required(VERSION 2.8) ...@@ -3,6 +3,9 @@ cmake_minimum_required(VERSION 2.8)
project(SCHNApps) project(SCHNApps)
SET( CGoGN_SLOT_DEBUG_MODE OFF CACHE BOOL "build with slot debugging mode" ) SET( CGoGN_SLOT_DEBUG_MODE OFF CACHE BOOL "build with slot debugging mode" )
SET( CGoGN_SCHNApps_USE_DOUBLE OFF CACHE BOOL "build with doubled instead of floats" )
SET ( CGoGN_WITH_QTCREATOR OFF CACHE BOOL "use QtCreator to compile" )
SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/.. CACHE STRING "CGoGN root dir") SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/.. CACHE STRING "CGoGN root dir")
IF(WIN32) IF(WIN32)
SET ( CMAKE_PREFIX_PATH ${CGoGN_ROOT_DIR}/windows_dependencies CACHE STRING "path to dependencies" ) SET ( CMAKE_PREFIX_PATH ${CGoGN_ROOT_DIR}/windows_dependencies CACHE STRING "path to dependencies" )
...@@ -63,9 +66,14 @@ ENDIF() ...@@ -63,9 +66,14 @@ ENDIF()
# definitions from CGoGN # definitions from CGoGN
FILE(STRINGS ${CGoGN_SRC_DIR}/include/cgogn_defs.h CGoGN_DEFS) FILE(STRINGS ${CGoGN_SRC_DIR}/include/cgogn_defs.h CGoGN_DEFS)
#and schnapps options
IF(CGoGN_SLOT_DEBUG_MODE) IF(CGoGN_SLOT_DEBUG_MODE)
LIST (APPEND CGoGN_DEFS -DCGoGN_SLOT_DEBUG_MODE=1) LIST (APPEND CGoGN_DEFS -DCGoGN_SLOT_DEBUG_MODE=1)
ENDIF() ENDIF()
IF (${CGoGN_SCHNApps_USE_DOUBLE})
LIST (APPEND CGoGN_DEFS -DSCHNAPPS_USE_DOUBLE=1)
ENDIF()
ADD_DEFINITIONS(${CGoGN_DEFS}) ADD_DEFINITIONS(${CGoGN_DEFS})
# includes from CGoGN + python # includes from CGoGN + python
...@@ -80,7 +88,7 @@ LIST(APPEND EXT_LIBS PythonQt ${PYTHON_LIBRARIES}) ...@@ -80,7 +88,7 @@ LIST(APPEND EXT_LIBS PythonQt ${PYTHON_LIBRARIES})
if(CMAKE_COMPILER_IS_GNUCXX) if(CMAKE_COMPILER_IS_GNUCXX)
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}-Wno-unused-local-typedefs") SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs")
endif() endif()
if(WIN32) if(WIN32)
......
...@@ -17,6 +17,20 @@ class VBO; ...@@ -17,6 +17,20 @@ class VBO;
class GLSLShader; class GLSLShader;
} }
#ifdef SCHNAPPS_USE_DOUBLE
struct PFP2: public PFP_DOUBLE
{
typedef EmbeddedMap2 MAP;
};
struct PFP3: public PFP_DOUBLE
{
typedef EmbeddedMap3 MAP;
};
#else
struct PFP2: public PFP_STANDARD struct PFP2: public PFP_STANDARD
{ {
typedef EmbeddedMap2 MAP; typedef EmbeddedMap2 MAP;
...@@ -27,6 +41,8 @@ struct PFP3: public PFP_STANDARD ...@@ -27,6 +41,8 @@ struct PFP3: public PFP_STANDARD
typedef EmbeddedMap3 MAP; typedef EmbeddedMap3 MAP;
}; };
#endif
namespace SCHNApps namespace SCHNApps
{ {
......
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