summaryrefslogtreecommitdiff
path: root/adm/cmake/TKOpenGl/CMakeLists.txt
blob: aed0f9fb6f675230aa02fe579497a582aed4959b (plain)
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
SET(TOOLKIT TKOpenGl)

SET(TOOLKIT_MODULES
	OpenGl
)
SET(TOOLKIT_DEPENDS
	TKService
	TKernel
	TKV3d
)

IF(CMAKE_CONFIGURATION_TYPES OR NMAKE)
	SET(TOOLKIT_LIBS ${OPENGL_LIBRARIES})
	SET(TOOLKIT_LIBS_DEBUG ${FTGL_LIBRARY_DEBUG} ${FREETYPE_LIBRARY_DEBUG})
	SET(TOOLKIT_LIBS_OPTIMIZED ${FTGL_LIBRARY} ${FREETYPE_LIBRARIES})
ELSE(CMAKE_CONFIGURATION_TYPES OR NMAKE)
	SET(TOOLKIT_LIBS ${OPENGL_LIBRARIES} ${FREETYPE_LIBRARIES} ${FTGL_LIBRARY})
ENDIF(CMAKE_CONFIGURATION_TYPES OR NMAKE)

SET(TOOLKIT_INCLUDE_DIRECTORIES ${OPENGL_INCLUDE_DIR} ${FREETYPE_INCLUDE_DIRS} ${FTGL_INCLUDE_DIR})

IF(GL2PS_LIBRARY AND ${PROJECT_NAME}_WITH_GL2PS)
	ADD_DEFINITIONS(-DHAVE_GL2PS)

	IF(CMAKE_CONFIGURATION_TYPES OR NMAKE)
		SET(TOOLKIT_LIBS_DEBUG ${TOOLKIT_LIBS_DEBUG} ${GL2PS_LIBRARY_DEBUG})
		SET(TOOLKIT_LIBS_OPTIMIZED ${TOOLKIT_LIBS_OPTIMIZED} ${GL2PS_LIBRARY})
	ELSE (CMAKE_CONFIGURATION_TYPES OR NMAKE)
		SET(TOOLKIT_LIBS ${TOOLKIT_LIBS} ${GL2PS_LIBRARY})
	ENDIF(CMAKE_CONFIGURATION_TYPES OR NMAKE)

	SET(TOOLKIT_INCLUDE_DIRECTORIES ${TOOLKIT_INCLUDE_DIRECTORIES} ${GL2PS_INCLUDE_DIR})
ENDIF(GL2PS_LIBRARY AND ${PROJECT_NAME}_WITH_GL2PS)

IF(WIN32)
    LIST(APPEND TOOLKIT_LIBS vfw32)
ENDIF()

INCLUDE(../BuildToolkit.cmake)

IF(BORLAND AND BORLAND_VERSION_RS_XE2)
	# For bcc32 compiler v6.40 and up -x- compiler option must be passed as a compiler option
	# in stead of #pragma option -x- in code.
	foreach(source_file ${TOOLKIT_SOURCE_FILES} )
		if((source_file MATCHES "OpenGl_attri.cxx") OR
		   (source_file MATCHES "OpenGl_depthcue.cxx") OR
		   (source_file MATCHES "OpenGl_pick.cxx") OR
		   (source_file MATCHES "OpenGl_telem_util.cxx") OR
		   (source_file MATCHES "OpenGl_undefined.cxx") OR
		   (source_file MATCHES "OpenGl_view.cxx"))
			MESSAGE(STATUS "(bcc32) Disabling exceptions for ${source_file}.")
			set_source_files_properties("${source_file}" PROPERTIES COMPILE_FLAGS "-x-")
		endif()
	endforeach(source_file)
ENDIF(BORLAND AND BORLAND_VERSION_RS_XE2)