Check the validity of the parsed options and correct or warn the user where needed.
1758{
1759 ConfigValues::instance().init();
1760
1762
1763
1765 if (warnFormat.
find(
"$file")==-1)
1766 {
1767 warn_uncond(
"warning format does not contain a $file tag!\n");
1768 }
1769 if (warnFormat.
find(
"$line")==-1)
1770 {
1771 warn_uncond(
"warning format does not contain a $line tag!\n");
1772 }
1773 if (warnFormat.
find(
"$text")==-1)
1774 {
1775 warn_uncond(
"warning format does not contain a $text tag!\n");
1776 }
1777
1778
1779
1782 if (paperType.
isEmpty() || paperType==
"a4wide")
1783 {
1784
1786 }
1787 else if (paperType!="a4" && paperType!="letter" &&
1788 paperType!="legal" && paperType!="executive")
1789 {
1790 err(
"Unknown page type '{}' specified\n",paperType);
1792 }
1793
1794
1795
1798 {
1801 }
1802 else
1803 {
1805 }
1807
1808
1809
1813
1814
1815
1817 if (check && !headerFile.
isEmpty())
1818 {
1819 FileInfo fi(headerFile.
str());
1820 if (!fi.exists())
1821 {
1823 "does not exist\n",headerFile);
1824 }
1825 }
1826
1827
1828
1830 if (check && !footerFile.
isEmpty())
1831 {
1832 FileInfo fi(footerFile.
str());
1833 if (!fi.exists())
1834 {
1836 "does not exist\n",footerFile);
1837 }
1838 }
1839
1840
1841
1843 {
1846 switch (mathjaxVersion)
1847 {
1848 case MATHJAX_VERSION_t::MathJax_2:
1849 if (mathJaxFormat==MATHJAX_FORMAT_t::chtml)
1850 {
1852 }
1853 break;
1854 case MATHJAX_VERSION_t::MathJax_3:
1855 if (mathJaxFormat==MATHJAX_FORMAT_t::HTML_CSS || mathJaxFormat==MATHJAX_FORMAT_t::NativeMML)
1856 {
1858 }
1859 break;
1860 case MATHJAX_VERSION_t::MathJax_4:
1861 if (mathJaxFormat==MATHJAX_FORMAT_t::HTML_CSS || mathJaxFormat==MATHJAX_FORMAT_t::NativeMML)
1862 {
1864 }
1865 break;
1866 }
1867
1869 if (check && !mathJaxCodefile.
isEmpty())
1870 {
1871 FileInfo fi(mathJaxCodefile.
str());
1872 if (!fi.exists())
1873 {
1875 "does not exist\n",mathJaxCodefile);
1876 }
1877 }
1880 {
1881 path = "https://cdn.jsdelivr.net/npm/mathjax@";
1882 switch (mathjaxVersion)
1883 {
1884 case MATHJAX_VERSION_t::MathJax_2: path += "2"; break;
1885 case MATHJAX_VERSION_t::MathJax_3: path += "3"; break;
1886 case MATHJAX_VERSION_t::MathJax_4: path += "4"; break;
1887 }
1888 }
1889
1891 {
1892 path+="/";
1893 }
1895 }
1896
1897
1898
1900 if (check && !latexHeaderFile.
isEmpty())
1901 {
1902 FileInfo fi(latexHeaderFile.
str());
1903 if (!fi.exists())
1904 {
1906 "does not exist\n",latexHeaderFile);
1907 }
1908 }
1909
1910
1911
1913 if (check && !latexFooterFile.
isEmpty())
1914 {
1915 FileInfo fi(latexFooterFile.
str());
1916 if (!fi.exists())
1917 {
1919 "does not exist\n",latexFooterFile);
1920 }
1921 }
1922
1923
1924
1926 for (const auto &s : includePath)
1927 {
1928 FileInfo fi(s);
1929 if (!fi.exists())
1930 {
1931 warn_uncond(
"tag INCLUDE_PATH: include path '{}' does not exist\n",s);
1932 }
1933 }
1934
1935
1936
1938 {
1940 for (const auto &s : predefList)
1941 {
1942 QCString predef = s;
1944 int i_equals=predef.
find(
'=');
1945 int i_obrace=predef.
find(
'(');
1946 if ((i_obrace==0) || (i_equals==0) || (i_equals==1 && predef.
at(i_equals-1)==
':'))
1947 {
1948 err(
"Illegal PREDEFINED format '{}', no define name specified\n",predef);
1949 }
1950 }
1951 }
1952
1953
1954
1956
1957
1958
1960
1961
1962
1964
1965
1966
1968
1969
1970
1972
1973
1974
1976 {
1978 }
1979
1981 if (numThreads==0)
1982 {
1983 numThreads = static_cast<int>(std::thread::hardware_concurrency());
1985 }
1986
1987
1988
1989
1991 {
1992 const char *depOption = "GENERATE_HTMLHELP";
2002 for (const auto &s : tagFileList)
2003 {
2004 bool validUrl = false;
2005 size_t eqPos = s.find('=');
2006 if (eqPos!=std::string::npos)
2007 {
2008 QCString url = QCString(s.substr(eqPos+1)).stripWhiteSpace().lower();
2011 }
2012 if (validUrl)
2013 {
2014 filteredTagFileList.push_back(s);
2015 }
2016 else
2017 {
2018 err(
"When enabling GENERATE_HTMLHELP the TAGFILES option should only contain destinations "
2019 "with https / http addresses (not: {}). I'll adjust it for you.\n",s);
2020 }
2021 }
2023 }
2024
2025
2027 {
2028 const char *depOption = "INLINE_GROUPED_CLASSES";
2030 }
2031
2032
2034 if (dotNumThreads<=0)
2035 {
2036 dotNumThreads=std::max(2u,std::thread::hardware_concurrency()+1);
2038 }
2039
2040
2041
2043 if (!plantumlJarPath.
isEmpty())
2044 {
2045 FileInfo pu(plantumlJarPath.
str());
2046 if (pu.exists() && pu.isDir())
2047 {
2049 FileInfo jar(plantumlJar.
str());
2050 if (jar.exists() && jar.isFile())
2051 {
2052 plantumlJarPath = plantumlJar;
2053 }
2054 else
2055 {
2056 err(
"Jar file 'plantuml.jar' not found at location specified via PLANTUML_JAR_PATH: '{}'\n",plantumlJarPath);
2057 plantumlJarPath="";
2058 }
2059 }
2060 else if (pu.exists() && pu.isFile())
2061 {
2062
2063 }
2064 else
2065 {
2066 err(
"PLANTUML_JAR_PATH is not a directory with a 'plantuml.jar' file or is not an existing file: {}\n",plantumlJarPath);
2067 plantumlJarPath="";
2068 }
2070 }
2071
2072
2073
2076 {
2078 FileInfo dp(diaExe.
str());
2079 if (!dp.exists() || !dp.isFile())
2080 {
2081 warn_uncond(
"dia could not be found at {}\n",diaPath);
2082 diaPath="";
2083 }
2084 else
2085 {
2086 diaPath=dp.dirPath(
TRUE)+
"/";
2087#if defined(_WIN32)
2088 size_t i=0,l=diaPath.
length();
2089 for (i=0;i<l;i++)
if (diaPath.
at(i)==
'/') diaPath.
at(i)=
'\\';
2090#endif
2091 }
2093 }
2094
2095
2096
2098 if (inputSources.empty())
2099 {
2100
2102 }
2103 else
2104 {
2105 for (const auto &s : inputSources)
2106 {
2107 FileInfo fi(s);
2108 if (!fi.exists())
2109 {
2110 warn_uncond(
"tag INPUT: input source '{}' does not exist\n",s);
2111 }
2112 }
2113 }
2115
2116
2117
2128 )
2129 {
2130 warn_uncond(
"No output formats selected! Set at least one of the main GENERATE_* options to YES.\n");
2131 }
2132
2133
2134
2137 {
2138 warn_uncond(
"GENERATE_HTMLHELP=YES requires GENERATE_HTML=YES.\n");
2139 }
2140
2141
2142
2145 {
2146 warn_uncond(
"Setting SITEMAP_URL requires GENERATE_HTML=YES.\n");
2147 }
2148
2149
2150
2152 {
2154 {
2155 warn_uncond(
"GENERATE_QHP=YES requires GENERATE_HTML=YES.\n");
2156 }
2158 {
2159 err(
"GENERATE_QHP=YES requires QHP_NAMESPACE to be set. Using 'org.doxygen.doc' as default!.\n");
2161 }
2162
2164 {
2165 err(
"GENERATE_QHP=YES requires QHP_VIRTUAL_FOLDER to be set. Using 'doc' as default!\n");
2167 }
2169 if (!tagFileList.empty())
2170 {
2171 err(
"When enabling GENERATE_QHP the TAGFILES option should be empty. I'll adjust it for you.\n");
2173 }
2174 }
2175
2176
2178 {
2179
2180
2182 }
2183
2184
2186 if (depth==0)
2187 {
2189 }
2190
2191
2193 {
2194
2195 if ((
Config_getEnum(DOT_IMAGE_FORMAT) == DOT_IMAGE_FORMAT_t::svg_cairo) ||
2196 (
Config_getEnum(DOT_IMAGE_FORMAT) == DOT_IMAGE_FORMAT_t::svg_cairo_cairo))
2197 {
2198 err(
"When using DOT_IMAGE_FORMAT with {} the INTERACTIVE_SVG option should be disabled. I'll adjust it for you.\n",
2201 }
2202 }
2203
2204
2205
2207 {
2208 const char *depOption = "OPTIMIZE_OUTPUT_VHDL";
2215 }
2216
2218 {
2220 }
2221
2222#if 0
2223
2224
2225 for (const auto &option : m_options)
2226 {
2227 QCString depName = option->dependsOn();
2229 {
2230 ConfigOption * dep = Config::instance()->get(depName);
2233 {
2235 {
2236 printf(
"disabling option %s\n",
qPrint(option->name()));
2238 }
2239 }
2240 }
2241 }
2242#endif
2243
2244}
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)