forked from ome/ome-cmake-superbuild
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathOptions.cmake
80 lines (72 loc) · 2.82 KB
/
Options.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Try to put the compiler into the most recent standard mode. This
# will generally have the most features, and will remove the need for
# Boost fallbacks if native implementations are available.
option(cxxstd-autodetect "Enable C++14 features if possible, otherwise fall back to C++11, C++03 or C++98" OFF)
# These are annoyingly verbose, produce false positives or don't work
# nicely with all supported compiler versions, so are disabled unless
# explicitly enabled.
option(extra-warnings "Enable extra compiler warnings" OFF)
# This will cause the compiler to fail when an error occurs.
option(fatal-warnings "Compiler warnings are errors" OFF)
# Unit tests.
option(test "Enable unit tests (requires gtest)" ON)
option(extended-tests "Enable extended tests (more comprehensive, longer run time)" ON)
option(embedded-gtest "Use embedded gtest rather than an external build" OFF)
# Doxygen documentation
find_package(Doxygen)
set(DOXYGEN_DEFAULT OFF)
if (DOXYGEN_FOUND AND DOXYGEN_DOT_FOUND)
set (DOXYGEN_DEFAULT ON)
endif (DOXYGEN_FOUND AND DOXYGEN_DOT_FOUND)
option(doxygen "Enable doxygen documentation" ${DOXYGEN_DEFAULT})
set(BUILD_DOXYGEN ${doxygen})
# Qt GUI
find_package(Qt5 5.2.0 COMPONENTS Core Gui Widgets Svg)
find_package(OpenGL)
find_package(GLM)
set(OME_QTOPENGL_DEFAULT OFF)
if (Qt5Core_FOUND AND Qt5Gui_FOUND AND Qt5Widgets_FOUND AND Qt5Svg_FOUND AND OPENGL_FOUND AND GLM_FOUND)
set(OME_QTOPENGL_DEFAULT ON)
endif()
option(qtgui "Build Qt GUI widgets and image viewer" ${OME_QTOPENGL_DEFAULT})
# Sphinx documentation generator
find_program(SPHINX_BUILD sphinx-build)
if (SPHINX_BUILD)
message(STATUS "Looking for sphinx-build - ${SPHINX_BUILD}")
else()
message(STATUS "Looking for sphinx-build - not found")
endif()
find_program(XELATEX xelatex)
if (XELATEX)
message(STATUS "Looking for xelatex - ${XELATEX}")
else()
message(STATUS "Looking for xelatex - not found")
endif()
find_program(MAKEINDEX makeindex)
if (MAKEINDEX)
message(STATUS "Looking for makeindex - ${MAKEINDEX}")
else()
message(STATUS "Looking for makeindex - not found")
endif()
set(SPHINX_DEFAULT OFF)
if(SPHINX_BUILD)
set(SPHINX_DEFAULT ON)
endif()
option(sphinx "Enable sphinx manual page and HTML documentation" ${SPHINX_DEFAULT})
set(SPHINX_PDF_DEFAULT OFF)
if(SPHINX_DEFAULT AND XELATEX AND MAKEINDEX)
set(SPHINX_PDF_DEFAULT ON)
endif()
option(sphinx-pdf "Enable sphinx PDF documentation" ${SPHINX_PDF_DEFAULT})
set(SUPERBUILD_OPTIONS
"-Dbioformats-superbuild:BOOL=OFF"
"-Dcxxstd-autodetect:BOOL=${cxxstd-autodetect}"
"-Dextra-warnings:BOOL=${extra-warnings}"
"-Dfatal-warnings:BOOL=${fatal-warnings}"
"-Dtest:BOOL=${test}"
"-Dextended-tests:BOOL=${extended-tests}"
"-Dembedded-gtest:BOOL=${embedded-gtest}"
"-Dqtgui:BOOL=${qtgui}"
"-Ddoxygen:BOOL=${doxygen}"
"-Dsphinx:BOOL=${sphinx}"
"-Dsphinx-pdf:BOOL=${sphinx-pdf}")