summaryrefslogtreecommitdiff
path: root/adm/cmake/TKernel/CMakeLists.txt
blob: 893656b6b22f378f8efa98b23bad5f570de7d81b (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
56
57
58
59
SET(TOOLKIT TKernel)

SET(TOOLKIT_MODULES
	StdFail
	FSD
	MMgt
	OSD
	Plugin
	Quantity
	Resource
	SortTools
	Standard
	Storage
	TColStd
	TCollection
	TShort
	Units
	UnitsAPI
	IncludeLibrary
	Dico
	NCollection
	Message
)
IF(CMAKE_THREAD_LIBS_INIT)
	SET(TOOLKIT_LIBS ${CMAKE_THREAD_LIBS_INIT})
ENDIF(CMAKE_THREAD_LIBS_INIT)
SET(TOOLKIT_LIBS ${TOOLKIT_LIBS} ${CMAKE_DL_LIBS} ${LM})
IF(WIN32)
	SET(TOOLKIT_LIBS ${TOOLKIT_LIBS} ${CSF_SOCKETLibs_LIB} ${CSF_advapi32_LIB} ${CSF_gdi32_LIB} ${CSF_user32_LIB} ${CSF_kernel32_LIB})
ELSE(WIN32)
	#  An implementation for Mac OS X has been added in src/OSD/gettime_osx.h
	IF(NOT APPLE)
		INCLUDE( CheckFunctionExists )
		CHECK_FUNCTION_EXISTS( clock_gettime CLOCK_GETTIME_IN_LIBC )
		IF(NOT CLOCK_GETTIME_IN_LIBC)
			INCLUDE( CheckLibraryExists )
			CHECK_LIBRARY_EXISTS(rt clock_gettime "" CLOCK_GETTIME_IN_LIBRT)
			IF(NOT CLOCK_GETTIME_IN_LIBRT)
				MESSAGE(FATAL_ERROR "Could not find clock_gettime.")
			ENDIF(NOT CLOCK_GETTIME_IN_LIBRT)
			SET(TOOLKIT_LIBS ${TOOLKIT_LIBS} rt)
		ENDIF(NOT CLOCK_GETTIME_IN_LIBC)
	ENDIF(NOT APPLE)
ENDIF(WIN32)

# Adde-DHAVE_TBB in TKernel in order to benefit from Standard_MMgrTBBalloc
IF(${PROJECT_NAME}_TBB_MALLOC_SUPPORT AND TBB_INCLUDE_DIR AND TBB_MALLOC_LIBRARY)
	ADD_DEFINITIONS(-DHAVE_TBB)
	SET(TOOLKIT_INCLUDE_DIRECTORIES ${TBB_INCLUDE_DIR})
	IF(CMAKE_CONFIGURATION_TYPES OR NMAKE)
		SET(TOOLKIT_LIBS_DEBUG ${TOOLKIT_LIBS_DEBUG} ${TBB_MALLOC_LIBRARY_DEBUG})
		SET(TOOLKIT_LIBS_OPTIMIZED ${TOOLKIT_LIBS_OPTIMIZED} ${TBB_MALLOC_LIBRARY})
	ELSE(CMAKE_CONFIGURATION_TYPES OR NMAKE)
		SET(TOOLKIT_LIBS ${TOOLKIT_LIBS} ${TBB_MALLOC_LIBRARY})
	ENDIF(CMAKE_CONFIGURATION_TYPES OR NMAKE)
ENDIF(${PROJECT_NAME}_TBB_MALLOC_SUPPORT AND TBB_INCLUDE_DIR AND TBB_MALLOC_LIBRARY)

INCLUDE(../BuildToolkit.cmake)