CMakeLists.txt 2.58 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 11 12
IF(WIN32)
	SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib)
ELSE(WIN32)
	SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/Release)
	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOTOPOWARNING")
ENDIF(WIN32)
Pierre Kraemer's avatar
Pierre Kraemer committed
13

Sylvain Thery's avatar
Sylvain Thery committed
14 15 16 17 18
# FOR Qt4
SET(QT_USE_QTOPENGL TRUE)
INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS})

Pierre Kraemer's avatar
Pierre Kraemer committed
19 20

include_directories(
21
	${CMAKE_CURRENT_BINARY_DIR}
Pierre Kraemer's avatar
Pierre Kraemer committed
22
	${CGoGN_ROOT_DIR}/include
Sylvain Thery's avatar
Sylvain Thery committed
23
	${CGoGN_EXT_INCLUDES}
Pierre Kraemer's avatar
Pierre Kraemer committed
24 25 26 27 28 29 30 31 32 33
)

file(
	GLOB_RECURSE
	files_topology
	${CGoGN_ROOT_DIR}/src/Topology/*.cpp
	${CGoGN_ROOT_DIR}/include/Topology/*.hpp
	${CGoGN_ROOT_DIR}/include/Topology/*.h
)
add_library(
Sylvain Thery's avatar
Sylvain Thery committed
34
	topology
Pierre Kraemer's avatar
Pierre Kraemer committed
35 36 37 38 39 40 41 42 43 44 45
	${files_topology}
)

file(
	GLOB_RECURSE
	files_container
	${CGoGN_ROOT_DIR}/src/Container/*.cpp
	${CGoGN_ROOT_DIR}/include/Container/*.hpp
	${CGoGN_ROOT_DIR}/include/Container/*.h
)
add_library(
Sylvain Thery's avatar
Sylvain Thery committed
46
	container
Pierre Kraemer's avatar
Pierre Kraemer committed
47 48 49 50 51 52 53 54 55 56 57 58
	${files_container}
)

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
)
add_library(
Sylvain Thery's avatar
Sylvain Thery committed
59
	algo
Pierre Kraemer's avatar
Pierre Kraemer committed
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
	${files_algo}
)

#file(
#	GLOB_RECURSE
#	files_geometry
#	${CGoGN_ROOT_DIR}/src/Geometry/*.cpp
#	${CGoGN_ROOT_DIR}/include/Geometry/*.hpp
#	${CGoGN_ROOT_DIR}/include/Geometry/*.h
#)
#add_library(
#	geometry
#	${files_geometry}
#)

Sylvain Thery's avatar
Sylvain Thery committed
75

76 77 78 79 80 81 82 83 84 85 86
file(
	GLOB_RECURSE
	shaders_src
	${CGoGN_ROOT_DIR}/include/Utils/*.frag
	${CGoGN_ROOT_DIR}/include/Utils/*.vert
	${CGoGN_ROOT_DIR}/include/Utils/*.geom	
	${CGoGN_ROOT_DIR}/include/Utils/Shaders*.frag
	${CGoGN_ROOT_DIR}/include/Utils/Shaders*.vert
	${CGoGN_ROOT_DIR}/include/Utils/Shaders*.geom
)

87 88

IF(WIN32)
Sylvain Thery's avatar
Sylvain Thery committed
89
add_custom_target(shader_target ${CGoGN_ROOT_DIR}/bin/shader_to_h ${shaders_src}
90 91 92 93
	WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
	SOURCES ${shaders_src} 
)
ELSE(WIN32)
Sylvain Thery's avatar
Sylvain Thery committed
94
add_custom_target(shader_target ${CGoGN_ROOT_DIR}/bin/shader_to_h ${shaders_src}
95 96 97
	WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
	SOURCES ${shaders_src} 
)
98 99
ENDIF(WIN32)

100 101 102



Pierre Kraemer's avatar
Pierre Kraemer committed
103 104 105 106 107 108 109
file(
	GLOB_RECURSE
	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
110

111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
IF(WITH_QT)
	file(
		GLOB_RECURSE
		${CGoGN_ROOT_DIR}/src/Utils/Qt/*.cpp
		${CGoGN_ROOT_DIR}/include/Utils/Qt/*.hpp
		${CGoGN_ROOT_DIR}/include/Utils/Qt/*.h
	)

	file(
		GLOB_RECURSE
		utils_qt_headers
		${CGoGN_ROOT_DIR}/include/Utils/qt*.h
	)
	QT4_WRAP_CPP(UTILS_QT_HEADERS_MOC ${utils_qt_headers})
	SET (files_utils_withQt ${files_utils} ${UTILS_QT_HEADERS_MOC})
	add_library( utils ${files_utils_withQt} )
ELSE(WITH_QT)
	add_library( utils ${files_utils} )
ENDIF (WITH_QT)

Sylvain Thery's avatar
Sylvain Thery committed
131 132


Pierre Kraemer's avatar
Pierre Kraemer committed
133

134
add_dependencies(utils shader_target )
Sylvain Thery's avatar
Sylvain Thery committed
135 136 137