CMakeLists.txt 2.29 KB
Newer Older
Sylvain Thery's avatar
Sylvain Thery committed
1
cmake_minimum_required(VERSION 2.8)
2

Pierre Kraemer's avatar
Pierre Kraemer committed
3
project(CGoGN_ThirdParty)
4
#cmake_policy(SET CMP0042 NEW) # rpath new policy
5

6
SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/..)
unknown's avatar
unknown committed
7 8 9


IF (${CMAKE_CURRENT_BINARY_DIR} MATCHES "(.*)Debug")
10 11 12 13
	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
14 15

IF(WIN32)
Sylvain Thery's avatar
Sylvain Thery committed
16
	set(CMAKE_PREFIX_PATH ${CGoGN_ROOT_DIR}/windows_dependencies CACHE STRING "path to dependencies")
unknown's avatar
unknown committed
17
	INCLUDE_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/include/)
unknown's avatar
unknown committed
18
	INCLUDE_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/include/suitesparse)
Sylvain Thery's avatar
Sylvain Thery committed
19 20
	SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib)
	set(CMAKE_CONFIGURATION_TYPES Release Debug)
21
	SET (BUILD_SHARED_LIBS OFF CACHE BOOL "if used all library are build as shared type (.so/.dylib/.dll)")
Sylvain Thery's avatar
Sylvain Thery committed
22 23
ELSE()
	SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/${CMAKE_BUILD_TYPE})
24
	SET (BUILD_SHARED_LIBS ON CACHE BOOL "if used all library are build as shared type (.so/.dylib/.dll)")
Sylvain Thery's avatar
Sylvain Thery committed
25
ENDIF()
unknown's avatar
unknown committed
26

Sylvain Thery's avatar
Sylvain Thery committed
27

28
# for shared or not shared
Sylvain Thery's avatar
Sylvain Thery committed
29

30
SET (WITH_ASSIMP OFF CACHE BOOL "build with Assimp")
31
SET (WITH_ZINRI ON CACHE BOOL "build with Zinri libs")
32
SET (WITH_PYTHONQT ON CACHE BOOL "build PythonQt (for Schnapps)")
Sylvain Thery's avatar
Sylvain Thery committed
33

34 35 36
IF (APPLE)
	SET(CMAKE_OSX_ARCHITECTURES x86_64)
ENDIF(APPLE)
37 38 39

add_subdirectory(Tools Tools/build)

40 41 42 43
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)
44

45 46 47
add_subdirectory(OpenNL OpenNL/build)
INSTALL (DIRECTORY OpenNL/src/NL/ DESTINATION ${CGoGN_ROOT_DIR}/ThirdParty/include/NL FILES_MATCHING PATTERN "*.h")

48 49 50
add_subdirectory(tetgen tetgen/build)
INSTALL (DIRECTORY tetgen/ DESTINATION ${CGoGN_ROOT_DIR}/ThirdParty/include/tetgen FILES_MATCHING PATTERN "*.h")

51 52
IF (WITH_ZINRI)
	add_subdirectory(Zinri Zinri/build)
53
	INSTALL (DIRECTORY Zinri/ DESTINATION ${CGoGN_ROOT_DIR}/ThirdParty/include/Zinri FILES_MATCHING PATTERN "*.h")
54 55
ENDIF(WITH_ZINRI)

56
IF (WITH_ASSIMP)
57
	add_subdirectory(Assimp Assimp/build)
58
	INSTALL (DIRECTORY Assimp/include/ DESTINATION ${CGoGN_ROOT_DIR}/ThirdParty/include/Assimp)
59
ENDIF (WITH_ASSIMP)
60 61 62 63

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