Commit 0ad57faf authored by thery's avatar thery

ajout compilation facile avec boost sous windows (ouch...)

parent 84fe346d
...@@ -14,6 +14,8 @@ ADD_DEFINITIONS(${QT_DEFINITIONS}) ...@@ -14,6 +14,8 @@ ADD_DEFINITIONS(${QT_DEFINITIONS})
# define includes path # define includes path
MESSAGE (STATUS ${BOOST_INCLUDE_PATH})
include_directories( include_directories(
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
/usr/include/libxml2/ /usr/include/libxml2/
...@@ -22,6 +24,7 @@ include_directories( ...@@ -22,6 +24,7 @@ include_directories(
${CGoGN_ROOT_DIR}/ThirdParty/Assimp/include ${CGoGN_ROOT_DIR}/ThirdParty/Assimp/include
${CGoGN_ROOT_DIR}/ThirdParty/glm ${CGoGN_ROOT_DIR}/ThirdParty/glm
${CGoGN_ROOT_DIR}/include ${CGoGN_ROOT_DIR}/include
${BOOST_INCLUDE_PATH}
) )
# define libs path # define libs path
...@@ -32,7 +35,6 @@ ELSE(WIN32) ...@@ -32,7 +35,6 @@ ELSE(WIN32)
ENDIF(WIN32) ENDIF(WIN32)
#define exec to compile #define exec to compile
QT4_WRAP_CPP(tuto1_moc tuto1.h) QT4_WRAP_CPP(tuto1_moc tuto1.h)
...@@ -72,10 +74,15 @@ add_executable( tp_master tp_master.cpp ${tp_master_moc}) ...@@ -72,10 +74,15 @@ add_executable( tp_master tp_master.cpp ${tp_master_moc})
target_link_libraries( tp_master target_link_libraries( tp_master
${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES} ) ${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES} )
#BOOST_LIBS macro: allow using compiled boost in windows (see readme)
# -first argument variable that will contain the libs
# -second argument list of boost libs separated by ; in " "
BOOST_LIBS(boost_lib_lists "boost_thread-mt;boost_iostreams-mt")
QT4_WRAP_CPP(tuto_mt_moc tuto_mt.h) QT4_WRAP_CPP(tuto_mt_moc tuto_mt.h)
add_executable( tuto_mt tuto_mt.cpp ${tuto_mt_moc}) add_executable( tuto_mt tuto_mt.cpp ${tuto_mt_moc})
target_link_libraries( tuto_mt target_link_libraries( tuto_mt
${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES} boost_thread-mt) ${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES} ${boost_lib_lists})
QT4_WRAP_CPP(tuto_ogl3_moc tuto_ogl3.h) QT4_WRAP_CPP(tuto_ogl3_moc tuto_ogl3.h)
add_executable( tuto_ogl3 tuto_ogl3.cpp ${tuto_ogl3_moc}) add_executable( tuto_ogl3 tuto_ogl3.cpp ${tuto_ogl3_moc})
......
...@@ -10,13 +10,18 @@ Cliquer sur Configure ...@@ -10,13 +10,18 @@ Cliquer sur Configure
Choisir le bon compilateur (celui de votre version de Visual C++) Choisir le bon compilateur (celui de votre version de Visual C++)
Recliquer sur Configure Recliquer sur Configure
Cliquer sur Generate Cliquer sur Generate
Unziper le dependencies.zip (http://iggservis.u-strasbg.fr/Data/dependencies.zip) dans le repertoire Visual Unziper le windows_dependencies.zip (http://iggservis.u-strasbg.fr/Data/) a la racine de CGoGN
Aller dans Visual et double-cliquer sur CGoGN.sln !! Aller dans Visual et double-cliquer sur CGoGN.sln !!
Pour que les executables fonctionnent ajouter ....\Visual\dependencies\dll dans la variable d'environnement path 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) (ou copier les dll dans un répertoire déjà dans le path)
Remarque: uniquement compilation 32bits testée pour le moment. Remarque pour l'utilisation de boost (manière simple):
-installer les binaires a l'aide de boostpro (www.boostpro.com)
-definir la varible d'env "boost_extension" avec ce que vous voulez utiliser (exemple: -vc100-mt-1_44)
-definir la varible d'env "boost_path" avec le chemin d'acces (exemple: C:\Program Files\boost\boost_1_44\)
-ajouter le chemin vers les dll dans le path (comme cf ci-dessus)
......
...@@ -27,8 +27,19 @@ IF(WIN32) ...@@ -27,8 +27,19 @@ IF(WIN32)
SET(DEVIL_LIBRARIES DevIL ILU ILUT) SET(DEVIL_LIBRARIES DevIL ILU ILUT)
SET(ZLIB_LIBRARIES zlib) SET(ZLIB_LIBRARIES zlib)
SET(LIBXML2_LIBRARIES xml2) SET(LIBXML2_LIBRARIES xml2)
MACRO(BOOST_LIBS lib_lists names)
SET (${lib_lists} "")
FOREACH(name ${names})
STRING(REGEX REPLACE "-mt" $ENV{boost_extension} newname ${name})
SET (${lib_lists} ${${lib_lists}} ${newname} )
ENDFOREACH(name)
ENDMACRO(BOOST_LIBS)
set (BOOST_INCLUDE_PATH $ENV{boost_path})
INCLUDE_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/include/) INCLUDE_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/include/)
LINK_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/lib/) LINK_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/lib/ $ENV{boost_path}/lib)
add_subdirectory(Release) add_subdirectory(Release)
add_subdirectory(${CGoGN_ROOT_DIR}/Apps Apps) add_subdirectory(${CGoGN_ROOT_DIR}/Apps Apps)
if (EXISTS "${CGoGN_ROOT_DIR}/Perso") if (EXISTS "${CGoGN_ROOT_DIR}/Perso")
...@@ -51,6 +62,14 @@ ELSE(WIN32) ...@@ -51,6 +62,14 @@ ELSE(WIN32)
ELSE(IL_LIBRARIES) ELSE(IL_LIBRARIES)
SET(DEVIL_LIBRARIES ${IL_LIBRARY} ${ILU_LIBRARY} ${ILUT_LIBRARY}) SET(DEVIL_LIBRARIES ${IL_LIBRARY} ${ILU_LIBRARY} ${ILUT_LIBRARY})
ENDIF(IL_LIBRARIES) ENDIF(IL_LIBRARIES)
MACRO(BOOST_LIBS lib_lists names)
SET (${lib_lists})
FOREACH(name ${names})
STRING(REGEX REPLACE "-mt" $ENV{boost_libs_extension} newname ${name})
SET (${lib_lists} ${${lib_lists}} ${name} )
ENDFOREACH(name)
ENDMACRO(BOOST_LIBS)
add_subdirectory(Release) add_subdirectory(Release)
add_subdirectory(Debug) add_subdirectory(Debug)
......
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