Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 85 lines (64 sloc) 2.525 kb
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
### AI
#
# Global variables set in this file:
# * AI_EXCLUDE_REGEX
# * AI_FIND_QUIETLY
# * DEPS_AI_ALL
#
# Functions and macros defined in this file:
# * AIMessage
#

add_definitions(-DBUILDING_AI)


### User-definable build options
set (AI_EXCLUDE_REGEX "XXXXXXXX" CACHE STRING "Which Skirmish AIs not to build (none by default, example: \"NTai|Null.*AI\", see also: AI_TYPES")
set (AI_FIND_QUIETLY FALSE CACHE BOOL "Whether to find AI Interfaces and Skirmish AIs quietly")

set(rts "${CMAKE_SOURCE_DIR}/rts")

include_directories(
${rts}
${CMAKE_BINARY_DIR}/src-generated/engine
${rts}/ExternalAI/Interface
Wrappers
)

# Set these for Interfaces and AIs with C sources
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
set(CMAKE_C_FLAGS_DEBUG2 "${CMAKE_CXX_FLAGS_DEBUG2}")
set(CMAKE_C_FLAGS_DEBUG3 "${CMAKE_CXX_FLAGS_DEBUG3}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
set(CMAKE_C_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_PROFILE}")

remove_definitions(-DSTREFLOP_SSE)
add_definitions(${PIC_FLAG} -D_REENTRANT -D_GNU_SOURCE=1)

if (WIN32)
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--kill-at -Wl,--add-stdcall-alias")
endif (WIN32)


# Assemble common additional native AI sources
list(APPEND ai_common_SRC "${rts}/Game/GameVersion.cpp")
list(APPEND ai_common_SRC "${rts}/System/SafeCStrings.c")


# Set some Skirmish AI stuff here already,
# cause it is used by NullPythonAI in Interfaces/Python

# Export Paths needed for the AIs
set(SKIRMISH_AI_LIBS "${AI_LIBS_DIR}/AI/Skirmish")
set(SKIRMISH_AI_DATA "${AI_DATA_DIR}/AI/Skirmish")

# Display messages on configure, which AIs are found
set(SKIRMISHAI_FIND_QUIETLY ${AI_FIND_QUIETLY})

MakeGlobal(SKIRMISH_AI_LIBS SKIRMISH_AI_DATA SKIRMISHAI_FIND_QUIETLY)


# Print a message, but only if we are allowed to speak.
macro (AIMessage type msg)
if (NOT AI_FIND_QUIETLY)
message(${type} "${msg}")
endif (NOT AI_FIND_QUIETLY)
endmacro (AIMessage type msg)


find_package(AWK)

# CUtils has to come first, because the Interfaces use it too
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Wrappers/CUtils)
Add_Subdirectory(Wrappers/CUtils)
endif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Wrappers/CUtils)
Add_Subdirectory(Interfaces)
Add_Subdirectory(Wrappers)
Add_Subdirectory(Skirmish)

set(DEPS_AI_ALL
${DEPS_AI_INTERFACES}
${DEPS_AI_WRAPPERS}
${DEPS_AI_SKIRMISH}
)
MakeGlobal(DEPS_AI_ALL)
Something went wrong with that request. Please try again.