Check the validity of the parsed options and correct or warn the user where needed.
1763{
1764 ConfigValues::instance().init();
1765
1767
1768
1770 if (warnFormat.
find(
"$file")==-1)
1771 {
1772 warn_uncond(
"warning format does not contain a $file tag!\n");
1773 }
1774 if (warnFormat.
find(
"$line")==-1)
1775 {
1776 warn_uncond(
"warning format does not contain a $line tag!\n");
1777 }
1778 if (warnFormat.
find(
"$text")==-1)
1779 {
1780 warn_uncond(
"warning format does not contain a $text tag!\n");
1781 }
1782
1783
1784
1787 if (paperType.
isEmpty() || paperType==
"a4wide")
1788 {
1789
1791 }
1792 else if (paperType!="a4" && paperType!="letter" &&
1793 paperType!="legal" && paperType!="executive")
1794 {
1795 err(
"Unknown page type '{}' specified\n",paperType);
1797 }
1798
1799
1800
1803 {
1806 }
1807 else
1808 {
1810 }
1812
1813
1814
1818
1819
1820
1822 if (check && !headerFile.
isEmpty())
1823 {
1824 FileInfo fi(headerFile.
str());
1825 if (!fi.exists())
1826 {
1828 "does not exist\n",headerFile);
1829 }
1830 }
1831
1832
1833
1835 if (check && !footerFile.
isEmpty())
1836 {
1837 FileInfo fi(footerFile.
str());
1838 if (!fi.exists())
1839 {
1841 "does not exist\n",footerFile);
1842 }
1843 }
1844
1845
1846
1848 {
1851 switch (mathjaxVersion)
1852 {
1853 case MATHJAX_VERSION_t::MathJax_2:
1854 if (mathJaxFormat==MATHJAX_FORMAT_t::chtml)
1855 {
1857 }
1858 break;
1859 case MATHJAX_VERSION_t::MathJax_3:
1860 if (mathJaxFormat==MATHJAX_FORMAT_t::HTML_CSS || mathJaxFormat==MATHJAX_FORMAT_t::NativeMML)
1861 {
1863 }
1864 break;
1865 case MATHJAX_VERSION_t::MathJax_4:
1866 if (mathJaxFormat==MATHJAX_FORMAT_t::HTML_CSS || mathJaxFormat==MATHJAX_FORMAT_t::NativeMML)
1867 {
1869 }
1870 break;
1871 }
1872
1874 if (check && !mathJaxCodefile.
isEmpty())
1875 {
1876 FileInfo fi(mathJaxCodefile.
str());
1877 if (!fi.exists())
1878 {
1880 "does not exist\n",mathJaxCodefile);
1881 }
1882 }
1885 {
1886 path = "https://cdn.jsdelivr.net/npm/mathjax@";
1887 switch (mathjaxVersion)
1888 {
1889 case MATHJAX_VERSION_t::MathJax_2: path += "2"; break;
1890 case MATHJAX_VERSION_t::MathJax_3: path += "3"; break;
1891 case MATHJAX_VERSION_t::MathJax_4: path += "4"; break;
1892 }
1893 }
1894
1896 {
1897 path+="/";
1898 }
1900 }
1901
1902
1903
1905 if (check && !latexHeaderFile.
isEmpty())
1906 {
1907 FileInfo fi(latexHeaderFile.
str());
1908 if (!fi.exists())
1909 {
1911 "does not exist\n",latexHeaderFile);
1912 }
1913 }
1914
1915
1916
1918 if (check && !latexFooterFile.
isEmpty())
1919 {
1920 FileInfo fi(latexFooterFile.
str());
1921 if (!fi.exists())
1922 {
1924 "does not exist\n",latexFooterFile);
1925 }
1926 }
1927
1928
1929
1931 for (const auto &s : includePath)
1932 {
1933 FileInfo fi(s);
1934 if (!fi.exists())
1935 {
1936 warn_uncond(
"tag INCLUDE_PATH: include path '{}' does not exist\n",s);
1937 }
1938 }
1939
1940
1941
1943 {
1945 for (const auto &s : predefList)
1946 {
1947 QCString predef = s;
1949 int i_equals=predef.
find(
'=');
1950 int i_obrace=predef.
find(
'(');
1951 if ((i_obrace==0) || (i_equals==0) || (i_equals==1 && predef.
at(i_equals-1)==
':'))
1952 {
1953 err(
"Illegal PREDEFINED format '{}', no define name specified\n",predef);
1954 }
1955 }
1956 }
1957
1958
1959
1961
1962
1963
1965
1966
1967
1969
1970
1971
1973
1974
1975
1977
1978
1979
1981 {
1983 }
1984
1986 if (numThreads==0)
1987 {
1988 numThreads = static_cast<int>(std::thread::hardware_concurrency());
1990 }
1991
1992
1993
1994
1996 {
1997 const char *depOption = "GENERATE_HTMLHELP";
2009 for (const auto &s : tagFileList)
2010 {
2011 bool validUrl = false;
2012 size_t eqPos = s.find('=');
2013 if (eqPos!=std::string::npos)
2014 {
2015 QCString url = QCString(s.substr(eqPos+1)).stripWhiteSpace().lower();
2018 }
2019 if (validUrl)
2020 {
2021 filteredTagFileList.push_back(s);
2022 }
2023 else
2024 {
2025 err(
"When enabling GENERATE_HTMLHELP the TAGFILES option should only contain destinations "
2026 "with https / http addresses (not: {}). I'll adjust it for you.\n",s);
2027 }
2028 }
2030 }
2031
2032
2034 {
2035 const char *depOption = "INLINE_GROUPED_CLASSES";
2037 }
2038
2039
2041 if (dotNumThreads<=0)
2042 {
2043 dotNumThreads=std::max(2u,std::thread::hardware_concurrency()+1);
2045 }
2046
2047
2048
2050 if (!plantumlJarPath.
isEmpty())
2051 {
2052 FileInfo pu(plantumlJarPath.
str());
2053 if (pu.exists() && pu.isDir())
2054 {
2056 FileInfo jar(plantumlJar.
str());
2057 if (jar.exists() && jar.isFile())
2058 {
2059 plantumlJarPath = plantumlJar;
2060 }
2061 else
2062 {
2063 err(
"Jar file 'plantuml.jar' not found at location specified via PLANTUML_JAR_PATH: '{}'\n",plantumlJarPath);
2064 plantumlJarPath="";
2065 }
2066 }
2067 else if (pu.exists() && pu.isFile())
2068 {
2069
2070 }
2071 else
2072 {
2073 err(
"PLANTUML_JAR_PATH is not a directory with a 'plantuml.jar' file or is not an existing file: {}\n",plantumlJarPath);
2074 plantumlJarPath="";
2075 }
2077 }
2078
2079
2080
2083 {
2085 FileInfo dp(diaExe.
str());
2086 if (!dp.exists() || !dp.isFile())
2087 {
2088 warn_uncond(
"dia could not be found at {}\n",diaPath);
2089 diaPath="";
2090 }
2091 else
2092 {
2093 diaPath=dp.dirPath(
TRUE)+
"/";
2094#if defined(_WIN32)
2095 size_t i=0,l=diaPath.
length();
2096 for (i=0;i<l;i++)
if (diaPath.
at(i)==
'/') diaPath.
at(i)=
'\\';
2097#endif
2098 }
2100 }
2101
2102
2103
2105 if (inputSources.empty())
2106 {
2107
2109 }
2110 else
2111 {
2112 for (const auto &s : inputSources)
2113 {
2114 FileInfo fi(s);
2115 if (!fi.exists())
2116 {
2117 warn_uncond(
"tag INPUT: input source '{}' does not exist\n",s);
2118 }
2119 }
2120 }
2122
2123
2124
2135 )
2136 {
2137 warn_uncond(
"No output formats selected! Set at least one of the main GENERATE_* options to YES.\n");
2138 }
2139
2140
2141
2144 {
2145 warn_uncond(
"GENERATE_HTMLHELP=YES requires GENERATE_HTML=YES.\n");
2146 }
2147
2148
2149
2152 {
2153 warn_uncond(
"Setting SITEMAP_URL requires GENERATE_HTML=YES.\n");
2154 }
2155
2156
2157
2159 {
2161 {
2162 warn_uncond(
"GENERATE_QHP=YES requires GENERATE_HTML=YES.\n");
2163 }
2165 {
2166 err(
"GENERATE_QHP=YES requires QHP_NAMESPACE to be set. Using 'org.doxygen.doc' as default!.\n");
2168 }
2169
2171 {
2172 err(
"GENERATE_QHP=YES requires QHP_VIRTUAL_FOLDER to be set. Using 'doc' as default!\n");
2174 }
2176 if (!tagFileList.empty())
2177 {
2178 err(
"When enabling GENERATE_QHP the TAGFILES option should be empty. I'll adjust it for you.\n");
2180 }
2181 }
2182
2183
2185 {
2186
2187
2189 }
2190
2191
2193 if (depth==0)
2194 {
2196 }
2197
2198
2200 {
2201
2202 if ((
Config_getEnum(DOT_IMAGE_FORMAT) == DOT_IMAGE_FORMAT_t::svg_cairo) ||
2203 (
Config_getEnum(DOT_IMAGE_FORMAT) == DOT_IMAGE_FORMAT_t::svg_cairo_cairo))
2204 {
2205 err(
"When using DOT_IMAGE_FORMAT with {} the INTERACTIVE_SVG option should be disabled. I'll adjust it for you.\n",
2208 }
2209 }
2210
2211
2212
2214 {
2215 const char *depOption = "OPTIMIZE_OUTPUT_VHDL";
2222 }
2223
2225 {
2227 }
2228
2229#if 0
2230
2231
2232 for (const auto &option : m_options)
2233 {
2234 QCString depName = option->dependsOn();
2236 {
2237 ConfigOption * dep = Config::instance()->get(depName);
2240 {
2242 {
2243 printf(
"disabling option %s\n",
qPrint(option->name()));
2245 }
2246 }
2247 }
2248 }
2249#endif
2250
2251}
static void config_term(fmt::format_string< Args... > fmt, Args &&... args)
static std::string currentDirPath()
This is an alternative implementation of QCString.
int find(char c, int index=0, bool cs=TRUE) const
size_t length() const
Returns the length of the string, not counting the 0-terminator.
bool startsWith(const char *s) const
char & at(size_t i)
Returns a reference to the character at index i.
bool isEmpty() const
Returns TRUE iff the string is empty.
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
const std::string & str() const
#define Config_getInt(name)
#define Config_getList(name)
#define Config_updateString(name, value)
#define Config_updateInt(name, value)
#define Config_getEnumAsString(name)
#define Config_updateBool(name, value)
#define Config_getBool(name)
#define Config_getString(name)
#define Config_updateList(name,...)
#define Config_updateEnum(name, value)
#define Config_getEnum(name)
#define ConfigImpl_getBool(val)
static void adjustStringSetting(const char *depOption, const char *optionName, const QCString &expectedValue)
static void adjustColorStyleSetting(const char *depOption)
static void cleanUpPaths(StringVector &str)
static void checkList(const StringVector &list, const char *name, bool equalRequired, bool valueRequired)
static bool checkFileName(const QCString &s, const char *optionName)
static void adjustBoolSetting(const char *depOption, const char *optionName, bool expectedValue)
std::vector< std::string > StringVector
#define warn_uncond(fmt,...)
const char * commandExtension()
const char * qPrint(const char *s)
static QCString stripFromPath(const QCString &p, const StringVector &l)