Deferred copy

Sun, 21 Feb 2016 10:27:51 +0100

author
David Demelier <markand@malikania.fr>
date
Sun, 21 Feb 2016 10:27:51 +0100
changeset 9
18890b4edcb2
parent 8
ebd8f6170cd4
child 10
695e236cd48b

Deferred copy

CMakeLists.txt file | annotate | diff | comparison | revisions
--- a/CMakeLists.txt	Thu Feb 11 13:18:03 2016 +0100
+++ b/CMakeLists.txt	Sun Feb 21 10:27:51 2016 +0100
@@ -38,11 +38,6 @@
 set(JS ${CMAKE_SOURCE_DIR}/js/joke.js)
 set(CSS ${CMAKE_SOURCE_DIR}/css/irccd.css)
 
-# Prepare output
-file(MAKE_DIRECTORY ${OUTPUT})
-file(COPY ${CMAKE_SOURCE_DIR}/css DESTINATION ${OUTPUT})
-file(COPY ${CMAKE_SOURCE_DIR}/js DESTINATION ${OUTPUT})
-
 # Define the files to generate.
 set(FILES about contribute documentation documentation download index support)
 
@@ -58,6 +53,7 @@
 		TO html5
 		ARGS --no-highlight
 		TEMPLATE ${TEMPLATE}
+		MAKE_DIRECTORY
 	)
 
 	list(APPEND OUTPUTS ${OUTPUT}/${f}.html)
@@ -74,6 +70,10 @@
 	web
 	ALL
 	COMMENT "Generating website"
+	COMMAND ${CMAKE_COMMAND} -E make_directory ${OUTPUT}/css
+	COMMAND ${CMAKE_COMMAND} -E make_directory ${OUTPUT}/js
+	COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/css ${OUTPUT}/css
+	COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/js ${OUTPUT}/js
 	COMMAND ${CMAKE_COMMAND} -E copy ${WITH_IRCCDDOCDIR}/guide.html ${OUTPUT}
 	COMMAND ${CMAKE_COMMAND} -E copy_directory ${WITH_IRCCDDOCDIR}/css ${OUTPUT}/css
 	COMMAND ${CMAKE_COMMAND} -E copy_directory ${WITH_IRCCDDOCDIR}/api ${OUTPUT}/api

mercurial