source: src/codepatterns-config-main.cpp@ 9098f9

Last change on this file since 9098f9 was 115378, checked in by Frederik Heber <heber@…>, 15 years ago

Changes to allow for (re-)incorporation of CodePatterns into MoleCuilder.

library:

  • no more suffixed with version, this should be dealt by pkg-config (.pc) or a contained version information.
  • corrected and extended .pc file
  • m4 macro ax_codepatterns.m4 created to allow for easy checking with autotools

codepatterns-config:

  • if pkg-config fails there is a small tool that tells about necessary cflags and the likes to compile with CodePatterns library (this was developed before we noticed we had a (half-)working pkg-config present).

smaller changes:

  • moved all Helpers files to src/Helpers (again).
  • changed include paths for Assert.hpp, ... accordingly.
  • version is not prefixed with "v" anymore.
  • small stuff in fast_functions.hpp is absolete (stl::algorithms)
  • Helpers/enumeration.hpp contains enumeration class ("iterable enum")
  • Property mode set to 100644
File size: 1.5 KB
Line 
1#include <iostream>
2#include <boost/program_options.hpp>
3
4#include "codepatterns-config.hpp"
5#include "version.hpp"
6
7namespace po = boost::program_options;
8
9/** If pkg-config fails on you, you can call codepatterns-config
10 * in order to retrieve information about how to compile with
11 * CodePatterns. The following options:
12 * -# cflags
13 * -# help
14 * -# ldflags
15 * -# lib
16 * -# version
17 * -# version-full
18 *
19 * @param argc
20 * @param argv
21 * @return
22 */
23int main(int argc, char **argv)
24{
25 // Declare the supported options.
26 po::options_description desc("Allowed options");
27 desc.add_options()
28 ("cflags", "give CFLAGS info")
29 ("ldflags", "give LDFLAGS info")
30 ("libs", "give LIBS info")
31 ("help", "give help")
32 ("version", "give version info")
33 ("version-full", "give fullversion info")
34 ;
35
36 po::variables_map vm;
37 po::store(po::parse_command_line(argc, argv, desc), vm);
38 po::notify(vm);
39
40 // exit right after help
41 if (vm.count("help")) {
42 std::cout << desc << "\n";
43 return 1;
44 }
45
46 // exit right after info
47 if (vm.count("version")) {
48 std::cout << CODEPATTERNSVERSION << "\n";
49 return 0;
50 }
51 if (vm.count("version-full")) {
52 std::cout << CODEPATTERNSFULLVERSION << "\n";
53 return 0;
54 }
55
56 // concatenate all info if desired
57 if (vm.count("cflags")) {
58 std::cout << CODEPATTERNSCFLAGS << " ";
59 }
60 if (vm.count("ldflags")) {
61 std::cout << CODEPATTERNSLDFLAGS << " ";
62 }
63 if (vm.count("libs")) {
64 std::cout << CODEPATTERNSLIBS << " ";
65 }
66 std::cout << "\n";
67
68 return 0;
69}
70
Note: See TracBrowser for help on using the repository browser.