File: CMakeLists.txt

package info (click to toggle)
spring 0.81.2.1%2Bdfsg1-6
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 28,496 kB
  • ctags: 37,096
  • sloc: cpp: 238,659; ansic: 13,784; java: 12,175; awk: 3,428; python: 1,159; xml: 738; perl: 405; sh: 297; makefile: 267; pascal: 228; objc: 192
file content (59 lines) | stat: -rw-r--r-- 2,064 bytes parent folder | download
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
### Legacy C++ AI Wrapper
#
# Global variables set in this file:
# * BUILD_LegacyCpp_AIWRAPPER
# * LegacyCpp_AIWRAPPER_TARGET
# * LegacyCpp_Creg_AIWRAPPER_TARGET
#


set(mySourceDirRel    "")


# Check if the user wants to compile the wrapper
if    ("${AI_TYPES}" STREQUAL "ALL" OR "${AI_TYPES}" STREQUAL "NATIVE")
	set(AIWRAPPERS_NATIVE TRUE)
else  ("${AI_TYPES}" STREQUAL "ALL" OR "${AI_TYPES}" STREQUAL "NATIVE")
	set(AIWRAPPERS_NATIVE FALSE)
endif ("${AI_TYPES}" STREQUAL "ALL" OR "${AI_TYPES}" STREQUAL "NATIVE")


# Check dependencies of the wrapper are met
if    (AIWRAPPERS_NATIVE)
	SetGlobal(BUILD_${myName}_AIWRAPPER TRUE)
else  (AIWRAPPERS_NATIVE)
	SetGlobal(BUILD_${myName}_AIWRAPPER FALSE)
	message ("warning: Legacy C++ AI Wrapper will not be built!")
endif (AIWRAPPERS_NATIVE)


# Build
if    (BUILD_${myName}_AIWRAPPER)
	set(myDir        "${CMAKE_CURRENT_SOURCE_DIR}")
	GetLastPathPart(dirName ${myDir})
	set(myName       "${dirName}")
	set(myTarget     "${myName}-AIWrapper")
	set(myCregTarget "${myName}-Creg-AIWrapper")
	MakeAbsolute(mySourceDir "${myDir}" "${mySourceDirRel}")

	AIWrapperMessage(STATUS "Found AI Wrapper: ${myTarget}")
	AIWrapperMessage(STATUS "Found AI Wrapper: ${myCregTarget}")

	SetGlobal(${myName}_AIWRAPPER_TARGET      ${myTarget})
	SetGlobal(${myName}_Creg_AIWRAPPER_TARGET ${myCregTarget})

	# Assemble the Legacy C++ AI sources
	aux_source_directory("${mySourceDir}" mySources)
	list(APPEND mySources ${ai_common_SRC})
	list(APPEND mySources ${rts}/System/float3)
	list(APPEND mySources ${rts}/Sim/Misc/DamageArray)

	# Compile the Legacy C++ AI wrapper static library
	add_library(${myTarget}     STATIC ${mySources})
	set_target_properties(${myTarget} PROPERTIES OUTPUT_NAME "${myName}")

	# Compile the Legacy C++ AI wrapper static library with creg support
	add_library(${myCregTarget} STATIC ${mySources} ${creg_SRC})
	set_target_properties(${myCregTarget} PROPERTIES OUTPUT_NAME   "${myName}Creg")
	set_target_properties(${myCregTarget} PROPERTIES COMPILE_FLAGS "-DUSING_CREG")
endif (BUILD_${myName}_AIWRAPPER)