CMakeLists.txt 3.02 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
SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/..)
unknown's avatar
unknown committed
8
9

IF(WIN32)
Sylvain Thery's avatar
Sylvain Thery committed
10
	
unknown's avatar
unknown committed
11
12
13
ENDIF(WIN32)

IF (${CMAKE_CURRENT_BINARY_DIR} MATCHES "(.*)Debug")
Sylvain Thery's avatar
Sylvain Thery committed
14
15
16
17
	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
18
19

IF(WIN32)
Sylvain Thery's avatar
Sylvain Thery committed
20
	set(CMAKE_PREFIX_PATH ${CGoGN_ROOT_DIR}/windows_dependencies CACHE STRING "path to dependencies")
unknown's avatar
unknown committed
21
	INCLUDE_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/include/)
unknown's avatar
unknown committed
22
	INCLUDE_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/include/suitesparse)
Sylvain Thery's avatar
Sylvain Thery committed
23
24
25
26
27
28
29
30
31
32
	SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib)
	set(CMAKE_CONFIGURATION_TYPES Release Debug)
#	SET(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE})
#	SET(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "" FORCE)
#	MARK_AS_ADVANCED(CMAKE_CONFIGURATION_TYPES)
ELSE()
	SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/${CMAKE_BUILD_TYPE})
ENDIF()
IF(WIN32)
	
unknown's avatar
unknown committed
33
34
ENDIF(WIN32)

Sylvain Thery's avatar
Sylvain Thery committed
35

unknown's avatar
unknown committed
36

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

41
SET (WITH_TINYXML2 ON CACHE BOOL "get & build tinyxml2")
Sylvain Thery's avatar
Sylvain Thery committed
42
SET (WITH_ASSIMP OFF CACHE BOOL "build with Assimp")
43
SET (WITH_ZINRI ON CACHE BOOL "build with Zinri libs")
Thery Sylvain's avatar
Thery Sylvain committed
44
SET (WITH_PYTHONQT ON CACHE BOOL "build PythonQt (for Schnapps)")
Sylvain Thery's avatar
Sylvain Thery committed
45

46
47
48
IF (APPLE)
	SET(CMAKE_OSX_ARCHITECTURES x86_64)
ENDIF(APPLE)
49
50
51

add_subdirectory(Tools Tools/build)

Thery Sylvain's avatar
Thery Sylvain committed
52
53
54
55
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)
56

57
58
59
add_subdirectory(OpenNL OpenNL/build)
INSTALL (DIRECTORY OpenNL/src/NL/ DESTINATION ${CGoGN_ROOT_DIR}/ThirdParty/include/NL FILES_MATCHING PATTERN "*.h")

60
61
62
add_subdirectory(tetgen tetgen/build)
INSTALL (DIRECTORY tetgen/ DESTINATION ${CGoGN_ROOT_DIR}/ThirdParty/include/tetgen FILES_MATCHING PATTERN "*.h")

63
64
IF (WITH_ZINRI)
	add_subdirectory(Zinri Zinri/build)
65
	INSTALL (DIRECTORY Zinri/ DESTINATION ${CGoGN_ROOT_DIR}/ThirdParty/include/Zinri FILES_MATCHING PATTERN "*.h")
66
67
ENDIF(WITH_ZINRI)

Sylvain Thery's avatar
Sylvain Thery committed
68
IF (WITH_ASSIMP)
69
	add_subdirectory(Assimp Assimp/build)
70
	INSTALL (DIRECTORY Assimp/include/ DESTINATION ${CGoGN_ROOT_DIR}/ThirdParty/include/Assimp)
Sylvain Thery's avatar
Sylvain Thery committed
71
ENDIF (WITH_ASSIMP)
72

73
74
75
76
77
78
79
80
81
82
83
IF (WITH_TINYXML2)
	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)
Sylvain Thery's avatar
Sylvain Thery committed
84
85
86
87
	FILE( GLOB_RECURSE tinyLib_files 
				${CGoGN_ROOT_DIR}/ThirdParty/TinyXml2/lib/*.so*
				${CGoGN_ROOT_DIR}/ThirdParty/TinyXml2/lib/*.a
				${CGoGN_ROOT_DIR}/ThirdParty/TinyXml2/lib/*.dylib )
Sylvain Thery's avatar
Sylvain Thery committed
88
89
	INSTALL (FILES ${tinyLib_files} DESTINATION ${CGoGN_ROOT_DIR}/lib/${CMAKE_BUILD_TYPE})
ENDIF (WITH_TINYXML2)