Commit a7c708cd authored by Sylvain Thery's avatar Sylvain Thery

modif compilation Apps

parent 1bb27cd8
......@@ -17,8 +17,8 @@ Mettre le chemin de la racine de CGoGN + /ThirdParty pour les sources
Mettre le chemin de la racine de CGoGN + /ThirdParty/build pour le build
Cliquer sur Configure
Choisir le bon compilateur (celui de votre version de Visual C++)
ajouter la variavle CMAKE_PREFIX_PATH contenant le chemine vers windows_dependencies
Modifier les variables en fonctions de ce que vous voulez compiler (README.TXT de ThirdParty)
Modifier le CMAKE_PREFIX_PATH si nécessaire (cf remarque dépendances)
Recliquer sur Configure
Cliquer sur Generate
Aller compiler sous visual(en release)
......@@ -28,20 +28,20 @@ Mettre le chemin de la racine de CGoGN + /build pour les sources
Mettre le chemin de la racine de CGoGN + /Visual (par exemple) pour le build
Cliquer sur Configure
Choisir le bon compilateur (celui de votre version de Visual C++)
Modifier les variables comme pour ThirdParty
Modifier les variables comme pour ThirdParty (et CMAKE_PREFIX_PATH si nécessaire)
Recliquer sur Configure
Cliquer sur Generate
Aller dans Visual et double-cliquer sur CGoGN.sln !!
Pour que les executables fonctionnent ajouter le chemin vers les dll dans la variable d'environnement path
(ou copier les dll dans un répertoire déjà dans le path)
Pour que les executables fonctionnent ajouter le chemin vers les dll des dépendances dans la variable
d'environnement path (ou copier les dll dans un répertoire déjà dans le path)
Remarque:
Remarque dépendances:
Si vous voulez utiliser vos propre versions des dépendance (Zlib / glew / Boost / Qt)
changer le prefix_path (voir ci dessous)
Attention pour Boost le prefix path ne marche pas (BOOST_ROOT + ...)
changer le CMAKE_PREFIX_PATH (voir ci dessous)
Attention pour Boost le prefix path ne marche pas (utiliser BOOST_ROOT et d'autres si nécessaire)
Compilation 64bits:
......
......@@ -10,9 +10,13 @@ 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 ( 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 ")
#SET ( WITH_NUMERICAL OFF CACHE BOOL "build CGoGN with Numerical libs support ")
IF(WIN32)
set(CMAKE_PREFIX_PATH ${CGoGN_ROOT_DIR}/windows_dependencies CACHE STRING "path to dependencies")
ENDIF(WIN32)
find_package(OpenGL REQUIRED)
find_package(Boost COMPONENTS regex thread REQUIRED)
......@@ -55,12 +59,6 @@ IF (WITH_ASSIMP)
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)
......@@ -77,6 +75,11 @@ IF (WITH_QT)
SET (CGoGN_EXT_LIBS ${CGoGN_EXT_LIBS} ${QT_LIBRARIES})
ENDIF (WITH_QT)
#IF (WITH_NUMERICAL)
# add_definitions(-DWITH_NUMERICAL)
# SET (CGoGN_NUMERICAL_INCLUDES ${CGoGN_ROOT_DIR}/ThirdParty/Numerical ${CGoGN_ROOT_DIR}/ThirdParty/Numerical/UFconfig)
# SET (CGoGN_NUMERICAL_LIBS f2c blas numerical lapack)
#ENDIF (WITH_NUMERICAL)
# qq definition specifiques pour mac
IF(APPLE)
......@@ -88,14 +91,11 @@ IF(APPLE)
ENDIF(APPLE)
IF(WIN32)
# INCLUDE_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/include/)
# LINK_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/lib/ ${boost_path}/lib)
add_subdirectory(Release)
add_subdirectory(${CGoGN_ROOT_DIR}/Apps Apps)
# if(CMAKE_CONFIGURATION_TYPES)
set(CMAKE_CONFIGURATION_TYPES Release Debug)
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Only Release or Debug" FORCE)
# endif()
# set(CMAKE_CONFIGURATION_TYPES Release Debug)
# set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Only Release or Debug" FORCE)
set(CMAKE_CONFIGURATION_TYPES "Release Debug" CACHE STRING "Only Release or Debug" FORCE)
ELSE(WIN32)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
add_subdirectory(Release)
......
# A mettre juste apres la definition de CGoGN_ROOT_DIR a la racine du CGoGN_Apps
# include(${CGoGN_ROOT_DIR}/build/apps_cmake.txt)
SET(CMAKE_MODULE_PATH " ${CMAKE_MODULE_PATH} ${CGoGN_ROOT_DIR}/cmake_modules/")
find_package(OpenGL)
FIND_PACKAGE(Qt4 REQUIRED)
#for basile ;)
find_package(GLUT)
SET ( WITH_ASSIMP ON CACHE BOOL "need Assimp")
SET ( WITH_NUMERICAL ON CACHE BOOL "need numerical libs")
SET ( WITH_ZINRI ON CACHE BOOL "need Zinri lib ")
SET ( WITH_QT ON CACHE BOOL "need Qt lib ")
IF(WIN32)
set(CMAKE_PREFIX_PATH ${CGoGN_ROOT_DIR}/windows_dependencies CACHE STRING "path to dependencies")
ENDIF(WIN32)
find_package(OpenGL REQUIRED)
find_package(Boost COMPONENTS regex thread REQUIRED)
find_package(ZLIB REQUIRED)
find_package(LibXml2 REQUIRED)
find_package(GLEW REQUIRED)
IF (DEFINED ASSERTON)
add_definitions(-DCGOGN_ASSERT_BOOL=${ASSERTON})
......@@ -15,67 +26,82 @@ ELSE (DEFINED ASSERTON)
add_definitions(-DCGOGN_ASSERT_BOOL=false)
ENDIF (DEFINED ASSERTON)
# 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/glm
${OPENGL_INCLUDE_DIR}
${GLEW_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS}
${LIBXML2_INCLUDE_DIR}
${Boost_INCLUDE_DIRS} )
# define libs for external libs
SET (COMMON_LIBS
${OPENGL_LIBRARY}
${GLEW_LIBRARIES}
${ZLIB_LIBRARIES}
${LIBXML2_LIBRARIES}
${Boost_REGEX_LIBRARY}
${Boost_THREAD_LIBRARY} )
#optionnal libs
IF (WITH_ASSIMP)
add_definitions(-DWITH_ASSIMP)
SET (CGoGN_EXT_INCLUDES ${CGoGN_EXT_INCLUDES} ThirdParty/Assimp/include)
SET (COMMON_LIBS ${COMMON_LIBS} assimp)
ENDIF (WITH_ASSIMP)
IF (WITH_ZINRI)
add_definitions(-DWITH_ZINRI)
SET (CGoGN_EXT_INCLUDES ${CGoGN_EXT_INCLUDES} ${CGoGN_ROOT_DIR}/ThirdParty/Zinri)
SET (COMMON_LIBS ${COMMON_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)
IF (WITH_NUMERICAL)
add_definitions(-DWITH_NUMERICAL)
SET (NUMERICAL_INCLUDES ${CGoGN_ROOT_DIR}/ThirdParty/Numerical ${CGoGN_ROOT_DIR}/ThirdParty/Numerical/UFconfig)
SET (NUMERICAL_LIBS f2c blas numerical lapack)
ENDIF (WITH_NUMERICAL)
# qq definition specifiques pour mac
IF(APPLE)
# a changer pour chercher la bonne version automatiquement ??
SET(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.6.sdk")
# attention a changer pour chercher la bonne version automatiquement
SET(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.6.sdk" CACHE STRING "developer SDK")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined -Wl,dynamic_lookup")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMAC_OSX")
SET(CMAKE_OSX_ARCHITECTURES x86_64)
ENDIF(APPLE)
IF(WIN32)
SET(GLEW_LIBRARY glew32)
SET(DEVIL_LIBRARIES DevIL ILU ILUT)
SET(ZLIB_LIBRARIES zlib)
SET(LIBXML2_LIBRARIES xml2)
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/windows_dependencies/include/)
LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/windows_dependencies/lib/)
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})
add_subdirectory(Release)
add_subdirectory(${CGoGN_ROOT_DIR}/Apps Apps)
set(CMAKE_PREFIX_PATH ${CGoGN_ROOT_DIR}/windows_dependencies CACHE STRING "path to dependencies")
set(CMAKE_CONFIGURATION_TYPES Release Debug)
set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Only Release or Debug" FORCE)
ELSE(WIN32)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
find_package(DevIL)
find_package(ZLIB)
find_package(LibXml2)
SET(GLEW_LIBRARY GLEW)
IF (IL_LIBRARIES)
SET(DEVIL_LIBRARIES ${IL_LIBRARIES} ${ILU_LIBRARIES} ${ILUT_LIBRARIES})
ELSE(IL_LIBRARIES)
SET(DEVIL_LIBRARIES ${IL_LIBRARY} ${ILU_LIBRARY} ${ILUT_LIBRARY})
ENDIF(IL_LIBRARIES)
MACRO(BOOST_LIBS lib_lists names)
SET (${lib_lists})
FOREACH(name ${names})
SET (${lib_lists} ${${lib_lists}} ${name} )
ENDFOREACH(name)
ENDMACRO(BOOST_LIBS)
add_subdirectory(Release)
add_subdirectory(Debug)
add_subdirectory(${CGoGN_ROOT_DIR}/Apps Apps)
ENDIF(WIN32)
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin)
BOOST_LIBS(boost_regex_lib_lists "boost_regex-mt")
SET (COMMON_LIBS ${GLUT_LIBRARY} ${OPENGL_LIBRARY} ${GLEW_LIBRARY} ${DEVIL_LIBRARIES} ${ZLIB_LIBRARIES} ${LIBXML2_LIBRARIES} ${boost_regex_lib_lists} gzstream AntTweakBar openctm assimp)
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin)
SET(CGoGN_LIBS_D topologyD algoD containerD utilsD)
SET(CGoGN_LIBS_R topology algo container utils)
SET(NUMERICAL_LIBS numerical lapack blas f2c)
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