File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -42,18 +42,23 @@ add_library(cs STATIC
4242)
4343
4444# link cslib.a and boost libraries
45- find_library (BOOST_REGEX boost_regex REQUIRED)
45+ find_library (BOOST_FILESYSTEM boost_filesystem REQUIRED)
4646find_library (BOOST_PROGRAM_OPTIONS boost_program_options REQUIRED)
47+ find_library (BOOST_REGEX boost_regex REQUIRED)
48+ find_library (BOOST_SYSTEM boost_system REQUIRED)
4749link_libraries (cs
48- boost_regex
49- boost_program_options )
50+ boost_program_options
51+ boost_regex )
5052
5153# the list of executables
5254add_executable (csdiff csdiff.cc)
5355add_executable (csgrep csgrep.cc)
5456add_executable (cshtml cshtml.cc)
5557add_executable (cslinker cslinker.cc)
5658add_executable (cssort cssort.cc)
59+ target_link_libraries (cshtml
60+ boost_filesystem
61+ boost_system)
5762
5863# experimental
5964add_executable (cstrans-df-run cstrans-df-run.cc)
Original file line number Diff line number Diff line change 2525#include " regex.hh"
2626#include " version.hh"
2727
28+ #include < boost/filesystem.hpp>
2829#include < boost/program_options.hpp>
2930
3031#ifndef DEFAULT_CWE_NAMES_FILE
3132# define DEFAULT_CWE_NAMES_FILE " /usr/share/csdiff/cwe-names.csv"
3233#endif
33- static const char fnCweNamesDefault[] = DEFAULT_CWE_NAMES_FILE;
3434
3535std::string titleFromFileName (const std::string &fileName)
3636{
@@ -56,6 +56,11 @@ int main(int argc, char *argv[])
5656 using std::string;
5757 const char *name = argv[0 ];
5858
59+ std::string fnCweNamesDefault = DEFAULT_CWE_NAMES_FILE;
60+ if (!boost::filesystem::exists (fnCweNamesDefault))
61+ // if the default file is not installed, do not use it as default
62+ fnCweNamesDefault.clear ();
63+
5964 namespace po = boost::program_options;
6065 po::variables_map vm;
6166 po::options_description desc (string (" Usage: " ) + name
You can’t perform that action at this time.
0 commit comments