apps_cmake.txt 3.26 KB
Newer Older
1
# A mettre juste apres la definition de CGoGN_ROOT_DIR  a la racine du CGoGN_Apps
2
# include(${CGoGN_ROOT_DIR}/build/apps_cmake.txt)
3 4 5

SET(CMAKE_MODULE_PATH " ${CMAKE_MODULE_PATH} ${CGoGN_ROOT_DIR}/cmake_modules/")

Sylvain Thery's avatar
Sylvain Thery committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

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)

22 23 24 25 26 27 28

IF (DEFINED ASSERTON)
	add_definitions(-DCGOGN_ASSERT_BOOL=${ASSERTON})
ELSE (DEFINED ASSERTON)
	add_definitions(-DCGOGN_ASSERT_BOOL=false)
ENDIF (DEFINED ASSERTON)

Sylvain Thery's avatar
Sylvain Thery committed
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77

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)
78 79 80

# qq definition specifiques pour mac
IF(APPLE)
Sylvain Thery's avatar
Sylvain Thery committed
81 82
# attention a changer pour chercher la bonne version automatiquement
	SET(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.6.sdk" CACHE STRING "developer SDK")
83 84 85 86 87 88
	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)
Sylvain Thery's avatar
Sylvain Thery committed
89 90 91 92 93
	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)
94 95
ELSE(WIN32)
	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
Sylvain Thery's avatar
Sylvain Thery committed
96 97 98
	add_subdirectory(Release)
	add_subdirectory(Debug)
	add_subdirectory(${CGoGN_ROOT_DIR}/Apps Apps)
99 100 101
ENDIF(WIN32)


Sylvain Thery's avatar
Sylvain Thery committed
102
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin)
Sylvain Thery's avatar
Sylvain Thery committed
103

104 105
SET(CGoGN_LIBS_D topologyD algoD containerD utilsD)
SET(CGoGN_LIBS_R topology algo container utils)
Sylvain Thery's avatar
Sylvain Thery committed
106 107