Skip to content

Commit

Permalink
[inja] Use inja CMakeLists.txt (#7402)
Browse files Browse the repository at this point in the history
* Provide CMake configs

* Fix mismatching version in CMakeLists.txt (2.0.0 -> 2.1.0)

* Update license (use LICENSE as copyright instead of using single header file as copyright)
  • Loading branch information
tntxtnt authored and vicroms committed Jul 24, 2019
1 parent 1ff1643 commit 1b1911a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ports/inja/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: inja
Version: 2.1.0
Version: 2.1.0-1
Build-Depends: nlohmann-json
Description: Inja - A Template Engine for Modern C++
13 changes: 13 additions & 0 deletions ports/inja/cmake-version.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 115c898..176bf2d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.5)


-project(inja LANGUAGES CXX VERSION 2.0.0)
+project(inja LANGUAGES CXX VERSION 2.1.0)


option(INJA_USE_EMBEDDED_JSON "Use the shipped json header if not available on the system" ON)
24 changes: 22 additions & 2 deletions ports/inja/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,27 @@ vcpkg_from_github(
REF v2.1.0
SHA512 6b3a3a6a9e2adff14083a8e83c95fdc5ccf0c930acff40c4cf6c11d67b0df18fd941307e5d1f0c45dcfcb4c4afd0026b718ca510a2b297b9c6be048f5b144d42
HEAD_REF master
PATCHES
cmake-version.patch
)
file(INSTALL ${SOURCE_PATH}/single_include/inja/inja.hpp DESTINATION ${CURRENT_PACKAGES_DIR}/include)
file(INSTALL ${SOURCE_PATH}/single_include/inja/inja.hpp DESTINATION ${CURRENT_PACKAGES_DIR}/share/inja RENAME copyright)

vcpkg_configure_cmake(
SOURCE_PATH "${SOURCE_PATH}"
PREFER_NINJA
OPTIONS
-DINJA_USE_EMBEDDED_JSON=OFF
-DBUILD_TESTING=OFF
-DBUILD_BENCHMARK=OFF
)

vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/inja)
vcpkg_copy_pdbs()

# Inja is a header-only library
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib")
# Don't need built-in nlohmann-json as this package depends on nlohmann-json
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/inja/json")

file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/inja RENAME copyright)

0 comments on commit 1b1911a

Please sign in to comment.