Skip to content

Commit

Permalink
Download Intercept library to vendor folder on build if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
Dahlgren committed Sep 9, 2018
1 parent 8553f0c commit cff9bef
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,6 @@ CTestTestfile.cmake

# JetBrains
.idea/

# Intercept library
vendor/intercept/
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ addons:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-7
- gcc-7-multilib
- g++-7
- g++-7-multilib
- linux-libc-dev:i386 # asm/errno.h

before_script:
- CXX=g++-7 CC=gcc-7 cmake .

script:
- make
- CXX=g++-7 CC=gcc-7 make
21 changes: 18 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.6)
cmake_minimum_required (VERSION 3.8)

#----Make changes here

Expand All @@ -9,6 +9,9 @@ project (template-plugin)
#Enabling this results in better performance when handling strings to SQF commands.
option(USE_ENGINE_TYPES "USE_ENGINE_TYPES" OFF)

#Which version of Intercept to build against, branch/commit/tag
set(INTERCEPT_VERSION "dfa2ce681154337a1640ea7fa2d00576fb44349b")

#----Don't change anything below this line

option(USE_64BIT_BUILD "USE_64BIT_BUILD" OFF)
Expand All @@ -33,9 +36,21 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)

add_subdirectory(src)
add_subdirectory(src)

include(ExternalProject)

# Download Intercept library to vendor folder
ExternalProject_Add(
intercept
PREFIX ${CMAKE_CURRENT_LIST_DIR}/vendor/intercept
URL https://github.com/intercept/intercept/archive/${INTERCEPT_VERSION}.tar.gz
BUILD_COMMAND ""
CONFIGURE_COMMAND ""
INSTALL_COMMAND ""
)
1 change: 0 additions & 1 deletion intercept
Submodule intercept deleted from f283e2
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ SOURCE_GROUP("src" FILES ${INTERCEPT_PLUGIN_SOURCES})
#----Don't change anything below this line


#include the Intercept headers from the submodule
set(INTERCEPT_CLIENT_PATH "${CMAKE_SOURCE_DIR}/intercept/src/client")
#include the Intercept headers from the vendored library
set(INTERCEPT_CLIENT_PATH "${CMAKE_SOURCE_DIR}/vendor/intercept/src/intercept/src/client")

set(INTERCEPT_INCLUDE_PATH "${INTERCEPT_CLIENT_PATH}/headers" "${INTERCEPT_CLIENT_PATH}/headers/shared" "${INTERCEPT_CLIENT_PATH}/headers/client/" "${INTERCEPT_CLIENT_PATH}/headers/client/sqf")

Expand Down

0 comments on commit cff9bef

Please sign in to comment.