CMakeLists.txt 3.46 KB
Newer Older
Sylvain Thery's avatar
Sylvain Thery committed
1
cmake_minimum_required(VERSION 2.8)
Pierre Kraemer's avatar
Pierre Kraemer committed
2 3 4

project(CGoGNRelease)

thery's avatar
thery committed
5
SET(CMAKE_BUILD_TYPE Release)
Pierre Kraemer's avatar
Pierre Kraemer committed
6

thery's avatar
thery committed
7 8 9 10
IF(WIN32)
	SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib)
ELSE(WIN32)
	SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release)
11
	ADD_DEFINITIONS(-DNOTOPOWARNING)
thery's avatar
thery committed
12
ENDIF(WIN32)
Pierre Kraemer's avatar
Pierre Kraemer committed
13 14

include_directories(
15
	${CMAKE_CURRENT_BINARY_DIR}
Pierre Kraemer's avatar
Pierre Kraemer committed
16
	${CGoGN_ROOT_DIR}/include
Sylvain Thery's avatar
Sylvain Thery committed
17
	${CGoGN_EXT_INCLUDES}
Pierre Kraemer's avatar
Pierre Kraemer committed
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
)

file(
	GLOB_RECURSE
	files_topology
	${CGoGN_ROOT_DIR}/src/Topology/*.cpp
	${CGoGN_ROOT_DIR}/include/Topology/*.hpp
	${CGoGN_ROOT_DIR}/include/Topology/*.h
)

file(
	GLOB_RECURSE
	files_container
	${CGoGN_ROOT_DIR}/src/Container/*.cpp
	${CGoGN_ROOT_DIR}/include/Container/*.hpp
	${CGoGN_ROOT_DIR}/include/Container/*.h
)

file(
	GLOB_RECURSE
	files_algo
	${CGoGN_ROOT_DIR}/src/Algo/*.cpp
	${CGoGN_ROOT_DIR}/src/Algo/*.c
	${CGoGN_ROOT_DIR}/include/Algo/*.hpp
	${CGoGN_ROOT_DIR}/include/Algo/*.h
)

45
file(
Sylvain Thery's avatar
Sylvain Thery committed
46
	GLOB
47 48 49 50
	shaders_src
	${CGoGN_ROOT_DIR}/include/Utils/*.frag
	${CGoGN_ROOT_DIR}/include/Utils/*.vert
	${CGoGN_ROOT_DIR}/include/Utils/*.geom	
Sylvain Thery's avatar
Sylvain Thery committed
51 52 53
	${CGoGN_ROOT_DIR}/include/Utils/Shaders/*.frag
	${CGoGN_ROOT_DIR}/include/Utils/Shaders/*.vert
	${CGoGN_ROOT_DIR}/include/Utils/Shaders/*.geom
54 55
)

56 57

IF(WIN32)
unknown's avatar
unknown committed
58
	add_custom_target(shader_target ${CGoGN_ROOT_DIR}/ThirdParty/bin/Release/shader_to_h ${shaders_src}
59
	WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
unknown's avatar
unknown committed
60
	SOURCES ${shaders_src} )
61
ELSE(WIN32)
unknown's avatar
unknown committed
62
	add_custom_target(shader_target ${CGoGN_ROOT_DIR}/ThirdParty/bin/shader_to_h ${shaders_src}
63
	WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
unknown's avatar
unknown committed
64
	SOURCES ${shaders_src} )
65 66
ENDIF(WIN32)

67

Pierre Kraemer's avatar
Pierre Kraemer committed
68
file(
Sylvain Thery's avatar
Sylvain Thery committed
69
	GLOB		# WARNING NO MORE RECURSE TO AVOID TAKING QT FILES
Pierre Kraemer's avatar
Pierre Kraemer committed
70 71 72 73
	files_utils
	${CGoGN_ROOT_DIR}/src/Utils/*.cpp
	${CGoGN_ROOT_DIR}/include/Utils/*.hpp
	${CGoGN_ROOT_DIR}/include/Utils/*.h
Sylvain Thery's avatar
Sylvain Thery committed
74 75 76 77

	${CGoGN_ROOT_DIR}/src/Utils/Shaders/*.cpp
	${CGoGN_ROOT_DIR}/include/Utils/Shaders/*.hpp
	${CGoGN_ROOT_DIR}/include/Utils/Shaders/*.h
Pierre Kraemer's avatar
Pierre Kraemer committed
78
)
Sylvain Thery's avatar
Sylvain Thery committed
79

80 81
IF(WITH_QT)
	file(
82 83
		GLOB
		files_utils_qt
84 85
		${CGoGN_ROOT_DIR}/src/Utils/Qt/*.cpp
		${CGoGN_ROOT_DIR}/include/Utils/Qt/*.hpp
86 87
		${CGoGN_ROOT_DIR}/include/Utils/Qt/*.h
	)
88
	file(
Sylvain Thery's avatar
Sylvain Thery committed
89
		GLOB
90
		utils_qt_headers
91
		${CGoGN_ROOT_DIR}/include/Utils/Qt/qtgl.h
Sylvain Thery's avatar
Sylvain Thery committed
92
		${CGoGN_ROOT_DIR}/include/Utils/Qt/qtSimple.h
Sylvain Thery's avatar
Sylvain Thery committed
93 94 95
		${CGoGN_ROOT_DIR}/include/Utils/Qt/qtQGLV_glw.h
		${CGoGN_ROOT_DIR}/include/Utils/Qt/qtQGLV.h
		${CGoGN_ROOT_DIR}/include/Utils/Qt/qtpopup.h
Sylvain Thery's avatar
Sylvain Thery committed
96
		${CGoGN_ROOT_DIR}/include/Utils/Qt/qthistodraw.h 
97 98
		${CGoGN_ROOT_DIR}/include/Utils/Qt/qtcolorschooser.h
	)	
99
		
100
	QT4_WRAP_CPP(UTILS_QT_HEADERS_MOC ${utils_qt_headers})
101
	SET (files_utils_withQt ${files_utils} ${files_utils_qt} ${UTILS_QT_HEADERS_MOC})
102 103
ENDIF (WITH_QT)

104 105 106 107 108 109 110 111 112 113 114
file(	GLOB_RECURSE
		files_geometry
		${CGoGN_ROOT_DIR}/include/Geometry/*.h
		${CGoGN_ROOT_DIR}/include/Geometry/*.hpp
)

file(	GLOB_RECURSE
		files_thirdParty
		${CGoGN_ROOT_DIR}/ThirdParty/include/*.h
		${CGoGN_ROOT_DIR}/ThirdParty/include/*.hpp
)
Sylvain Thery's avatar
Sylvain Thery committed
115

116 117 118 119 120 121
IF (ONELIB)
	IF(WITH_QT)
		add_library( cgogn ${files_topology} ${files_container} ${files_algo} ${files_utils_withQt}) 
	ELSE(WITH_QT)
		add_library( cgogn ${files_topology} ${files_container} ${files_algo} ${files_utils} )
	ENDIF (WITH_QT)
Sylvain Thery's avatar
Sylvain Thery committed
122
	add_dependencies(cgogn shader_target )
123 124 125 126 127 128 129 130 131
ELSE (ONELIB)
	add_library( container	${files_container})
	add_library( topology	${files_topology})
	add_library( algo		${files_algo})
	IF(WITH_QT)
		add_library( utils ${files_utils_withQt} )
	ELSE(WITH_QT)
		add_library( utils ${files_utils} )
	ENDIF (WITH_QT)
132 133 134
	add_custom_target( Geometry 	SOURCES ${files_geometry} )
	add_custom_target( ThirdParty 	SOURCES ${files_thirdParty} )
	add_dependencies( utils shader_target )
Sylvain Thery's avatar
Sylvain Thery committed
135
ENDIF (ONELIB)