aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindAsciidoctor.cmake
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2018-03-27 03:30:01 +0200
committerGerald Combs <gerald@wireshark.org>2018-03-27 21:11:37 +0000
commitfdef4057824ff3cfc0cd4e79b393106b73296179 (patch)
treebf82c3d3407bc8a6b009ae00e0a0daa3b9de8e83 /cmake/modules/FindAsciidoctor.cmake
parent036c5a4e6ab2242614aee1cd2f31caf321a360cf (diff)
cmake: fix "cmake -E env" compatibility with older CMake
"cmake -E env" was added in CMake 3.1, but we currently support 2.8.12 at minimum. Add a best-effort replacement for older versions. There are some limitations from CMake (see comments), but these should not affect the current user (FindAsciidoctor.cmake). Change-Id: I56c92aa9ad42fb3950dbdfd955d4ff902111e0d7 Fixes: v2.5.1rc0-76-g94a0f7c641 ("Switch from AsciiDoc to Asciidoctor.") Reviewed-on: https://code.wireshark.org/review/26658 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'cmake/modules/FindAsciidoctor.cmake')
-rw-r--r--cmake/modules/FindAsciidoctor.cmake10
1 files changed, 8 insertions, 2 deletions
diff --git a/cmake/modules/FindAsciidoctor.cmake b/cmake/modules/FindAsciidoctor.cmake
index 1050d16f43..409e48b865 100644
--- a/cmake/modules/FindAsciidoctor.cmake
+++ b/cmake/modules/FindAsciidoctor.cmake
@@ -41,8 +41,14 @@ if(ASCIIDOCTOR_EXECUTABLE)
--require ${CMAKE_CURRENT_SOURCE_DIR}/asciidoctor-macros/ws_salink-inline-macro.rb
)
- set(_asciidoctor_common_command ${CMAKE_COMMAND} -E
- env TZ=UTC ASCIIDOCTORJ_OPTS="${_asciidoctorj_opts}"
+ if(CMAKE_VERSION VERSION_LESS 3.1)
+ set(_env_command ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/cmake/env.cmake)
+ else()
+ set(_env_command ${CMAKE_COMMAND} -E env)
+ endif()
+
+ set(_asciidoctor_common_command ${_env_command}
+ TZ=UTC ASCIIDOCTORJ_OPTS="${_asciidoctorj_opts}"
${ASCIIDOCTOR_EXECUTABLE}
${_asciidoctor_common_args}
)