Skip to content

Commit c123338

Browse files
committed
Install shaders and docs
1 parent 60901c4 commit c123338

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

CMakeLists.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ include(MSVCMultipleProcessCompile)
1818
include(CopyImportedTarget)
1919

2020
include(InstallRequiredSystemLibraries)
21+
if(WIN32)
22+
# Flat install for docs on Windows.
23+
set(CMAKE_INSTALL_DOCDIR .)
24+
endif()
2125
include(GNUInstallDirs)
26+
if(NOT CMAKE_INSTALL_DOCDIR)
27+
set(CMAKE_INSTALL_DOCDIR ${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME})
28+
endif()
2229

2330
###
2431
# Dependencies
@@ -32,6 +39,29 @@ find_package(Qt5OpenGL REQUIRED)
3239
find_package(OpenGL REQUIRED)
3340
find_package(GLEW REQUIRED)
3441

42+
43+
# For generating documentation in HTML
44+
if(WIN32)
45+
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third-party/discount-windows-bins")
46+
endif()
47+
find_package(Markdown)
48+
49+
###
50+
# Docs
51+
###
52+
# Convert the README to HTML if we can
53+
if(MARKDOWN_FOUND)
54+
include(UseMarkdown)
55+
add_markdown_target(markdown_docs "${CMAKE_CURRENT_BINARY_DIR}" README.md)
56+
57+
install_markdown_target(markdown_docs DESTINATION ${CMAKE_INSTALL_DOCDIR})
58+
else()
59+
install(FILES README.md DESTINATION ${CMAKE_INSTALL_DOCDIR})
60+
endif()
61+
62+
# Install the fragment shaders as documentation.
63+
install(FILES vizard/ShaderTest.frag vizard/ShaderTest.vert DESTINATION ${CMAKE_INSTALL_DOCDIR})
64+
3565
###
3666
# Building
3767
###

0 commit comments

Comments
 (0)