Mercurial > irccd-www
comparison CMakeLists.txt @ 10:695e236cd48b
Download irccd on the fly
author | David Demelier <markand@malikania.fr> |
---|---|
date | Mon, 22 Feb 2016 15:29:47 +0100 |
parents | 18890b4edcb2 |
children | 6d1e0bb5b2bb |
comparison
equal
deleted
inserted
replaced
9:18890b4edcb2 | 10:695e236cd48b |
---|---|
21 | 21 |
22 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${irccd-web_SOURCE_DIR}/cmake) | 22 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${irccd-web_SOURCE_DIR}/cmake) |
23 | 23 |
24 find_package(Pandoc REQUIRED) | 24 find_package(Pandoc REQUIRED) |
25 | 25 |
26 set(WITH_IRCCDDOCDIR "" CACHE STRING "Location of irccd documentation directory") | |
27 | |
28 if (NOT WITH_IRCCDDOCDIR) | |
29 message(FATAL_ERROR "Please define WITH_IRCCDDOCDIR to the irccd's documentation output") | |
30 elseif (NOT EXISTS "${WITH_IRCCDDOCDIR}/guide.html") | |
31 message(FATAL_ERROR "Invalid directory given (did you build the documentation?)") | |
32 endif () | |
33 | |
34 # Some variables | 26 # Some variables |
27 set(URL http://releases.malikania.fr/irccd/irccd-2.0.0-rc1.zip) | |
35 set(TEMPLATE ${irccd-web_SOURCE_DIR}/templates/template.html) | 28 set(TEMPLATE ${irccd-web_SOURCE_DIR}/templates/template.html) |
36 set(OUTPUT ${CMAKE_BINARY_DIR}/html) | 29 set(OUTPUT ${CMAKE_BINARY_DIR}/html) |
37 set(SOURCE ${CMAKE_SOURCE_DIR}) | 30 set(SOURCE ${CMAKE_SOURCE_DIR}) |
38 set(JS ${CMAKE_SOURCE_DIR}/js/joke.js) | 31 set(JS ${CMAKE_SOURCE_DIR}/js/joke.js) |
39 set(CSS ${CMAKE_SOURCE_DIR}/css/irccd.css) | 32 set(CSS ${CMAKE_SOURCE_DIR}/css/irccd.css) |
33 set(IRCCDDOCDIR ${CMAKE_BINARY_DIR}/irccd/fakeroot/DOCS) | |
34 | |
35 # Compile irccd's documentation | |
36 include(ExternalProject) | |
37 | |
38 ExternalProject_Add( | |
39 irccd | |
40 URL ${URL} | |
41 CMAKE_ARGS -DWITH_SSL=Off -DWITH_WEB=1 -DWITH_TESTS=Off -DWITH_DOXYGEN=Off -DWITH_DOCDIR=./DOCS | |
42 BUILD_COMMAND ${CMAKE_COMMAND} --build . --target docs | |
43 INSTALL_COMMAND "" | |
44 BINARY_DIR ${CMAKE_BINARY_DIR}/irccd | |
45 ) | |
40 | 46 |
41 # Define the files to generate. | 47 # Define the files to generate. |
42 set(FILES about contribute documentation documentation download index support) | 48 set(FILES about contribute documentation documentation download index support) |
43 | 49 |
44 # Arguments for specific files. | 50 # Arguments for specific files. |
78 COMMAND ${CMAKE_COMMAND} -E copy_directory ${WITH_IRCCDDOCDIR}/css ${OUTPUT}/css | 84 COMMAND ${CMAKE_COMMAND} -E copy_directory ${WITH_IRCCDDOCDIR}/css ${OUTPUT}/css |
79 COMMAND ${CMAKE_COMMAND} -E copy_directory ${WITH_IRCCDDOCDIR}/api ${OUTPUT}/api | 85 COMMAND ${CMAKE_COMMAND} -E copy_directory ${WITH_IRCCDDOCDIR}/api ${OUTPUT}/api |
80 COMMAND ${CMAKE_COMMAND} -E copy_directory ${WITH_IRCCDDOCDIR}/plugin ${OUTPUT}/plugin | 86 COMMAND ${CMAKE_COMMAND} -E copy_directory ${WITH_IRCCDDOCDIR}/plugin ${OUTPUT}/plugin |
81 DEPENDS files | 87 DEPENDS files |
82 ) | 88 ) |
83 | |
84 message("") | |
85 message("Don't forget to set WITH_WEB into the irccd's build directory !") | |
86 message("") |