rttr.CMakeLists.txt 986 Bytes
Newer Older
Nicolas Carion's avatar
Nicolas Carion committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
cmake_minimum_required(VERSION 3.5)

# simplify variable expansion
cmake_policy(SET CMP0053 NEW)
cmake_policy(SET CMP0010 NEW)

project(rttr-download NONE)

include(ExternalProject)
ExternalProject_Add(rttr_project
	GIT_REPOSITORY https://github.com/rttrorg/rttr.git
	GIT_TAG "v0.9.6"
	SOURCE_DIR "${CMAKE_BINARY_DIR}/rttr-src"
	BINARY_DIR "${CMAKE_BINARY_DIR}/rttr-build"
Nicolas Carion's avatar
Nicolas Carion committed
15
	INSTALL_DIR "${CMAKE_BINARY_DIR}/rttr-install"
Nicolas Carion's avatar
Nicolas Carion committed
16
	UPDATE_COMMAND ""
Nicolas Carion's avatar
Nicolas Carion committed
17 18 19
	CONFIGURE_COMMAND ${CMAKE_COMMAND} -G ${CMAKE_GENERATOR} -DCMAKE_INSTALL_PREFIX=../rttr-install/ -DBUILD_EXAMPLES=OFF -DBUILD_DOCUMENTATION=OFF -DBUILD_UNIT_TESTS=OFF -DBUILD_PACKAGE=OFF -DBUILD_STATIC=ONN "${CMAKE_BINARY_DIR}/rttr-src"
	BUILD_COMMAND ${CMAKE_COMMAND} --build .
	INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install
Nicolas Carion's avatar
Nicolas Carion committed
20 21
	LOG_DOWNLOAD ON
)
Nicolas Carion's avatar
Nicolas Carion committed
22 23 24 25 26

add_custom_target(rttr_final
    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/rttr-install/lib*/*.a ${CMAKE_BINARY_DIR}/rttr-install
)
add_dependencies(rttr_final rttr_project)