PkmnLib/CMakeLists.txt.angelscript.in

49 lines
1.7 KiB
Plaintext
Raw Normal View History

cmake_minimum_required(VERSION 2.8.12)
2021-04-18 10:56:46 +00:00
project(pkmnLib NONE)
include(ExternalProject)
ExternalProject_Add(AngelscriptProj
GIT_REPOSITORY https://git.p-epsilon.com/Deukhoofd/Angelscript.git
GIT_TAG master
PREFIX "${CMAKE_CURRENT_BINARY_DIR}/Angelscript"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)
2021-10-22 13:11:52 +00:00
function(include_angelscript)
configure_file(CMakeLists.txt.angelscript.in Angelscript/download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Angelscript/download)
if (result)
message(FATAL_ERROR "CMake step for angelscript failed: ${result}")
endif ()
execute_process(COMMAND ${CMAKE_COMMAND} --build .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Angelscript/download)
if (result)
message(FATAL_ERROR "Build step for angelscript failed: ${result}")
endif ()
SET(BUILD_SHARED_LIBS ${SHARED})
SET(LINK_STD_STATICALLY ${STATICC})
2021-04-12 20:12:00 +00:00
SET(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
2021-05-08 10:12:36 +00:00
if (WINDOWS)
SET(MSVC 1)
endif()
add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/Angelscript/src/AngelscriptProj/angelscript/projects/cmake
${CMAKE_CURRENT_BINARY_DIR}/Angelscript/bin
EXCLUDE_FROM_ALL)
2021-05-08 10:12:36 +00:00
if (WINDOWS)
set_target_properties(angelscript PROPERTIES SUFFIX ".dll")
endif (WINDOWS)
execute_process(COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/Angelscript/include)
include_directories(SYSTEM ${CMAKE_CURRENT_BINARY_DIR}/Angelscript/src/AngelscriptProj/angelscript/include)
endfunction()