Download irccd on the fly

Mon, 22 Feb 2016 15:29:47 +0100

author
David Demelier <markand@malikania.fr>
date
Mon, 22 Feb 2016 15:29:47 +0100
changeset 10
695e236cd48b
parent 9
18890b4edcb2
child 11
6d1e0bb5b2bb

Download irccd on the fly

CMakeLists.txt file | annotate | diff | comparison | revisions
--- a/CMakeLists.txt	Sun Feb 21 10:27:51 2016 +0100
+++ b/CMakeLists.txt	Mon Feb 22 15:29:47 2016 +0100
@@ -23,20 +23,26 @@
 
 find_package(Pandoc REQUIRED)
 
-set(WITH_IRCCDDOCDIR "" CACHE STRING "Location of irccd documentation directory")
-
-if (NOT WITH_IRCCDDOCDIR)
-	message(FATAL_ERROR "Please define WITH_IRCCDDOCDIR to the irccd's documentation output")
-elseif (NOT EXISTS "${WITH_IRCCDDOCDIR}/guide.html")
-	message(FATAL_ERROR "Invalid directory given (did you build the documentation?)")
-endif ()
-
 # Some variables
+set(URL http://releases.malikania.fr/irccd/irccd-2.0.0-rc1.zip)
 set(TEMPLATE ${irccd-web_SOURCE_DIR}/templates/template.html)
 set(OUTPUT ${CMAKE_BINARY_DIR}/html)
 set(SOURCE ${CMAKE_SOURCE_DIR})
 set(JS ${CMAKE_SOURCE_DIR}/js/joke.js)
 set(CSS ${CMAKE_SOURCE_DIR}/css/irccd.css)
+set(IRCCDDOCDIR ${CMAKE_BINARY_DIR}/irccd/fakeroot/DOCS)
+
+# Compile irccd's documentation
+include(ExternalProject)
+
+ExternalProject_Add(
+	irccd
+	URL ${URL}
+	CMAKE_ARGS -DWITH_SSL=Off -DWITH_WEB=1 -DWITH_TESTS=Off -DWITH_DOXYGEN=Off -DWITH_DOCDIR=./DOCS
+	BUILD_COMMAND ${CMAKE_COMMAND} --build . --target docs
+	INSTALL_COMMAND ""
+	BINARY_DIR ${CMAKE_BINARY_DIR}/irccd
+)
 
 # Define the files to generate.
 set(FILES about contribute documentation documentation download index support)
@@ -79,8 +85,4 @@
 	COMMAND ${CMAKE_COMMAND} -E copy_directory ${WITH_IRCCDDOCDIR}/api ${OUTPUT}/api
 	COMMAND ${CMAKE_COMMAND} -E copy_directory ${WITH_IRCCDDOCDIR}/plugin ${OUTPUT}/plugin
 	DEPENDS files
-)
-
-message("")
-message("Don't forget to set WITH_WEB into the irccd's build directory !")
-message("")
+)
\ No newline at end of file

mercurial