PokemonScriptTester/CMakeLists.txt.in

52 lines
2.1 KiB
CMake
Raw Permalink Normal View History

2021-08-22 17:03:03 +00:00
cmake_minimum_required(VERSION 2.8.12)
project(PokemonScriptTester NONE)
include(ExternalProject)
ExternalProject_Add(pkmnlib
GIT_REPOSITORY https://git.p-epsilon.com/Deukhoofd/PkmnLib
GIT_TAG master
PREFIX "${CMAKE_CURRENT_BINARY_DIR}/PkmnLib"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
CMAKE_ARGS "-DSHARED=${SHARED} -DWINDOWS=${WINDOWS} -DSTATICC=${STATICC}"
)
function(include_pkmnlib)
# Download and unpack googletest at configure time
configure_file(CMakeLists.txt.in PkmnLib/download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/download)
if (result)
message(FATAL_ERROR "CMake step for pkmnlib failed: ${result}")
endif ()
execute_process(COMMAND ${CMAKE_COMMAND} --build .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/download)
if (result)
message(FATAL_ERROR "Build step for pkmnlib failed: ${result}")
endif ()
# Add googletest directly to our build. This defines
# the gtest and gtest_main targets.
add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/src/pkmnlib
${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/bin
EXCLUDE_FROM_ALL)
execute_process(COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/include)
execute_process(COMMAND ln -s ${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/src/pkmnlib/src
${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/include/PkmnLib)
execute_process(COMMAND cp -r ${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/src/pkmnlib/extern
${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/include/PkmnLib/extern)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/include
${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/bin/CreatureLib/include
${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/bin/Angelscript/src/AngelscriptProj/angelscript/include
${CMAKE_CURRENT_BINARY_DIR}/PkmnLib/bin/CreatureLib/bin/Arbutils/include)
endfunction()