CMakeLists.txt 3.42 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
cmake_minimum_required(VERSION 2.8)

project(CGoGN_LIB)

# for shaders
include_directories( ${CMAKE_CURRENT_BINARY_DIR} 	)



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

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

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

file(
	GLOB
	shaders_src
	${CGoGN_SRC_DIR}/include/Utils/*.frag
	${CGoGN_SRC_DIR}/include/Utils/*.vert
	${CGoGN_SRC_DIR}/include/Utils/*.geom	
	${CGoGN_SRC_DIR}/include/Utils/Shaders/*.frag
	${CGoGN_SRC_DIR}/include/Utils/Shaders/*.vert
	${CGoGN_SRC_DIR}/include/Utils/Shaders/*.geom
)


IF(WIN32)
	add_custom_target(shader_target ${CGoGN_ROOT_DIR}/ThirdParty/bin/Release/shader_to_h ${shaders_src}
	WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
	SOURCES ${shaders_src} )
ELSE()
	add_custom_target(shader_target ${CGoGN_ROOT_DIR}/ThirdParty/bin/shader_to_h ${shaders_src}
	WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
	SOURCES ${shaders_src} )
ENDIF()


file(
	GLOB		# WARNING NO MORE RECURSE TO AVOID TAKING QT FILES
	files_utils
	${CGoGN_SRC_DIR}/src/Utils/*.cpp
	${CGoGN_SRC_DIR}/include/Utils/*.hpp
	${CGoGN_SRC_DIR}/include/Utils/*.h

	${CGoGN_SRC_DIR}/src/Utils/Shaders/*.cpp
	${CGoGN_SRC_DIR}/include/Utils/Shaders/*.hpp
	${CGoGN_SRC_DIR}/include/Utils/Shaders/*.h
)

IF(WITH_QT)
	file(
		GLOB
		files_utils_qt
		${CGoGN_SRC_DIR}/src/Utils/Qt/*.cpp
		${CGoGN_SRC_DIR}/include/Utils/Qt/*.hpp
		${CGoGN_SRC_DIR}/include/Utils/Qt/*.h
	)
	file(
		GLOB
		utils_qt_headers
		${CGoGN_SRC_DIR}/include/Utils/Qt/qtgl.h
		${CGoGN_SRC_DIR}/include/Utils/Qt/qtSimple.h
		${CGoGN_SRC_DIR}/include/Utils/Qt/qtQGLV_glw.h
		${CGoGN_SRC_DIR}/include/Utils/Qt/qtQGLV.h
		${CGoGN_SRC_DIR}/include/Utils/Qt/qtpopup.h
		${CGoGN_SRC_DIR}/include/Utils/Qt/qthistodraw.h 
		${CGoGN_SRC_DIR}/include/Utils/Qt/qtcolorschooser.h
	)	
		
	QT4_WRAP_CPP(UTILS_QT_HEADERS_MOC ${utils_qt_headers})
	SET (files_utils_withQt ${files_utils} ${files_utils_qt} ${UTILS_QT_HEADERS_MOC})
ENDIF()

file(	GLOB_RECURSE
		files_geometry
		${CGoGN_SRC_DIR}/include/Geometry/*.h
		${CGoGN_SRC_DIR}/include/Geometry/*.hpp
)

file(	GLOB_RECURSE
		files_thirdParty
		${CGoGN_ROOT_DIR}/ThirdParty/include/*.h
		${CGoGN_ROOT_DIR}/ThirdParty/include/*.hpp
)

link_directories( ${CGoGN_ROOT_DIR}/lib/${CMAKE_BUILD_TYPE} )

IF (ONELIB)
	IF(WITH_QT)
		add_library( cgogn ${files_topology} ${files_container} ${files_algo} ${files_utils_withQt}) 
	ELSE()
		add_library( cgogn ${files_topology} ${files_container} ${files_algo} ${files_utils} )
	ENDIF()
	add_dependencies(cgogn shader_target)
	target_link_libraries(cgogn ${CGoGN_EXT_LIBS})

ELSE()
	IF (WITH_QT)
		add_library( utils ${files_utils_withQt} )
	ELSE()
		add_library( utils ${files_utils} )
	ENDIF()
	target_link_libraries(utils ${CGoGN_EXT_LIBS})

	add_library( container	${files_container})
	target_link_libraries(container utils)

	add_library( topology	${files_topology})
	target_link_libraries(topology container)

	add_library( algo		${files_algo})
	target_link_libraries(algo utils topology)


	add_custom_target( Geometry 	SOURCES ${files_geometry} )
	add_custom_target( ThirdParty 	SOURCES ${files_thirdParty} )
	add_dependencies( utils shader_target )
ENDIF()