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
42
42
)
43
43
44
44
# link cslib.a and boost libraries
45
- find_library (BOOST_REGEX boost_regex REQUIRED )
45
+ find_library (BOOST_FILESYSTEM boost_filesystem REQUIRED )
46
46
find_library (BOOST_PROGRAM_OPTIONS boost_program_options REQUIRED )
47
+ find_library (BOOST_REGEX boost_regex REQUIRED )
48
+ find_library (BOOST_SYSTEM boost_system REQUIRED )
47
49
link_libraries (cs
48
- boost_regex
49
- boost_program_options )
50
+ boost_program_options
51
+ boost_regex )
50
52
51
53
# the list of executables
52
54
add_executable (csdiff csdiff.cc )
53
55
add_executable (csgrep csgrep.cc )
54
56
add_executable (cshtml cshtml.cc )
55
57
add_executable (cslinker cslinker.cc )
56
58
add_executable (cssort cssort.cc )
59
+ target_link_libraries (cshtml
60
+ boost_filesystem
61
+ boost_system )
57
62
58
63
# experimental
59
64
add_executable (cstrans-df-run cstrans-df-run.cc )
Original file line number Diff line number Diff line change 25
25
#include " regex.hh"
26
26
#include " version.hh"
27
27
28
+ #include < boost/filesystem.hpp>
28
29
#include < boost/program_options.hpp>
29
30
30
31
#ifndef DEFAULT_CWE_NAMES_FILE
31
32
# define DEFAULT_CWE_NAMES_FILE " /usr/share/csdiff/cwe-names.csv"
32
33
#endif
33
- static const char fnCweNamesDefault[] = DEFAULT_CWE_NAMES_FILE;
34
34
35
35
std::string titleFromFileName (const std::string &fileName)
36
36
{
@@ -56,6 +56,11 @@ int main(int argc, char *argv[])
56
56
using std::string;
57
57
const char *name = argv[0 ];
58
58
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
+
59
64
namespace po = boost::program_options;
60
65
po::variables_map vm;
61
66
po::options_description desc (string (" Usage: " ) + name
You can’t perform that action at this time.
0 commit comments