2017-08-15 20:18:02 +02:00
|
|
|
#######################################
|
|
|
|
# FuzzyLite support #
|
|
|
|
#######################################
|
|
|
|
|
2017-08-16 02:44:34 +02:00
|
|
|
if(NOT WIN32 AND NOT APPLE)
|
|
|
|
option(FORCE_BUNDLED_FL "Force to use FuzzyLite included into VCMI's source tree" ON)
|
|
|
|
else()
|
|
|
|
option(FORCE_BUNDLED_FL "Force to use FuzzyLite included into VCMI's source tree" OFF)
|
|
|
|
endif()
|
2014-09-02 16:29:28 +03:00
|
|
|
|
2023-01-22 15:09:25 +02:00
|
|
|
#FuzzyLite uses MSVC pragmas in headers, so, we need to disable -Wunknown-pragmas
|
|
|
|
if(MINGW)
|
|
|
|
add_compile_options(-Wno-unknown-pragmas)
|
|
|
|
endif()
|
2022-12-15 12:16:28 +02:00
|
|
|
|
2017-08-15 20:17:00 +02:00
|
|
|
if(NOT FORCE_BUNDLED_FL)
|
2022-05-26 07:55:20 +02:00
|
|
|
find_package(fuzzylite)
|
2016-10-02 17:40:33 +02:00
|
|
|
else()
|
2022-05-26 07:55:20 +02:00
|
|
|
set(fuzzylite_FOUND FALSE)
|
2016-10-02 17:40:33 +02:00
|
|
|
endif()
|
|
|
|
|
2022-05-26 07:55:20 +02:00
|
|
|
if(TARGET fuzzylite::fuzzylite AND MSVC)
|
|
|
|
install_vcpkg_imported_tgt(fuzzylite::fuzzylite)
|
2021-07-27 20:26:17 +02:00
|
|
|
endif()
|
|
|
|
|
2022-05-26 07:55:20 +02:00
|
|
|
if(NOT fuzzylite_FOUND)
|
2023-02-25 09:15:20 +02:00
|
|
|
set(FL_BUILD_BINARY OFF CACHE BOOL "")
|
|
|
|
set(FL_BUILD_SHARED OFF CACHE BOOL "")
|
2017-08-15 20:17:00 +02:00
|
|
|
set(FL_BUILD_TESTS OFF CACHE BOOL "")
|
2023-02-25 09:15:09 +02:00
|
|
|
if(ANDROID)
|
|
|
|
set(FL_BACKTRACE OFF CACHE BOOL "" FORCE)
|
|
|
|
endif()
|
2023-01-22 15:09:25 +02:00
|
|
|
#It is for compiling FuzzyLite, it will not compile without it on GCC
|
|
|
|
if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
|
|
|
|
add_compile_options(-Wno-error=deprecated-declarations)
|
|
|
|
endif()
|
2017-08-15 20:18:02 +02:00
|
|
|
add_subdirectory(FuzzyLite/fuzzylite EXCLUDE_FROM_ALL)
|
2022-05-26 07:55:20 +02:00
|
|
|
add_library(fuzzylite::fuzzylite ALIAS fl-static)
|
|
|
|
target_include_directories(fl-static PUBLIC ${CMAKE_HOME_DIRECTORY}/AI/FuzzyLite/fuzzylite)
|
2014-09-02 16:29:28 +03:00
|
|
|
endif()
|
2017-08-15 20:17:00 +02:00
|
|
|
|
2017-08-15 20:18:02 +02:00
|
|
|
#######################################
|
|
|
|
# Add subdirectories #
|
|
|
|
#######################################
|
|
|
|
|
|
|
|
add_subdirectory(BattleAI)
|
|
|
|
add_subdirectory(VCAI)
|
2023-02-28 12:08:58 +02:00
|
|
|
add_subdirectory(StupidAI)
|
|
|
|
add_subdirectory(EmptyAI)
|
2022-12-13 22:16:48 +02:00
|
|
|
if(ENABLE_NULLKILLER_AI)
|
2022-12-13 03:55:54 +02:00
|
|
|
add_subdirectory(Nullkiller)
|
|
|
|
endif()
|