summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-11-23 12:39:07 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-12-16 08:01:48 -0800
commit30999a6898849ddcee829f3081532fe8369c2b45 (patch)
tree5c0b6cb97bc243d683506e63d52f268e88805cb6 /cmake
parentcc6875d39e668fc16bccc700a91e4fcfa19e539f (diff)
downloadsubsurface-30999a6898849ddcee829f3081532fe8369c2b45.tar.gz
Move run on build dir code out of the main cmake
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/RunOnBuildDir.cmake29
1 files changed, 29 insertions, 0 deletions
diff --git a/cmake/Modules/RunOnBuildDir.cmake b/cmake/Modules/RunOnBuildDir.cmake
new file mode 100644
index 000000000..bf674be19
--- /dev/null
+++ b/cmake/Modules/RunOnBuildDir.cmake
@@ -0,0 +1,29 @@
+# install a few things so that one can run Subsurface from the build
+# directory
+add_custom_target(themeLink ALL
+ COMMAND
+ rm -f ${CMAKE_BINARY_DIR}/theme &&
+ ln -s ${CMAKE_SOURCE_DIR}/theme ${CMAKE_BINARY_DIR}/theme
+)
+if(NOT NO_PRINTING)
+ add_custom_target(printing_templatesLink ALL
+ COMMAND
+ rm -f ${CMAKE_BINARY_DIR}/printing_templates &&
+ ln -s ${CMAKE_SOURCE_DIR}/printing_templates ${CMAKE_BINARY_DIR}/printing_templates
+ )
+endif()
+if(NOT NO_DOCS)
+ add_custom_target(
+ documentationLink ALL
+ COMMAND
+ mkdir -p ${CMAKE_BINARY_DIR}/Documentation/ &&
+ rm -rf ${CMAKE_BINARY_DIR}/Documentation/images &&
+ ln -s ${CMAKE_SOURCE_DIR}/Documentation/images ${CMAKE_BINARY_DIR}/Documentation/images
+ )
+ add_custom_target(
+ documentation ALL
+ COMMAND
+ ${CMAKE_MAKE_PROGRAM} -C ${CMAKE_SOURCE_DIR}/Documentation OUT=${CMAKE_BINARY_DIR}/Documentation/ doc
+ DEPENDS documentationLink
+ )
+endif() \ No newline at end of file