Commit 2f60864c authored by Sylvain Thery's avatar Sylvain Thery
Browse files

Modification of compilation system, add an option to compile all CGoGN in one lib instead of four.

parent 6527a8bd
...@@ -5,12 +5,26 @@ SET(EXECUTABLE_OUTPUT_PATH ${CGoGN_ROOT_DIR}/bin) ...@@ -5,12 +5,26 @@ SET(EXECUTABLE_OUTPUT_PATH ${CGoGN_ROOT_DIR}/bin)
#INCLUDE(${QT_USE_FILE}) #INCLUDE(${QT_USE_FILE})
#ADD_DEFINITIONS(${QT_DEFINITIONS}) #ADD_DEFINITIONS(${QT_DEFINITIONS})
SET(CGoGN_LIBS_R topology algo container utils) IF (ONELIB)
SET(CGoGN_LIBS_R cgogn)
ELSE (ONELIB)
SET(CGoGN_LIBS_R topology algo container utils)
ENDIF (ONELIB)
IF(WIN32) IF(WIN32)
SET(CGoGN_LIBS_D topology algo container utils) # libs have same name but in different place in Visual # libs have same name but in different place in Visual
IF (ONELIB)
SET(CGoGN_LIBS_D cgogn)
ELSE (ONELIB)
SET(CGoGN_LIBS_D topology algo container utils)
ENDIF (ONELIB)
ELSE(WIN32) ELSE(WIN32)
SET(CGoGN_LIBS_D topologyD algoD containerD utilsD) IF (ONELIB)
SET(CGoGN_LIBS_D cgognD)
ELSE (ONELIB)
SET(CGoGN_LIBS_D topologyD algoD containerD utilsD)
ENDIF (ONELIB)
IF (WITH_QT) IF (WITH_QT)
add_subdirectory(Examples/Debug) add_subdirectory(Examples/Debug)
ENDIF (WITH_QT) ENDIF (WITH_QT)
...@@ -20,5 +34,6 @@ IF (WITH_QT) ...@@ -20,5 +34,6 @@ IF (WITH_QT)
add_subdirectory(Tuto) add_subdirectory(Tuto)
add_subdirectory(Examples/Release) add_subdirectory(Examples/Release)
ENDIF (WITH_QT) ENDIF (WITH_QT)
add_subdirectory(Examples/Tests) add_subdirectory(Examples/Tests)
...@@ -17,6 +17,8 @@ SET ( WITH_QT ON CACHE BOOL "build CGoGN with Qt lib ") ...@@ -17,6 +17,8 @@ SET ( WITH_QT ON CACHE BOOL "build CGoGN with Qt lib ")
SET ( WITH_NUMERICAL ON CACHE BOOL "build CGoGN with Numerical libs support ") SET ( WITH_NUMERICAL ON CACHE BOOL "build CGoGN with Numerical libs support ")
# for CGoGN MR # for CGoGN MR
SET ( FORCE_MR "2" CACHE STRING "0:none / 1 force multi / 2: force mono") SET ( FORCE_MR "2" CACHE STRING "0:none / 1 force multi / 2: force mono")
#create one big lib
SET ( ONELIB OFF CACHE BOOL "build CGoGN in one lib")
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")
...@@ -51,6 +53,13 @@ IF (FORCE_MR EQUAL 2) ...@@ -51,6 +53,13 @@ IF (FORCE_MR EQUAL 2)
ENDIF (FORCE_MR EQUAL 2) ENDIF (FORCE_MR EQUAL 2)
IF (ONELIB)
file(WRITE ${CGoGN_ROOT_DIR}/include/cgogn_onelib.h "1" )
ELSE (ONELIB)
file(WRITE ${CGoGN_ROOT_DIR}/include/cgogn_onelib.h "0" )
ENDIF (ONELIB)
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
......
...@@ -25,10 +25,7 @@ file( ...@@ -25,10 +25,7 @@ file(
${CGoGN_ROOT_DIR}/include/Topology/*.hpp ${CGoGN_ROOT_DIR}/include/Topology/*.hpp
${CGoGN_ROOT_DIR}/include/Topology/*.h ${CGoGN_ROOT_DIR}/include/Topology/*.h
) )
add_library(
topologyD
${files_topology}
)
file( file(
GLOB_RECURSE GLOB_RECURSE
...@@ -37,10 +34,7 @@ file( ...@@ -37,10 +34,7 @@ file(
${CGoGN_ROOT_DIR}/include/Container/*.hpp ${CGoGN_ROOT_DIR}/include/Container/*.hpp
${CGoGN_ROOT_DIR}/include/Container/*.h ${CGoGN_ROOT_DIR}/include/Container/*.h
) )
add_library(
containerD
${files_container}
)
file( file(
GLOB_RECURSE GLOB_RECURSE
...@@ -50,10 +44,6 @@ file( ...@@ -50,10 +44,6 @@ file(
${CGoGN_ROOT_DIR}/include/Algo/*.hpp ${CGoGN_ROOT_DIR}/include/Algo/*.hpp
${CGoGN_ROOT_DIR}/include/Algo/*.h ${CGoGN_ROOT_DIR}/include/Algo/*.h
) )
add_library(
algoD
${files_algo}
)
file( file(
...@@ -106,11 +96,25 @@ IF(WITH_QT) ...@@ -106,11 +96,25 @@ IF(WITH_QT)
QT4_WRAP_CPP(UTILS_QT_HEADERS_MOC ${utils_qt_headers}) QT4_WRAP_CPP(UTILS_QT_HEADERS_MOC ${utils_qt_headers})
SET (files_utils_withQt ${files_utils} ${files_utils_qt} ${UTILS_QT_HEADERS_MOC}) SET (files_utils_withQt ${files_utils} ${files_utils_qt} ${UTILS_QT_HEADERS_MOC})
add_library( utilsD ${files_utils_withQt} )
ELSE(WITH_QT)
add_library( utilsD ${files_utils} )
ENDIF (WITH_QT) ENDIF (WITH_QT)
add_dependencies(utilsD shader_targetD )
IF (ONELIB)
IF(WITH_QT)
add_library( cgognD ${files_topology} ${files_container} ${files_algo} ${files_utils_withQt})
ELSE(WITH_QT)
add_library( cgognD ${files_topology} ${files_container} ${files_algo} ${files_utils} )
ENDIF (WITH_QT)
ELSE (ONELIB)
add_library( topologyD ${files_topology})
add_library( containerD ${files_container})
add_library( algoD ${files_algo})
IF(WITH_QT)
add_library( utilsD ${files_utils_withQt} )
ELSE(WITH_QT)
add_library( utilsD ${files_utils} )
ENDIF (WITH_QT)
add_dependencies(utilsD shader_targetD )
ENDIF (ONELIB)
\ No newline at end of file
...@@ -16,6 +16,13 @@ Pour compiler CGoGN: ...@@ -16,6 +16,13 @@ Pour compiler CGoGN:
WITH_QT (T) WITH_QT (T)
afin de limiter les dépendances et le temps de compilation/ afin de limiter les dépendances et le temps de compilation/
FORCE_MR (2)
permet de compiler dans 3 modes: mixte (0), multi-resolution(1), mono-resolution(2).
ONELIB (F)
permet de forcer la compilation en une seule lib (libcgogn.a) au lieu de quatre.
- la compilation des sous-parties se fait en allant dans les sous-repertoires de build - la compilation des sous-parties se fait en allant dans les sous-repertoires de build
...@@ -49,6 +56,12 @@ You can also compile debug by creating a directory that ended Debug build instea ...@@ -49,6 +56,12 @@ You can also compile debug by creating a directory that ended Debug build instea
WITH_ZINRI (T) WITH_ZINRI (T)
WITH_QT (T) WITH_QT (T)
to minimize dependencies and compilation time / to minimize dependencies and compilation time /
FORCE_MR (2)
allow the compilation in 3 mode: mixed(0), multi-resolution(1), mono-resolution(2).
ONELIB (F)
allow compilation in one lib (libcgogn.a) instead of four.
- the compilation of each sub-parts is done by going in the subdirectories of build - the compilation of each sub-parts is done by going in the subdirectories of build
......
...@@ -24,10 +24,6 @@ file( ...@@ -24,10 +24,6 @@ file(
${CGoGN_ROOT_DIR}/include/Topology/*.hpp ${CGoGN_ROOT_DIR}/include/Topology/*.hpp
${CGoGN_ROOT_DIR}/include/Topology/*.h ${CGoGN_ROOT_DIR}/include/Topology/*.h
) )
add_library(
topology
${files_topology}
)
file( file(
GLOB_RECURSE GLOB_RECURSE
...@@ -36,10 +32,6 @@ file( ...@@ -36,10 +32,6 @@ file(
${CGoGN_ROOT_DIR}/include/Container/*.hpp ${CGoGN_ROOT_DIR}/include/Container/*.hpp
${CGoGN_ROOT_DIR}/include/Container/*.h ${CGoGN_ROOT_DIR}/include/Container/*.h
) )
add_library(
container
${files_container}
)
file( file(
GLOB_RECURSE GLOB_RECURSE
...@@ -49,22 +41,6 @@ file( ...@@ -49,22 +41,6 @@ file(
${CGoGN_ROOT_DIR}/include/Algo/*.hpp ${CGoGN_ROOT_DIR}/include/Algo/*.hpp
${CGoGN_ROOT_DIR}/include/Algo/*.h ${CGoGN_ROOT_DIR}/include/Algo/*.h
) )
add_library(
algo
${files_algo}
)
#file(
# GLOB_RECURSE
# files_geometry
# ${CGoGN_ROOT_DIR}/src/Geometry/*.cpp
# ${CGoGN_ROOT_DIR}/include/Geometry/*.hpp
# ${CGoGN_ROOT_DIR}/include/Geometry/*.h
#)
#add_library(
# geometry
# ${files_geometry}
#)
file( file(
...@@ -89,9 +65,6 @@ ELSE(WIN32) ...@@ -89,9 +65,6 @@ ELSE(WIN32)
SOURCES ${shaders_src} ) SOURCES ${shaders_src} )
ENDIF(WIN32) ENDIF(WIN32)
file( file(
GLOB # WARNING NO MORE RECURSE TO AVOID TAKING QT FILES GLOB # WARNING NO MORE RECURSE TO AVOID TAKING QT FILES
files_utils files_utils
...@@ -119,14 +92,25 @@ IF(WITH_QT) ...@@ -119,14 +92,25 @@ IF(WITH_QT)
QT4_WRAP_CPP(UTILS_QT_HEADERS_MOC ${utils_qt_headers}) QT4_WRAP_CPP(UTILS_QT_HEADERS_MOC ${utils_qt_headers})
SET (files_utils_withQt ${files_utils} ${files_utils_qt} ${UTILS_QT_HEADERS_MOC}) SET (files_utils_withQt ${files_utils} ${files_utils_qt} ${UTILS_QT_HEADERS_MOC})
add_library( utils ${files_utils_withQt} )
ELSE(WITH_QT)
add_library( utils ${files_utils} )
ENDIF (WITH_QT) ENDIF (WITH_QT)
add_dependencies(utils shader_target )
IF (ONELIB)
IF(WITH_QT)
add_library( cgogn ${files_topology} ${files_container} ${files_algo} ${files_utils_withQt})
ELSE(WITH_QT)
add_library( cgogn ${files_topology} ${files_container} ${files_algo} ${files_utils} )
ENDIF (WITH_QT)
ELSE (ONELIB)
add_library( container ${files_container})
add_library( topology ${files_topology})
add_library( algo ${files_algo})
IF(WITH_QT)
add_library( utils ${files_utils_withQt} )
ELSE(WITH_QT)
add_library( utils ${files_utils} )
ENDIF (WITH_QT)
add_dependencies(utils shader_target )
ENDIF (ONELIB)
\ No newline at end of file
...@@ -11,20 +11,31 @@ SET ( WITH_QT ON CACHE BOOL "need Qt lib ") ...@@ -11,20 +11,31 @@ SET ( WITH_QT ON CACHE BOOL "need Qt lib ")
# for CGoGN MR # for CGoGN MR
file(STRINGS ${CGoGN_ROOT_DIR}/include/cgogn_mr.h FORCE_MR) file(STRINGS ${CGoGN_ROOT_DIR}/include/cgogn_mr.h FORCE_MR)
#MESSAGE (STATUS "MR" ${FORCE_MR})
IF (FORCE_MR EQUAL 1) IF (FORCE_MR EQUAL 1)
add_definitions(-DCGoGN_FORCE_MR=1) add_definitions(-DCGoGN_FORCE_MR=1)
ENDIF (FORCE_MR EQUAL 1) ENDIF (FORCE_MR EQUAL 1)
IF (FORCE_MR EQUAL 2) IF (FORCE_MR EQUAL 2)
add_definitions(-DCGoGN_FORCE_MR=2) add_definitions(-DCGoGN_FORCE_MR=2)
ENDIF (FORCE_MR EQUAL 2) ENDIF (FORCE_MR EQUAL 2)
# for CGoGN in one lib on not
file(STRINGS ${CGoGN_ROOT_DIR}/include/cgogn_onelib.h ONELIB_STR)
IF (ONELIB_STR EQUAL 1)
SET(CGoGN_LIBS_D cgognD)
SET(CGoGN_LIBS_R cgogn)
ELSE (ONELIB_STR EQUAL 1)
SET(CGoGN_LIBS_D topologyD algoD containerD utilsD)
SET(CGoGN_LIBS_R topology algo container utils)
ENDIF (ONELIB_STR EQUAL 1)
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")
ENDIF(WIN32) ENDIF(WIN32)
find_package(OpenGL REQUIRED) find_package(OpenGL REQUIRED)
find_package(Boost COMPONENTS regex thread REQUIRED) find_package(Boost COMPONENTS regex thread REQUIRED)
find_package(ZLIB REQUIRED) find_package(ZLIB REQUIRED)
...@@ -33,8 +44,6 @@ find_package(GLEW REQUIRED) ...@@ -33,8 +44,6 @@ find_package(GLEW REQUIRED)
IF (DEFINED ASSERTON) IF (DEFINED ASSERTON)
add_definitions(-DCGOGN_ASSERT_BOOL=${ASSERTON}) add_definitions(-DCGOGN_ASSERT_BOOL=${ASSERTON})
ELSE (DEFINED ASSERTON) ELSE (DEFINED ASSERTON)
...@@ -112,5 +121,5 @@ ENDIF(WIN32) ...@@ -112,5 +121,5 @@ ENDIF(WIN32)
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin) SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin)
SET(CGoGN_LIBS_D topologyD algoD containerD utilsD)
SET(CGoGN_LIBS_R topology algo container utils)
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