]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Add build documentation by gen_html
authorMilan Ševčík <majlen@civ.zcu.cz>
Thu, 16 Mar 2017 13:08:35 +0000 (14:08 +0100)
committerMilan Ševčík <majlen@civ.zcu.cz>
Tue, 21 Mar 2017 09:38:48 +0000 (10:38 +0100)
build/cmake/contrib/CMakeLists.txt
build/cmake/contrib/gen_html/CMakeLists.txt [new file with mode: 0644]

index 68e0881c5b6dc7f24fd645df9b2f4a56659b68d1..c7d97aa9533647c711f1ae13c5ecfbcb7e1fa512 100644 (file)
@@ -13,4 +13,5 @@
 PROJECT(contrib)
 
 ADD_SUBDIRECTORY(pzstd)
+ADD_SUBDIRECTORY(gen_html)
 
diff --git a/build/cmake/contrib/gen_html/CMakeLists.txt b/build/cmake/contrib/gen_html/CMakeLists.txt
new file mode 100644 (file)
index 0000000..14f52c6
--- /dev/null
@@ -0,0 +1,31 @@
+# ################################################################
+# * Copyright (c) 2015-present, Yann Collet, Facebook, Inc.
+# * All rights reserved.
+# *
+# * This source code is licensed under the BSD-style license found in the
+# * LICENSE file in the root directory of this source tree. An additional grant
+# * of patent rights can be found in the PATENTS file in the same directory.
+#
+# You can contact the author at :
+#  - zstd homepage : http://www.zstd.net/
+# ################################################################
+
+PROJECT(gen_html)
+INCLUDE(${CMAKE_SOURCE_DIR}/CMakeModules/GetLibraryVersion.cmake)
+
+SET(CMAKE_INCLUDE_CURRENT_DIR TRUE)
+
+# Define programs directory, where sources and header files are located
+SET(LIBRARY_DIR ${ZSTD_SOURCE_DIR}/lib)
+SET(PROGRAMS_DIR ${ZSTD_SOURCE_DIR}/programs)
+SET(GENHTML_DIR ${ZSTD_SOURCE_DIR}/contrib/gen_html)
+SET(GENHTML_BINARY ${PROJECT_BINARY_DIR}/gen_html${CMAKE_EXECUTABLE_SUFFIX})
+INCLUDE_DIRECTORIES(${PROGRAMS_DIR} ${LIBRARY_DIR} ${LIBRARY_DIR}/common ${GENHTML_DIR})
+
+ADD_EXECUTABLE(gen_html ${GENHTML_DIR}/gen_html.cpp)
+
+GetLibraryVersion(${LIBRARY_DIR}/zstd.h VMAJOR VMINOR VRELEASE)
+SET(LIBVERSION "${VMAJOR}.${VMINOR}.${VRELEASE}")
+ADD_CUSTOM_TARGET(zstd_manual.html ALL
+                  ${GENHTML_BINARY} "${LIBVERSION}" "${LIBRARY_DIR}/zstd.h" "${PROJECT_BINARY_DIR}/zstd_manual.html"
+                  DEPENDS gen_html COMMENT "Update zstd manual")