Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

CMakeLists.txt 2.65 KB
Newer Older
Sylvain Thery's avatar
Sylvain Thery committed
1
cmake_minimum_required(VERSION 2.8)
2
include(ExternalProject)
3

Pierre Kraemer's avatar
Pierre Kraemer committed
4
5
project(CGoGN_ThirdParty)

6
7
# for access to var CMAKE_INSTALL_LIBDIR
include(GNUInstallDirs)
8

9
SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/..)
unknown's avatar
unknown committed
10
11

IF(WIN32)
Sylvain Thery's avatar
Sylvain Thery committed
12
	
unknown's avatar
unknown committed
13
14
15
ENDIF(WIN32)

IF (${CMAKE_CURRENT_BINARY_DIR} MATCHES "(.*)Debug")
Sylvain Thery's avatar
Sylvain Thery committed
16
17
18
19
	set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Debug/Release" FORCE)
ELSE()
	set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Debug/Release" FORCE)	
ENDIF()
unknown's avatar
unknown committed
20
21

IF(WIN32)
Sylvain Thery's avatar
Sylvain Thery committed
22
	set(CMAKE_PREFIX_PATH ${CGoGN_ROOT_DIR}/windows_dependencies CACHE STRING "path to dependencies")
unknown's avatar
unknown committed
23
	INCLUDE_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/include/)
unknown's avatar
unknown committed
24
	INCLUDE_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/include/suitesparse)
Sylvain Thery's avatar
Sylvain Thery committed
25
26
27
28
	SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib)
	set(CMAKE_CONFIGURATION_TYPES Release Debug)
ELSE()
	SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/${CMAKE_BUILD_TYPE})
29
30
31
32
33
34
35
36
37
38
39
40
41
42
	ExternalProject_Add(
		Tinyxml2
		PREFIX ${CMAKE_CURRENT_BINARY_DIR}/tinyxml2
		GIT_REPOSITORY https://github.com/leethomason/tinyxml2.git
		CMAKE_CACHE_ARGS "-DCMAKE_BUILD_TYPE:string=${CMAKE_BUILD_TYPE}"
		CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${CGoGN_ROOT_DIR}/ThirdParty/TinyXml2"
		BUILD_COMMAND make
		INSTALL_COMMAND make install
	)
	INSTALL (DIRECTORY TinyXml2/include/ DESTINATION ${CGoGN_ROOT_DIR}/ThirdParty/include)
	INSTALL (DIRECTORY TinyXml2/${CMAKE_INSTALL_LIBDIR}/ DESTINATION ${CGoGN_ROOT_DIR}/lib/${CMAKE_BUILD_TYPE}
				 PATTERN "pkgconfig" EXCLUDE )


Sylvain Thery's avatar
Sylvain Thery committed
43
ENDIF()
unknown's avatar
unknown committed
44

Sylvain Thery's avatar
Sylvain Thery committed
45

unknown's avatar
unknown committed
46

Sylvain Thery's avatar
Sylvain Thery committed
47
48
# for shared or not shared
SET (BUILD_SHARED_LIBS OFF CACHE BOOL 
49
	"if used all library are build as shared type (.so/.dylib/.dll)")
Sylvain Thery's avatar
Sylvain Thery committed
50

Sylvain Thery's avatar
Sylvain Thery committed
51
SET (WITH_ASSIMP OFF CACHE BOOL "build with Assimp")
52
SET (WITH_ZINRI ON CACHE BOOL "build with Zinri libs")
Thery Sylvain's avatar
Thery Sylvain committed
53
SET (WITH_PYTHONQT ON CACHE BOOL "build PythonQt (for Schnapps)")
Sylvain Thery's avatar
Sylvain Thery committed
54

55
56
57
IF (APPLE)
	SET(CMAKE_OSX_ARCHITECTURES x86_64)
ENDIF(APPLE)
58
59
60

add_subdirectory(Tools Tools/build)

Thery Sylvain's avatar
Thery Sylvain committed
61
62
63
64
IF (WITH_PYTHONQT)
	add_subdirectory(PythonQt PythonQt/build)
	INSTALL (DIRECTORY PythonQt/src/ DESTINATION ${CGoGN_ROOT_DIR}/ThirdParty/include/PythonQt FILES_MATCHING PATTERN "*.h")
ENDIF (WITH_PYTHONQT)
65

66
67
68
add_subdirectory(OpenNL OpenNL/build)
INSTALL (DIRECTORY OpenNL/src/NL/ DESTINATION ${CGoGN_ROOT_DIR}/ThirdParty/include/NL FILES_MATCHING PATTERN "*.h")

69
70
71
add_subdirectory(tetgen tetgen/build)
INSTALL (DIRECTORY tetgen/ DESTINATION ${CGoGN_ROOT_DIR}/ThirdParty/include/tetgen FILES_MATCHING PATTERN "*.h")

72
73
IF (WITH_ZINRI)
	add_subdirectory(Zinri Zinri/build)
74
	INSTALL (DIRECTORY Zinri/ DESTINATION ${CGoGN_ROOT_DIR}/ThirdParty/include/Zinri FILES_MATCHING PATTERN "*.h")
75
76
ENDIF(WITH_ZINRI)

Sylvain Thery's avatar
Sylvain Thery committed
77
IF (WITH_ASSIMP)
78
	add_subdirectory(Assimp Assimp/build)
79
	INSTALL (DIRECTORY Assimp/include/ DESTINATION ${CGoGN_ROOT_DIR}/ThirdParty/include/Assimp)
Sylvain Thery's avatar
Sylvain Thery committed
80
ENDIF (WITH_ASSIMP)