facter 3.9.6.cfacter.20180612 → 3.11.0.cfacter.20180319

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/ext/facter/facter/CMakeLists.txt +1 -1
  3. data/ext/facter/facter/acceptance/Gemfile +3 -4
  4. data/ext/facter/facter/acceptance/Rakefile +342 -2
  5. data/ext/facter/facter/acceptance/config/aio/options.rb +6 -0
  6. data/ext/facter/facter/acceptance/config/git/options.rb +5 -1
  7. data/ext/facter/facter/acceptance/setup/aio/pre-suite/010_Install.rb +22 -0
  8. data/ext/facter/facter/acceptance/setup/aio/pre-suite/021_InstallAristaModule.rb +12 -0
  9. data/ext/facter/facter/acceptance/setup/aio/pre-suite/022_Remove_LD_PRELOAD.rb +11 -0
  10. data/ext/facter/facter/acceptance/setup/common/00_EnvSetup.rb +64 -0
  11. data/ext/facter/facter/acceptance/setup/common/pre-suite/000-delete-puppet-when-none.rb +11 -0
  12. data/ext/facter/facter/acceptance/setup/git/pre-suite/01_TestSetup.rb +31 -0
  13. data/ext/facter/facter/acceptance/tests/ticket_1238_hostname_fqdn.rb +20 -0
  14. data/ext/facter/facter/lib/CMakeLists.txt +3 -2
  15. data/ext/facter/facter/lib/Doxyfile +1 -1
  16. data/ext/facter/facter/lib/inc/facter/facts/fact.hpp +5 -0
  17. data/ext/facter/facter/lib/inc/internal/facts/aix/networking_resolver.hpp +0 -7
  18. data/ext/facter/facter/lib/inc/internal/facts/freebsd/networking_resolver.hpp +0 -7
  19. data/ext/facter/facter/lib/inc/internal/facts/linux/fips_resolver.hpp +31 -0
  20. data/ext/facter/facter/lib/inc/internal/facts/linux/networking_resolver.hpp +0 -7
  21. data/ext/facter/facter/lib/inc/internal/facts/openbsd/networking_resolver.hpp +0 -7
  22. data/ext/facter/facter/lib/inc/internal/facts/osx/networking_resolver.hpp +0 -7
  23. data/ext/facter/facter/lib/inc/internal/facts/posix/networking_resolver.hpp +0 -7
  24. data/ext/facter/facter/lib/inc/internal/facts/resolvers/fips_resolver.hpp +46 -0
  25. data/ext/facter/facter/lib/inc/internal/facts/resolvers/networking_resolver.hpp +2 -3
  26. data/ext/facter/facter/lib/inc/internal/facts/resolvers/ssh_resolver.hpp +6 -0
  27. data/ext/facter/facter/lib/inc/internal/facts/solaris/networking_resolver.hpp +0 -7
  28. data/ext/facter/facter/lib/schema/facter.yaml +38 -18
  29. data/ext/facter/facter/lib/src/cwrapper.cc +5 -0
  30. data/ext/facter/facter/lib/src/facts/aix/disk_resolver.cc +2 -11
  31. data/ext/facter/facter/lib/src/facts/aix/networking_resolver.cc +0 -5
  32. data/ext/facter/facter/lib/src/facts/freebsd/dmi_resolver.cc +5 -1
  33. data/ext/facter/facter/lib/src/facts/freebsd/networking_resolver.cc +1 -10
  34. data/ext/facter/facter/lib/src/facts/freebsd/virtualization_resolver.cc +1 -4
  35. data/ext/facter/facter/lib/src/facts/linux/collection.cc +2 -0
  36. data/ext/facter/facter/lib/src/facts/linux/fips_resolver.cc +31 -0
  37. data/ext/facter/facter/lib/src/facts/linux/networking_resolver.cc +1 -10
  38. data/ext/facter/facter/lib/src/facts/openbsd/networking_resolver.cc +1 -10
  39. data/ext/facter/facter/lib/src/facts/osx/networking_resolver.cc +1 -10
  40. data/ext/facter/facter/lib/src/facts/posix/networking_resolver.cc +2 -3
  41. data/ext/facter/facter/lib/src/facts/posix/ssh_resolver.cc +3 -2
  42. data/ext/facter/facter/lib/src/facts/resolvers/fips_resolver.cc +23 -0
  43. data/ext/facter/facter/lib/src/facts/resolvers/networking_resolver.cc +7 -23
  44. data/ext/facter/facter/lib/src/facts/resolvers/ssh_resolver.cc +1 -0
  45. data/ext/facter/facter/lib/src/facts/solaris/networking_resolver.cc +0 -5
  46. data/ext/facter/facter/lib/tests/facts/resolvers/ssh_resolver.cc +8 -1
  47. data/ext/facter/facter/lib/tests/facts/schema.cc +17 -0
  48. data/ext/facter/facter/locales/FACTER.pot +2 -23
  49. data/ext/facter/leatherman/CHANGELOG.md +16 -9
  50. data/ext/facter/leatherman/CMakeLists.txt +1 -2
  51. data/ext/facter/leatherman/appveyor.yml +26 -19
  52. data/ext/facter/leatherman/catch/CMakeLists.txt +1 -1
  53. data/ext/facter/leatherman/curl/tests/client_test.cc +396 -398
  54. data/ext/facter/leatherman/curl/tests/mock_curl.cc +2 -0
  55. data/ext/facter/leatherman/curl/tests/request_test.cc +66 -68
  56. data/ext/facter/leatherman/curl/tests/response_test.cc +50 -52
  57. data/ext/facter/leatherman/dynamic_library/tests/dynamic_library_tests.cc +71 -75
  58. data/ext/facter/leatherman/execution/src/execution.cc +3 -0
  59. data/ext/facter/leatherman/execution/src/posix/execution.cc +5 -6
  60. data/ext/facter/leatherman/execution/src/windows/execution.cc +2 -0
  61. data/ext/facter/leatherman/execution/tests/windows/execution.cc +4 -2
  62. data/ext/facter/leatherman/file_util/tests/directory_utils_test.cc +66 -68
  63. data/ext/facter/leatherman/file_util/tests/file_utils_test.cc +175 -177
  64. data/ext/facter/leatherman/json_container/inc/leatherman/json_container/json_container.hpp +7 -0
  65. data/ext/facter/leatherman/json_container/src/json_container.cc +10 -1
  66. data/ext/facter/leatherman/json_container/tests/json_container_test.cc +152 -8
  67. data/ext/facter/leatherman/locale/CMakeLists.txt +0 -7
  68. data/ext/facter/leatherman/locales/leatherman.pot +8 -13
  69. data/ext/facter/leatherman/logging/src/logging.cc +2 -0
  70. data/ext/facter/leatherman/util/tests/timer.cc +1 -3
  71. data/ext/facter/leatherman/vendor/Catch-1.10.0.zip +0 -0
  72. data/ext/facter/leatherman/vendor/nowide/doc/Doxyfile +4 -4
  73. data/ext/facter/leatherman/vendor/nowide/doc/LICENSE_1_0.txt +23 -0
  74. data/ext/facter/leatherman/vendor/nowide/doc/main.txt +62 -54
  75. data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/convert.hpp +16 -16
  76. data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/cstdio.hpp +4 -4
  77. data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/utf8_codecvt.hpp +1 -1
  78. data/ext/facter/leatherman/vendor/nowide/src/iostream.cpp +32 -30
  79. data/ext/facter/leatherman/vendor/nowide/standalone/convert +6 -6
  80. data/ext/facter/leatherman/vendor/nowide/standalone/encoding_utf.hpp +1 -1
  81. data/ext/facter/leatherman/vendor/nowide/standalone/run_convert_and_build.sh +1 -3
  82. metadata +15 -6
  83. data/ext/facter/leatherman/cmake/FindICU.cmake +0 -690
  84. data/ext/facter/leatherman/scripts/travis_target.sh +0 -79
  85. data/ext/facter/leatherman/vendor/catch-1.4.0.zip +0 -0
@@ -14,13 +14,13 @@
14
14
  namespace boost {
15
15
  namespace nowide {
16
16
  ///
17
- /// \brief Template function that converts a buffer of UTF sequence in range [source_begin,source_end)
17
+ /// \brief Template function that converts a buffer of UTF sequences in range [source_begin,source_end)
18
18
  /// to the output \a buffer of size \a buffer_size.
19
19
  ///
20
- /// In case of success a NUL terminated string returned (buffer), otherwise 0 is returned.
20
+ /// In case of success a NULL terminated string is returned (buffer), otherwise 0 is returned.
21
21
  ///
22
- /// If there is not enough room in the buffer or the source sequence contains invalid UTF
23
- /// 0 is returned, and the contend of the buffer is undefined.
22
+ /// If there is not enough room in the buffer or the source sequence contains invalid UTF,
23
+ /// 0 is returned, and the contents of the buffer are undefined.
24
24
  ///
25
25
  template<typename CharOut,typename CharIn>
26
26
  CharOut *basic_convert(CharOut *buffer,size_t buffer_size,CharIn const *source_begin,CharIn const *source_end)
@@ -64,10 +64,10 @@ namespace nowide {
64
64
  /// \endcond
65
65
 
66
66
  ///
67
- /// Convert NUL terminated UTF source string to NUL terminated \a output string of size at
68
- /// most output_size (including NUL)
67
+ /// Convert NULL terminated UTF source string to NULL terminated \a output string of size at
68
+ /// most output_size (including NULL)
69
69
  ///
70
- /// In case of surcess output is returned, if the input sequence is illegal,
70
+ /// In case of success output is returned, if the input sequence is illegal,
71
71
  /// or there is not enough room NULL is returned
72
72
  ///
73
73
  inline char *narrow(char *output,size_t output_size,wchar_t const *source)
@@ -75,10 +75,10 @@ namespace nowide {
75
75
  return basic_convert(output,output_size,source,details::basic_strend(source));
76
76
  }
77
77
  ///
78
- /// Convert UTF text in range [begin,end) to NUL terminated \a output string of size at
79
- /// most output_size (including NUL)
78
+ /// Convert UTF text in range [begin,end) to NULL terminated \a output string of size at
79
+ /// most output_size (including NULL)
80
80
  ///
81
- /// In case of surcess output is returned, if the input sequence is illegal,
81
+ /// In case of success output is returned, if the input sequence is illegal,
82
82
  /// or there is not enough room NULL is returned
83
83
  ///
84
84
  inline char *narrow(char *output,size_t output_size,wchar_t const *begin,wchar_t const *end)
@@ -86,10 +86,10 @@ namespace nowide {
86
86
  return basic_convert(output,output_size,begin,end);
87
87
  }
88
88
  ///
89
- /// Convert NUL terminated UTF source string to NUL terminated \a output string of size at
90
- /// most output_size (including NUL)
89
+ /// Convert NULL terminated UTF source string to NULL terminated \a output string of size at
90
+ /// most output_size (including NULL)
91
91
  ///
92
- /// In case of surcess output is returned, if the input sequence is illegal,
92
+ /// In case of success output is returned, if the input sequence is illegal,
93
93
  /// or there is not enough room NULL is returned
94
94
  ///
95
95
  inline wchar_t *widen(wchar_t *output,size_t output_size,char const *source)
@@ -97,10 +97,10 @@ namespace nowide {
97
97
  return basic_convert(output,output_size,source,details::basic_strend(source));
98
98
  }
99
99
  ///
100
- /// Convert UTF text in range [begin,end) to NUL terminated \a output string of size at
101
- /// most output_size (including NUL)
100
+ /// Convert UTF text in range [begin,end) to NULL terminated \a output string of size at
101
+ /// most output_size (including NULL)
102
102
  ///
103
- /// In case of surcess output is returned, if the input sequence is illegal,
103
+ /// In case of success output is returned, if the input sequence is illegal,
104
104
  /// or there is not enough room NULL is returned
105
105
  ///
106
106
  inline wchar_t *widen(wchar_t *output,size_t output_size,char const *begin,char const *end)
@@ -33,7 +33,7 @@ namespace nowide {
33
33
  ///
34
34
  /// \brief Same as freopen but file_name and mode are UTF-8 strings
35
35
  ///
36
- /// In invalid UTF-8 given, NULL is returned and errno is set to EINVAL
36
+ /// If invalid UTF-8 given, NULL is returned and errno is set to EINVAL
37
37
  ///
38
38
  inline FILE *freopen(char const *file_name,char const *mode,FILE *stream)
39
39
  {
@@ -48,7 +48,7 @@ inline FILE *freopen(char const *file_name,char const *mode,FILE *stream)
48
48
  ///
49
49
  /// \brief Same as fopen but file_name and mode are UTF-8 strings
50
50
  ///
51
- /// In invalid UTF-8 given, NULL is returned and errno is set to EINVAL
51
+ /// If invalid UTF-8 given, NULL is returned and errno is set to EINVAL
52
52
  ///
53
53
  inline FILE *fopen(char const *file_name,char const *mode)
54
54
  {
@@ -63,7 +63,7 @@ inline FILE *fopen(char const *file_name,char const *mode)
63
63
  ///
64
64
  /// \brief Same as rename but old_name and new_name are UTF-8 strings
65
65
  ///
66
- /// In invalid UTF-8 given, -1 is returned and errno is set to EINVAL
66
+ /// If invalid UTF-8 given, -1 is returned and errno is set to EINVAL
67
67
  ///
68
68
  inline int rename(char const *old_name,char const *new_name)
69
69
  {
@@ -77,7 +77,7 @@ inline int rename(char const *old_name,char const *new_name)
77
77
  ///
78
78
  /// \brief Same as rename but name is UTF-8 string
79
79
  ///
80
- /// In invalid UTF-8 given, -1 is returned and errno is set to EINVAL
80
+ /// If invalid UTF-8 given, -1 is returned and errno is set to EINVAL
81
81
  ///
82
82
  inline int remove(char const *name)
83
83
  {
@@ -21,7 +21,7 @@ namespace nowide {
21
21
  //
22
22
  BOOST_STATIC_ASSERT(sizeof(std::mbstate_t)>=2);
23
23
 
24
- #ifdef _MSC_VER
24
+ #if defined _MSC_VER && _MSC_VER < 1700
25
25
  // MSVC do_length is non-standard it counts wide characters instead of narrow and does not change mbstate
26
26
  #define BOOST_NOWIDE_DO_LENGTH_MBSTATE_CONST
27
27
  #endif
@@ -23,16 +23,23 @@
23
23
  namespace boost {
24
24
  namespace nowide {
25
25
  namespace details {
26
+
27
+ namespace {
28
+ bool is_atty_handle(HANDLE h)
29
+ {
30
+ if(h) {
31
+ DWORD dummy;
32
+ return GetConsoleMode(h,&dummy) == TRUE;
33
+ }
34
+ return false;
35
+ }
36
+ }
37
+
26
38
  class console_output_buffer : public std::streambuf {
27
39
  public:
28
40
  console_output_buffer(HANDLE h) :
29
- handle_(h),
30
- isatty_(false)
41
+ handle_(h)
31
42
  {
32
- if(handle_) {
33
- DWORD dummy;
34
- isatty_ = GetConsoleMode(handle_,&dummy) == TRUE;
35
- }
36
43
  }
37
44
  protected:
38
45
  int sync()
@@ -65,11 +72,6 @@ namespace details {
65
72
  char const *b = p;
66
73
  char const *e = p+n;
67
74
  DWORD size=0;
68
- if(!isatty_) {
69
- if(!WriteFile(handle_,p,n,&size,0) || static_cast<int>(size) != n)
70
- return -1;
71
- return n;
72
- }
73
75
  if(n > buffer_size)
74
76
  return -1;
75
77
  wchar_t *out = wbuffer_;
@@ -90,20 +92,14 @@ namespace details {
90
92
  char buffer_[buffer_size];
91
93
  wchar_t wbuffer_[buffer_size]; // for null
92
94
  HANDLE handle_;
93
- bool isatty_;
94
95
  };
95
96
 
96
97
  class console_input_buffer: public std::streambuf {
97
98
  public:
98
99
  console_input_buffer(HANDLE h) :
99
100
  handle_(h),
100
- isatty_(false),
101
101
  wsize_(0)
102
102
  {
103
- if(handle_) {
104
- DWORD dummy;
105
- isatty_ = GetConsoleMode(handle_,&dummy) == TRUE;
106
- }
107
103
  }
108
104
 
109
105
  protected:
@@ -160,12 +156,6 @@ namespace details {
160
156
  size_t read()
161
157
  {
162
158
  namespace uf = boost::locale::utf;
163
- if(!isatty_) {
164
- DWORD read_bytes = 0;
165
- if(!ReadFile(handle_,buffer_,buffer_size,&read_bytes,0))
166
- return 0;
167
- return read_bytes;
168
- }
169
159
  DWORD read_wchars = 0;
170
160
  size_t n = wbuffer_size - wsize_;
171
161
  if(!ReadConsoleW(handle_,wbuffer_,n,&read_wchars,0))
@@ -183,7 +173,7 @@ namespace details {
183
173
  }
184
174
 
185
175
  if(c==uf::illegal)
186
- return -1;
176
+ return 0;
187
177
 
188
178
 
189
179
  if(c==uf::incomplete) {
@@ -198,7 +188,6 @@ namespace details {
198
188
  char buffer_[buffer_size];
199
189
  wchar_t wbuffer_[buffer_size]; // for null
200
190
  HANDLE handle_;
201
- bool isatty_;
202
191
  int wsize_;
203
192
  std::vector<char> pback_buffer_;
204
193
  };
@@ -214,19 +203,32 @@ namespace details {
214
203
  h = GetStdHandle(STD_ERROR_HANDLE);
215
204
  break;
216
205
  }
217
- d.reset(new console_output_buffer(h));
218
- std::ostream::rdbuf(d.get());
206
+ if(is_atty_handle(h)) {
207
+ d.reset(new console_output_buffer(h));
208
+ std::ostream::rdbuf(d.get());
209
+ }
210
+ else {
211
+ std::ostream::rdbuf( fd == 1 ? std::cout.rdbuf() : std::cerr.rdbuf() );
212
+ }
219
213
  }
220
-
221
214
  winconsole_ostream::~winconsole_ostream()
222
215
  {
216
+ try {
217
+ flush();
218
+ }
219
+ catch(...){}
223
220
  }
224
221
 
225
222
  winconsole_istream::winconsole_istream() : std::istream(0)
226
223
  {
227
224
  HANDLE h = GetStdHandle(STD_INPUT_HANDLE);
228
- d.reset(new console_input_buffer(h));
229
- std::istream::rdbuf(d.get());
225
+ if(is_atty_handle(h)) {
226
+ d.reset(new console_input_buffer(h));
227
+ std::istream::rdbuf(d.get());
228
+ }
229
+ else {
230
+ std::istream::rdbuf(std::cin.rdbuf());
231
+ }
230
232
  }
231
233
 
232
234
  winconsole_istream::~winconsole_istream()
@@ -5,9 +5,9 @@ mkdir -p nowide/nowide
5
5
  mkdir -p nowide/src
6
6
  mkdir -p nowide/test
7
7
 
8
- cp ../boost/nowide/*.hpp nowide/nowide
9
- cp ../libs/nowide/src/*.cpp nowide/src
10
- cp ../libs/nowide/test/*.cpp ../libs/nowide/test/*.hpp nowide/test
8
+ cp ../include/boost/nowide/*.hpp nowide/nowide
9
+ cp ../src/*.cpp nowide/src
10
+ cp ../test/*.cpp ../test/*.hpp nowide/test
11
11
  cp ./*.hpp nowide/nowide/
12
12
 
13
13
  SOURCES="nowide/test/* nowide/src/* nowide/nowide/*"
@@ -29,6 +29,6 @@ cp CMakeLists.txt nowide/
29
29
  cp -a nowide nowide_standalone
30
30
  zip -r nowide_standalone.zip nowide_standalone
31
31
 
32
- mkdir boost_nowide
33
- cp -a ../boost ../libs boost_nowide
34
- zip -r boost_nowide.zip boost_nowide
32
+ #mkdir boost_nowide
33
+ #cp -a ../boost ../libs boost_nowide
34
+ #zip -r boost_nowide.zip boost_nowide
@@ -46,7 +46,7 @@ namespace nowide{
46
46
  }
47
47
 
48
48
  ///
49
- /// Convert a Unicode NUL terminated string \a str other Unicode encoding
49
+ /// Convert a Unicode NULL terminated string \a str other Unicode encoding
50
50
  ///
51
51
  template<typename CharOut,typename CharIn>
52
52
  std::basic_string<CharOut>
@@ -1,5 +1,5 @@
1
1
  #!/bin/bash
2
- export WINEPATH="/usr/i686-w64-mingw32/lib;/usr/lib/gcc/i686-w64-mingw32/4.8"
2
+ export WINEPATH="/usr/lib/gcc/i686-w64-mingw32/5.3-win32/;/usr/lib/gcc/i686-w64-mingw32/5"
3
3
 
4
4
  rm -fr /tmp/nwlin /tmp/nw
5
5
 
@@ -8,9 +8,7 @@ pushd .
8
8
  popd
9
9
 
10
10
  pushd .
11
-
12
11
  ./convert && mkdir nowide/build && cd nowide/build && cmake -DLIBDIR=lin64 -DCMAKE_INSTALL_PREFIX=/tmp/nwlin .. && make && make test && make install
13
-
14
12
  popd
15
13
 
16
14
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: facter
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.9.6.cfacter.20180612
4
+ version: 3.11.0.cfacter.20180319
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-06-12 00:00:00.000000000 Z
12
+ date: 2018-03-19 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description:
15
15
  email: info@puppet.com
@@ -202,6 +202,12 @@ files:
202
202
  - ext/facter/facter/acceptance/lib/puppet/acceptance/common_utils.rb
203
203
  - ext/facter/facter/acceptance/lib/puppet/acceptance/git_utils.rb
204
204
  - ext/facter/facter/acceptance/lib/puppet/acceptance/install_utils.rb
205
+ - ext/facter/facter/acceptance/setup/aio/pre-suite/010_Install.rb
206
+ - ext/facter/facter/acceptance/setup/aio/pre-suite/021_InstallAristaModule.rb
207
+ - ext/facter/facter/acceptance/setup/aio/pre-suite/022_Remove_LD_PRELOAD.rb
208
+ - ext/facter/facter/acceptance/setup/common/00_EnvSetup.rb
209
+ - ext/facter/facter/acceptance/setup/common/pre-suite/000-delete-puppet-when-none.rb
210
+ - ext/facter/facter/acceptance/setup/git/pre-suite/01_TestSetup.rb
205
211
  - ext/facter/facter/acceptance/tests/custom_facts/custom_fact_with_10001_weight_overrides_external_fact.rb
206
212
  - ext/facter/facter/acceptance/tests/custom_facts/having_multiple_facts_in_one_file.rb
207
213
  - ext/facter/facter/acceptance/tests/custom_facts/using_win32ole_should_not_hang.rb
@@ -386,6 +392,7 @@ files:
386
392
  - ext/facter/facter/lib/inc/internal/facts/linux/disk_resolver.hpp
387
393
  - ext/facter/facter/lib/inc/internal/facts/linux/dmi_resolver.hpp
388
394
  - ext/facter/facter/lib/inc/internal/facts/linux/filesystem_resolver.hpp
395
+ - ext/facter/facter/lib/inc/internal/facts/linux/fips_resolver.hpp
389
396
  - ext/facter/facter/lib/inc/internal/facts/linux/kernel_resolver.hpp
390
397
  - ext/facter/facter/lib/inc/internal/facts/linux/memory_resolver.hpp
391
398
  - ext/facter/facter/lib/inc/internal/facts/linux/networking_resolver.hpp
@@ -424,6 +431,7 @@ files:
424
431
  - ext/facter/facter/lib/inc/internal/facts/resolvers/dmi_resolver.hpp
425
432
  - ext/facter/facter/lib/inc/internal/facts/resolvers/ec2_resolver.hpp
426
433
  - ext/facter/facter/lib/inc/internal/facts/resolvers/filesystem_resolver.hpp
434
+ - ext/facter/facter/lib/inc/internal/facts/resolvers/fips_resolver.hpp
427
435
  - ext/facter/facter/lib/inc/internal/facts/resolvers/gce_resolver.hpp
428
436
  - ext/facter/facter/lib/inc/internal/facts/resolvers/hypervisors_resolver.hpp
429
437
  - ext/facter/facter/lib/inc/internal/facts/resolvers/identity_resolver.hpp
@@ -531,6 +539,7 @@ files:
531
539
  - ext/facter/facter/lib/src/facts/linux/disk_resolver.cc
532
540
  - ext/facter/facter/lib/src/facts/linux/dmi_resolver.cc
533
541
  - ext/facter/facter/lib/src/facts/linux/filesystem_resolver.cc
542
+ - ext/facter/facter/lib/src/facts/linux/fips_resolver.cc
534
543
  - ext/facter/facter/lib/src/facts/linux/kernel_resolver.cc
535
544
  - ext/facter/facter/lib/src/facts/linux/memory_resolver.cc
536
545
  - ext/facter/facter/lib/src/facts/linux/networking_resolver.cc
@@ -571,6 +580,7 @@ files:
571
580
  - ext/facter/facter/lib/src/facts/resolvers/dmi_resolver.cc
572
581
  - ext/facter/facter/lib/src/facts/resolvers/ec2_resolver.cc
573
582
  - ext/facter/facter/lib/src/facts/resolvers/filesystem_resolver.cc
583
+ - ext/facter/facter/lib/src/facts/resolvers/fips_resolver.cc
574
584
  - ext/facter/facter/lib/src/facts/resolvers/gce_resolver.cc
575
585
  - ext/facter/facter/lib/src/facts/resolvers/hypervisors_resolver.cc
576
586
  - ext/facter/facter/lib/src/facts/resolvers/identity_resolver.cc
@@ -841,7 +851,6 @@ files:
841
851
  - ext/facter/leatherman/README.md
842
852
  - ext/facter/leatherman/appveyor.yml
843
853
  - ext/facter/leatherman/catch/CMakeLists.txt
844
- - ext/facter/leatherman/cmake/FindICU.cmake
845
854
  - ext/facter/leatherman/cmake/GetGitRevisionDescription.cmake
846
855
  - ext/facter/leatherman/cmake/GetGitRevisionDescription.cmake.in
847
856
  - ext/facter/leatherman/cmake/cflags.cmake
@@ -959,7 +968,6 @@ files:
959
968
  - ext/facter/leatherman/ruby/src/windows/api.cc
960
969
  - ext/facter/leatherman/ruby/tests/api-test.cc
961
970
  - ext/facter/leatherman/scripts/cpplint.py
962
- - ext/facter/leatherman/scripts/travis_target.sh
963
971
  - ext/facter/leatherman/tests/CMakeLists.txt
964
972
  - ext/facter/leatherman/tests/main.cc
965
973
  - ext/facter/leatherman/util/CMakeLists.txt
@@ -995,9 +1003,10 @@ files:
995
1003
  - ext/facter/leatherman/util/tests/timer.cc
996
1004
  - ext/facter/leatherman/util/tests/uri.cc
997
1005
  - ext/facter/leatherman/util/tests/windows/environment.cc
998
- - ext/facter/leatherman/vendor/catch-1.4.0.zip
1006
+ - ext/facter/leatherman/vendor/Catch-1.10.0.zip
999
1007
  - ext/facter/leatherman/vendor/nowide/build/Jamfile.v2
1000
1008
  - ext/facter/leatherman/vendor/nowide/doc/Doxyfile
1009
+ - ext/facter/leatherman/vendor/nowide/doc/LICENSE_1_0.txt
1001
1010
  - ext/facter/leatherman/vendor/nowide/doc/gendoc.sh
1002
1011
  - ext/facter/leatherman/vendor/nowide/doc/main.txt
1003
1012
  - ext/facter/leatherman/vendor/nowide/include/boost/nowide/args.hpp
@@ -1072,7 +1081,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1072
1081
  version: 1.3.1
1073
1082
  requirements: []
1074
1083
  rubyforge_project:
1075
- rubygems_version: 2.6.14.1
1084
+ rubygems_version: 2.2.5
1076
1085
  signing_key:
1077
1086
  specification_version: 4
1078
1087
  summary: Facter gem wrapper
@@ -1,690 +0,0 @@
1
- # This module can find the International Components for Unicode (ICU) libraries
2
- #
3
- # Requirements:
4
- # - CMake >= 2.8.3 (for new version of find_package_handle_standard_args)
5
- #
6
- # The following variables will be defined for your use:
7
- # - ICU_FOUND : were all of your specified components found?
8
- # - ICU_INCLUDE_DIRS : ICU include directory
9
- # - ICU_LIBRARIES : ICU libraries
10
- # - ICU_VERSION : complete version of ICU (x.y.z)
11
- # - ICU_VERSION_MAJOR : major version of ICU
12
- # - ICU_VERSION_MINOR : minor version of ICU
13
- # - ICU_VERSION_PATCH : patch version of ICU
14
- # - ICU_<COMPONENT>_FOUND : were <COMPONENT> found? (FALSE for non specified component if it is not a dependency)
15
- #
16
- # For windows or non standard installation, define ICU_ROOT_DIR variable to point to the root installation of ICU. Two ways:
17
- # - run cmake with -DICU_ROOT_DIR=<PATH>
18
- # - define an environment variable with the same name before running cmake
19
- # With cmake-gui, before pressing "Configure":
20
- # 1) Press "Add Entry" button
21
- # 2) Add a new entry defined as:
22
- # - Name: ICU_ROOT_DIR
23
- # - Type: choose PATH in the selection list
24
- # - Press "..." button and select the root installation of ICU
25
- #
26
- # Example Usage:
27
- #
28
- # 1. Copy this file in the root of your project source directory
29
- # 2. Then, tell CMake to search this non-standard module in your project directory by adding to your CMakeLists.txt:
30
- # set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
31
- # 3. Finally call find_package() once, here are some examples to pick from
32
- #
33
- # Require ICU 4.4 or later
34
- # find_package(ICU 4.4 REQUIRED)
35
- #
36
- # if(ICU_FOUND)
37
- # add_executable(myapp myapp.c)
38
- # include_directories(${ICU_INCLUDE_DIRS})
39
- # target_link_libraries(myapp ${ICU_LIBRARIES})
40
- # # with CMake >= 3.0.0, the last two lines can be replaced by the following
41
- # target_link_libraries(myapp ICU::ICU)
42
- # endif(ICU_FOUND)
43
-
44
- ########## <ICU finding> ##########
45
-
46
- find_package(PkgConfig QUIET)
47
-
48
- ########## Private ##########
49
- if(NOT DEFINED ICU_PUBLIC_VAR_NS)
50
- set(ICU_PUBLIC_VAR_NS "ICU") # Prefix for all ICU relative public variables
51
- endif(NOT DEFINED ICU_PUBLIC_VAR_NS)
52
- if(NOT DEFINED ICU_PRIVATE_VAR_NS)
53
- set(ICU_PRIVATE_VAR_NS "_${ICU_PUBLIC_VAR_NS}") # Prefix for all ICU relative internal variables
54
- endif(NOT DEFINED ICU_PRIVATE_VAR_NS)
55
- if(NOT DEFINED PC_ICU_PRIVATE_VAR_NS)
56
- set(PC_ICU_PRIVATE_VAR_NS "_PC${ICU_PRIVATE_VAR_NS}") # Prefix for all pkg-config relative internal variables
57
- endif(NOT DEFINED PC_ICU_PRIVATE_VAR_NS)
58
-
59
- set(${ICU_PRIVATE_VAR_NS}_HINTS )
60
- # <deprecated>
61
- # for future removal
62
- if(DEFINED ENV{ICU_ROOT})
63
- list(APPEND ${ICU_PRIVATE_VAR_NS}_HINTS "$ENV{ICU_ROOT}")
64
- message(AUTHOR_WARNING "ENV{ICU_ROOT} is deprecated in favor of ENV{ICU_ROOT_DIR}")
65
- endif(DEFINED ENV{ICU_ROOT})
66
- if (DEFINED ICU_ROOT)
67
- list(APPEND ${ICU_PRIVATE_VAR_NS}_HINTS "${ICU_ROOT}")
68
- message(AUTHOR_WARNING "ICU_ROOT is deprecated in favor of ICU_ROOT_DIR")
69
- endif(DEFINED ICU_ROOT)
70
- # </deprecated>
71
- if(DEFINED ENV{ICU_ROOT_DIR})
72
- list(APPEND ${ICU_PRIVATE_VAR_NS}_HINTS "$ENV{ICU_ROOT_DIR}")
73
- endif(DEFINED ENV{ICU_ROOT_DIR})
74
- if (DEFINED ICU_ROOT_DIR)
75
- list(APPEND ${ICU_PRIVATE_VAR_NS}_HINTS "${ICU_ROOT_DIR}")
76
- endif(DEFINED ICU_ROOT_DIR)
77
-
78
- set(${ICU_PRIVATE_VAR_NS}_COMPONENTS )
79
- # <icu component name> <library name 1> ... <library name N>
80
- macro(_icu_declare_component _NAME)
81
- list(APPEND ${ICU_PRIVATE_VAR_NS}_COMPONENTS ${_NAME})
82
- set("${ICU_PRIVATE_VAR_NS}_COMPONENTS_${_NAME}" ${ARGN})
83
- endmacro(_icu_declare_component)
84
-
85
- _icu_declare_component(data icudata)
86
- _icu_declare_component(uc icuuc) # Common and Data libraries
87
- _icu_declare_component(i18n icui18n icuin) # Internationalization library
88
- _icu_declare_component(io icuio ustdio) # Stream and I/O Library
89
- _icu_declare_component(le icule) # Layout library
90
- _icu_declare_component(lx iculx) # Paragraph Layout library
91
-
92
- ########## Public ##########
93
- set(${ICU_PUBLIC_VAR_NS}_FOUND FALSE)
94
- set(${ICU_PUBLIC_VAR_NS}_LIBRARIES )
95
- set(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS )
96
- set(${ICU_PUBLIC_VAR_NS}_C_FLAGS "")
97
- set(${ICU_PUBLIC_VAR_NS}_CXX_FLAGS "")
98
- set(${ICU_PUBLIC_VAR_NS}_CPP_FLAGS "")
99
- set(${ICU_PUBLIC_VAR_NS}_C_SHARED_FLAGS "")
100
- set(${ICU_PUBLIC_VAR_NS}_CXX_SHARED_FLAGS "")
101
- set(${ICU_PUBLIC_VAR_NS}_CPP_SHARED_FLAGS "")
102
-
103
- foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PRIVATE_VAR_NS}_COMPONENTS})
104
- string(TOUPPER "${${ICU_PRIVATE_VAR_NS}_COMPONENT}" ${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT)
105
- set("${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_FOUND" FALSE) # may be done in the _icu_declare_component macro
106
- endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
107
-
108
- # Check components
109
- if(NOT ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS) # uc required at least
110
- set(${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS uc)
111
- else(NOT ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS)
112
- list(APPEND ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS uc)
113
- list(REMOVE_DUPLICATES ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS)
114
- foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS})
115
- if(NOT DEFINED ${ICU_PRIVATE_VAR_NS}_COMPONENTS_${${ICU_PRIVATE_VAR_NS}_COMPONENT})
116
- message(FATAL_ERROR "Unknown ICU component: ${${ICU_PRIVATE_VAR_NS}_COMPONENT}")
117
- endif(NOT DEFINED ${ICU_PRIVATE_VAR_NS}_COMPONENTS_${${ICU_PRIVATE_VAR_NS}_COMPONENT})
118
- endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
119
- endif(NOT ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS)
120
-
121
- # if pkg-config is available check components dependencies and append `pkg-config icu-<component> --variable=prefix` to hints
122
- if(PKG_CONFIG_FOUND)
123
- set(${ICU_PRIVATE_VAR_NS}_COMPONENTS_DUP ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS})
124
- foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PRIVATE_VAR_NS}_COMPONENTS_DUP})
125
- pkg_check_modules(${PC_ICU_PRIVATE_VAR_NS} "icu-${${ICU_PRIVATE_VAR_NS}_COMPONENT}" QUIET)
126
-
127
- if(${PC_ICU_PRIVATE_VAR_NS}_FOUND)
128
- list(APPEND ${ICU_PRIVATE_VAR_NS}_HINTS ${${PC_ICU_PRIVATE_VAR_NS}_PREFIX})
129
- foreach(${PC_ICU_PRIVATE_VAR_NS}_LIBRARY ${${PC_ICU_PRIVATE_VAR_NS}_LIBRARIES})
130
- string(REGEX REPLACE "^icu" "" ${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY ${${PC_ICU_PRIVATE_VAR_NS}_LIBRARY})
131
- if(NOT ${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY STREQUAL "data")
132
- list(FIND ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS ${${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY} ${ICU_PRIVATE_VAR_NS}_COMPONENT_INDEX)
133
- if(${ICU_PRIVATE_VAR_NS}_COMPONENT_INDEX EQUAL -1)
134
- message(WARNING "Missing component dependency: ${${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY}. Add it to your find_package(ICU) line as COMPONENTS to fix this warning.")
135
- list(APPEND ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS ${${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY})
136
- endif(${ICU_PRIVATE_VAR_NS}_COMPONENT_INDEX EQUAL -1)
137
- endif(NOT ${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY STREQUAL "data")
138
- endforeach(${PC_ICU_PRIVATE_VAR_NS}_LIBRARY)
139
- endif(${PC_ICU_PRIVATE_VAR_NS}_FOUND)
140
- endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
141
- endif(PKG_CONFIG_FOUND)
142
- # list(APPEND ${ICU_PRIVATE_VAR_NS}_HINTS ENV ICU_ROOT_DIR)
143
- # message("${ICU_PRIVATE_VAR_NS}_HINTS = ${${ICU_PRIVATE_VAR_NS}_HINTS}")
144
-
145
- # Includes
146
- find_path(
147
- ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR
148
- NAMES unicode/utypes.h utypes.h
149
- HINTS ${${ICU_PRIVATE_VAR_NS}_HINTS}
150
- PATH_SUFFIXES "include"
151
- DOC "Include directories for ICU"
152
- )
153
-
154
- if(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR)
155
- ########## <part to keep synced with tests/version/CMakeLists.txt> ##########
156
- if(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}/unicode/uvernum.h") # ICU >= 4.4
157
- file(READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}/unicode/uvernum.h" ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS)
158
- elseif(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}/unicode/uversion.h") # ICU [2;4.4[
159
- file(READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}/unicode/uversion.h" ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS)
160
- elseif(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}/unicode/utypes.h") # ICU [1.4;2[
161
- file(READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}/unicode/utypes.h" ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS)
162
- elseif(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}/utypes.h") # ICU 1.3
163
- file(READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}/utypes.h" ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS)
164
- else()
165
- message(FATAL_ERROR "ICU version header not found")
166
- endif()
167
-
168
- if(${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS MATCHES ".*# *define *ICU_VERSION *\"([0-9]+)\".*") # ICU 1.3
169
- # [1.3;1.4[ as #define ICU_VERSION "3" (no patch version, ie all 1.3.X versions will be detected as 1.3.0)
170
- set(${ICU_PUBLIC_VAR_NS}_VERSION_MAJOR "1")
171
- set(${ICU_PUBLIC_VAR_NS}_VERSION_MINOR "${CMAKE_MATCH_1}")
172
- set(${ICU_PUBLIC_VAR_NS}_VERSION_PATCH "0")
173
- elseif(${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS MATCHES ".*# *define *U_ICU_VERSION_MAJOR_NUM *([0-9]+).*")
174
- #
175
- # Since version 4.9.1, ICU release version numbering was totaly changed, see:
176
- # - http://site.icu-project.org/download/49
177
- # - http://userguide.icu-project.org/design#TOC-Version-Numbers-in-ICU
178
- #
179
- set(${ICU_PUBLIC_VAR_NS}_VERSION_MAJOR "${CMAKE_MATCH_1}")
180
- string(REGEX REPLACE ".*# *define *U_ICU_VERSION_MINOR_NUM *([0-9]+).*" "\\1" ${ICU_PUBLIC_VAR_NS}_VERSION_MINOR "${${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS}")
181
- string(REGEX REPLACE ".*# *define *U_ICU_VERSION_PATCHLEVEL_NUM *([0-9]+).*" "\\1" ${ICU_PUBLIC_VAR_NS}_VERSION_PATCH "${${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS}")
182
- elseif(${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS MATCHES ".*# *define *U_ICU_VERSION *\"(([0-9]+)(\\.[0-9]+)*)\".*") # ICU [1.4;1.8[
183
- # [1.4;1.8[ as #define U_ICU_VERSION "1.4.1.2" but it seems that some 1.4.[12](?:\.\d)? have releasing error and appears as 1.4.0
184
- set(${ICU_PRIVATE_VAR_NS}_FULL_VERSION "${CMAKE_MATCH_1}") # copy CMAKE_MATCH_1, no longer valid on the following if
185
- if(${ICU_PRIVATE_VAR_NS}_FULL_VERSION MATCHES "^([0-9]+)\\.([0-9]+)$")
186
- set(${ICU_PUBLIC_VAR_NS}_VERSION_MAJOR "${CMAKE_MATCH_1}")
187
- set(${ICU_PUBLIC_VAR_NS}_VERSION_MINOR "${CMAKE_MATCH_2}")
188
- set(${ICU_PUBLIC_VAR_NS}_VERSION_PATCH "0")
189
- elseif(${ICU_PRIVATE_VAR_NS}_FULL_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)")
190
- set(${ICU_PUBLIC_VAR_NS}_VERSION_MAJOR "${CMAKE_MATCH_1}")
191
- set(${ICU_PUBLIC_VAR_NS}_VERSION_MINOR "${CMAKE_MATCH_2}")
192
- set(${ICU_PUBLIC_VAR_NS}_VERSION_PATCH "${CMAKE_MATCH_3}")
193
- endif()
194
- else()
195
- message(FATAL_ERROR "failed to detect ICU version")
196
- endif()
197
- set(${ICU_PUBLIC_VAR_NS}_VERSION "${${ICU_PUBLIC_VAR_NS}_VERSION_MAJOR}.${${ICU_PUBLIC_VAR_NS}_VERSION_MINOR}.${${ICU_PUBLIC_VAR_NS}_VERSION_PATCH}")
198
- ########## </part to keep synced with tests/version/CMakeLists.txt> ##########
199
- endif(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR)
200
-
201
- # Check libraries
202
- if(MSVC)
203
- include(SelectLibraryConfigurations)
204
- endif(MSVC)
205
- foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS})
206
- string(TOUPPER "${${ICU_PRIVATE_VAR_NS}_COMPONENT}" ${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT)
207
- if(MSVC)
208
- set(${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES )
209
- set(${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES )
210
- foreach(${ICU_PRIVATE_VAR_NS}_BASE_NAME ${${ICU_PRIVATE_VAR_NS}_COMPONENTS_${${ICU_PRIVATE_VAR_NS}_COMPONENT}})
211
- list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}")
212
- list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}d")
213
- list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}${${ICU_PUBLIC_VAR_NS}_VERSION_MAJOR}${${ICU_PUBLIC_VAR_NS}_VERSION_MINOR}")
214
- list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}${${ICU_PUBLIC_VAR_NS}_VERSION_MAJOR}${${ICU_PUBLIC_VAR_NS}_VERSION_MINOR}d")
215
- endforeach(${ICU_PRIVATE_VAR_NS}_BASE_NAME)
216
-
217
- find_library(
218
- ${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY_RELEASE
219
- NAMES ${${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES}
220
- HINTS ${${ICU_PRIVATE_VAR_NS}_HINTS}
221
- DOC "Release library for ICU ${${ICU_PRIVATE_VAR_NS}_COMPONENT} component"
222
- )
223
- find_library(
224
- ${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY_DEBUG
225
- NAMES ${${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES}
226
- HINTS ${${ICU_PRIVATE_VAR_NS}_HINTS}
227
- DOC "Debug library for ICU ${${ICU_PRIVATE_VAR_NS}_COMPONENT} component"
228
- )
229
-
230
- select_library_configurations("${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}")
231
- list(APPEND ${ICU_PUBLIC_VAR_NS}_LIBRARY ${${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY})
232
- else(MSVC)
233
- find_library(
234
- ${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY
235
- NAMES ${${ICU_PRIVATE_VAR_NS}_COMPONENTS_${${ICU_PRIVATE_VAR_NS}_COMPONENT}}
236
- PATHS ${${ICU_PRIVATE_VAR_NS}_HINTS}
237
- DOC "Library for ICU ${${ICU_PRIVATE_VAR_NS}_COMPONENT} component"
238
- )
239
-
240
- if(${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY)
241
- set("${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_FOUND" TRUE)
242
- list(APPEND ${ICU_PUBLIC_VAR_NS}_LIBRARY ${${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY})
243
- endif(${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY)
244
- endif(MSVC)
245
- endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
246
-
247
- # Try to find out compiler flags
248
- find_program(${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE icu-config HINTS ${${ICU_PRIVATE_VAR_NS}_HINTS})
249
- if(${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE)
250
- execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cflags OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_C_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
251
- execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cxxflags OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_CXX_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
252
- execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cppflags OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_CPP_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
253
-
254
- execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cflags-dynamic OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_C_SHARED_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
255
- execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cxxflags-dynamic OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_CXX_SHARED_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
256
- execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cppflags-dynamic OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_CPP_SHARED_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
257
- endif(${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE)
258
-
259
- # Check find_package arguments
260
- include(FindPackageHandleStandardArgs)
261
- if(${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
262
- find_package_handle_standard_args(
263
- ${ICU_PUBLIC_VAR_NS}
264
- REQUIRED_VARS ${ICU_PUBLIC_VAR_NS}_LIBRARY ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR
265
- VERSION_VAR ${ICU_PUBLIC_VAR_NS}_VERSION
266
- )
267
- else(${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
268
- find_package_handle_standard_args(${ICU_PUBLIC_VAR_NS} "Could NOT find ICU" ${ICU_PUBLIC_VAR_NS}_LIBRARY ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR)
269
- endif(${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
270
-
271
- if(${ICU_PUBLIC_VAR_NS}_FOUND)
272
- # <deprecated>
273
- # for compatibility with previous versions, alias old ICU_(MAJOR|MINOR|PATCH)_VERSION to ICU_VERSION_$1
274
- set(${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION ${${ICU_PUBLIC_VAR_NS}_VERSION_MAJOR})
275
- set(${ICU_PUBLIC_VAR_NS}_MINOR_VERSION ${${ICU_PUBLIC_VAR_NS}_VERSION_MINOR})
276
- set(${ICU_PUBLIC_VAR_NS}_PATCH_VERSION ${${ICU_PUBLIC_VAR_NS}_VERSION_PATCH})
277
- # </deprecated>
278
- set(${ICU_PUBLIC_VAR_NS}_LIBRARIES ${${ICU_PUBLIC_VAR_NS}_LIBRARY})
279
- set(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS ${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR})
280
-
281
- if(NOT CMAKE_VERSION VERSION_LESS "3.0.0")
282
- if(NOT TARGET ICU::ICU)
283
- add_library(ICU::ICU INTERFACE IMPORTED)
284
- endif(NOT TARGET ICU::ICU)
285
- set_target_properties(ICU::ICU PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}")
286
- foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS})
287
- string(TOUPPER "${${ICU_PRIVATE_VAR_NS}_COMPONENT}" ${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT)
288
- add_library("ICU::${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}" UNKNOWN IMPORTED)
289
- if(${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY_RELEASE)
290
- set_property(TARGET "ICU::${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}" APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
291
- set_target_properties("ICU::${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}" PROPERTIES IMPORTED_LOCATION_RELEASE "${${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY_RELEASE}")
292
- endif(${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY_RELEASE)
293
- if(${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY_DEBUG)
294
- set_property(TARGET "ICU::${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}" APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
295
- set_target_properties("ICU::${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}" PROPERTIES IMPORTED_LOCATION_DEBUG "${${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY_DEBUG}")
296
- endif(${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY_DEBUG)
297
- if(${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY)
298
- set_target_properties("ICU::${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}" PROPERTIES IMPORTED_LOCATION "${${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY}")
299
- endif(${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_LIBRARY)
300
- set_property(TARGET ICU::ICU APPEND PROPERTY INTERFACE_LINK_LIBRARIES "ICU::${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}")
301
- # set_target_properties("ICU::${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}" PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR}")
302
- endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
303
- endif(NOT CMAKE_VERSION VERSION_LESS "3.0.0")
304
- endif(${ICU_PUBLIC_VAR_NS}_FOUND)
305
-
306
- mark_as_advanced(
307
- ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIR
308
- ${ICU_PUBLIC_VAR_NS}_LIBRARY
309
- )
310
-
311
- ########## </ICU finding> ##########
312
-
313
- ########## <resource bundle support> ##########
314
-
315
- ########## Private ##########
316
- function(_icu_extract_locale_from_rb _BUNDLE_SOURCE _RETURN_VAR_NAME)
317
- file(READ "${_BUNDLE_SOURCE}" _BUNDLE_CONTENTS)
318
- string(REGEX REPLACE "//[^\n]*\n" "" _BUNDLE_CONTENTS_WITHOUT_COMMENTS ${_BUNDLE_CONTENTS})
319
- string(REGEX REPLACE "[ \t\n]" "" _BUNDLE_CONTENTS_WITHOUT_COMMENTS_AND_SPACES ${_BUNDLE_CONTENTS_WITHOUT_COMMENTS})
320
- string(REGEX MATCH "^([a-zA-Z_-]+)(:table)?{" LOCALE_FOUND ${_BUNDLE_CONTENTS_WITHOUT_COMMENTS_AND_SPACES})
321
- set("${_RETURN_VAR_NAME}" "${CMAKE_MATCH_1}" PARENT_SCOPE)
322
- endfunction(_icu_extract_locale_from_rb)
323
-
324
- ########## Public ##########
325
-
326
- #
327
- # Prototype:
328
- # icu_generate_resource_bundle([NAME <name>] [PACKAGE] [DESTINATION <location>] [FILES <list of files>])
329
- #
330
- # Common arguments:
331
- # - NAME <name> : name of output package and to create dummy targets
332
- # - FILES <file 1> ... <file N> : list of resource bundles sources
333
- # - DEPENDS <target1> ... <target N> : required to package as library (shared or static), a list of cmake parent targets to link to
334
- # Note: only (PREVIOUSLY DECLARED) add_executable and add_library as dependencies
335
- # - DESTINATION <location> : optional, directory where to install final binary file(s)
336
- # - FORMAT <name> : optional, one of none (ICU4C binary format, default), java (plain java) or xliff (XML), see below
337
- #
338
- # Arguments depending on FORMAT:
339
- # - none (default):
340
- # * PACKAGE : if present, package all resource bundles together. Default is to stop after building individual *.res files
341
- # * TYPE <name> : one of :
342
- # + common or archive (default) : archive all ressource bundles into a single .dat file
343
- # + library or dll : assemble all ressource bundles into a separate and loadable library (.dll/.so)
344
- # + static : integrate all ressource bundles to targets designed by DEPENDS parameter (as a static library)
345
- # * NO_SHARED_FLAGS : only with TYPE in ['library', 'dll', 'static'], do not append ICU_C(XX)_SHARED_FLAGS to targets given as DEPENDS argument
346
- # - JAVA:
347
- # * BUNDLE <name> : required, prefix for generated classnames
348
- # - XLIFF:
349
- # (none)
350
- #
351
-
352
- #
353
- # For an archive, the idea is to generate the following dependencies:
354
- #
355
- # root.txt => root.res \
356
- # |
357
- # en.txt => en.res |
358
- # | => pkglist.txt => application.dat
359
- # fr.txt => fr.res |
360
- # |
361
- # and so on /
362
- #
363
- # Lengend: 'A => B' means B depends on A
364
- #
365
- # Steps (correspond to arrows):
366
- # 1) genrb (from .txt to .res)
367
- # 2) generate a file text (pkglist.txt) with all .res files to put together
368
- # 3) build final archive (from *.res/pkglist.txt to .dat)
369
- #
370
-
371
- function(icu_generate_resource_bundle)
372
-
373
- ##### <check for pkgdata/genrb availability> #####
374
- find_program(${ICU_PUBLIC_VAR_NS}_GENRB_EXECUTABLE genrb HINTS ${${ICU_PRIVATE_VAR_NS}_HINTS})
375
- find_program(${ICU_PUBLIC_VAR_NS}_PKGDATA_EXECUTABLE pkgdata HINTS ${${ICU_PRIVATE_VAR_NS}_HINTS})
376
-
377
- if(NOT ${ICU_PUBLIC_VAR_NS}_GENRB_EXECUTABLE)
378
- message(FATAL_ERROR "genrb not found")
379
- endif(NOT ${ICU_PUBLIC_VAR_NS}_GENRB_EXECUTABLE)
380
- if(NOT ${ICU_PUBLIC_VAR_NS}_PKGDATA_EXECUTABLE)
381
- message(FATAL_ERROR "pkgdata not found")
382
- endif(NOT ${ICU_PUBLIC_VAR_NS}_PKGDATA_EXECUTABLE)
383
- ##### </check for pkgdata/genrb availability> #####
384
-
385
- ##### <constants> #####
386
- set(TARGET_SEPARATOR "+")
387
- set(__FUNCTION__ "icu_generate_resource_bundle")
388
- set(PACKAGE_TARGET_PREFIX "ICU${TARGET_SEPARATOR}PKG")
389
- set(RESOURCE_TARGET_PREFIX "ICU${TARGET_SEPARATOR}RB")
390
- ##### </constants> #####
391
-
392
- ##### <hash constants> #####
393
- # filename extension of built resource bundle (without dot)
394
- set(BUNDLES__SUFFIX "res")
395
- set(BUNDLES_JAVA_SUFFIX "java")
396
- set(BUNDLES_XLIFF_SUFFIX "xlf")
397
- # alias: none (default) = common = archive ; dll = library ; static
398
- set(PKGDATA__ALIAS "")
399
- set(PKGDATA_COMMON_ALIAS "")
400
- set(PKGDATA_ARCHIVE_ALIAS "")
401
- set(PKGDATA_DLL_ALIAS "LIBRARY")
402
- set(PKGDATA_LIBRARY_ALIAS "LIBRARY")
403
- set(PKGDATA_STATIC_ALIAS "STATIC")
404
- # filename prefix of built package
405
- set(PKGDATA__PREFIX "")
406
- set(PKGDATA_LIBRARY_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}")
407
- set(PKGDATA_STATIC_PREFIX "${CMAKE_STATIC_LIBRARY_PREFIX}")
408
- # filename extension of built package (with dot)
409
- set(PKGDATA__SUFFIX ".dat")
410
- set(PKGDATA_LIBRARY_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}")
411
- set(PKGDATA_STATIC_SUFFIX "${CMAKE_STATIC_LIBRARY_SUFFIX}")
412
- # pkgdata option mode specific
413
- set(PKGDATA__OPTIONS "-m" "common")
414
- set(PKGDATA_STATIC_OPTIONS "-m" "static")
415
- set(PKGDATA_LIBRARY_OPTIONS "-m" "library")
416
- # cmake library type for output package
417
- set(PKGDATA_LIBRARY__TYPE "")
418
- set(PKGDATA_LIBRARY_STATIC_TYPE STATIC)
419
- set(PKGDATA_LIBRARY_LIBRARY_TYPE SHARED)
420
- ##### </hash constants> #####
421
-
422
- include(CMakeParseArguments)
423
- cmake_parse_arguments(
424
- PARSED_ARGS # output variable name
425
- # options (true/false) (default value: false)
426
- "PACKAGE;NO_SHARED_FLAGS"
427
- # univalued parameters (default value: "")
428
- "NAME;DESTINATION;TYPE;FORMAT;BUNDLE"
429
- # multivalued parameters (default value: "")
430
- "FILES;DEPENDS"
431
- ${ARGN}
432
- )
433
-
434
- # assert(${PARSED_ARGS_NAME} != "")
435
- if(NOT PARSED_ARGS_NAME)
436
- message(FATAL_ERROR "${__FUNCTION__}(): no name given, NAME parameter missing")
437
- endif(NOT PARSED_ARGS_NAME)
438
-
439
- # assert(length(PARSED_ARGS_FILES) > 0)
440
- list(LENGTH PARSED_ARGS_FILES PARSED_ARGS_FILES_LEN)
441
- if(PARSED_ARGS_FILES_LEN LESS 1)
442
- message(FATAL_ERROR "${__FUNCTION__}() expects at least 1 resource bundle as FILES argument, 0 given")
443
- endif(PARSED_ARGS_FILES_LEN LESS 1)
444
-
445
- string(TOUPPER "${PARSED_ARGS_FORMAT}" UPPER_FORMAT)
446
- # assert(${UPPER_FORMAT} in ['', 'java', 'xlif'])
447
- if(NOT DEFINED BUNDLES_${UPPER_FORMAT}_SUFFIX)
448
- message(FATAL_ERROR "${__FUNCTION__}(): unknown FORMAT '${PARSED_ARGS_FORMAT}'")
449
- endif(NOT DEFINED BUNDLES_${UPPER_FORMAT}_SUFFIX)
450
-
451
- if(UPPER_FORMAT STREQUAL "JAVA")
452
- # assert(${PARSED_ARGS_BUNDLE} != "")
453
- if(NOT PARSED_ARGS_BUNDLE)
454
- message(FATAL_ERROR "${__FUNCTION__}(): java bundle name expected, BUNDLE parameter missing")
455
- endif(NOT PARSED_ARGS_BUNDLE)
456
- endif(UPPER_FORMAT STREQUAL "JAVA")
457
-
458
- if(PARSED_ARGS_PACKAGE)
459
- # assert(${PARSED_ARGS_FORMAT} == "")
460
- if(PARSED_ARGS_FORMAT)
461
- message(FATAL_ERROR "${__FUNCTION__}(): packaging is only supported for binary format, not xlif neither java outputs")
462
- endif(PARSED_ARGS_FORMAT)
463
-
464
- string(TOUPPER "${PARSED_ARGS_TYPE}" UPPER_MODE)
465
- # assert(${UPPER_MODE} in ['', 'common', 'archive', 'dll', library'])
466
- if(NOT DEFINED PKGDATA_${UPPER_MODE}_ALIAS)
467
- message(FATAL_ERROR "${__FUNCTION__}(): unknown TYPE '${PARSED_ARGS_TYPE}'")
468
- else(NOT DEFINED PKGDATA_${UPPER_MODE}_ALIAS)
469
- set(TYPE "${PKGDATA_${UPPER_MODE}_ALIAS}")
470
- endif(NOT DEFINED PKGDATA_${UPPER_MODE}_ALIAS)
471
-
472
- # Package name: strip file extension if present
473
- get_filename_component(PACKAGE_NAME_WE ${PARSED_ARGS_NAME} NAME_WE)
474
- # Target name to build package
475
- set(PACKAGE_TARGET_NAME "${PACKAGE_TARGET_PREFIX}${TARGET_SEPARATOR}${PACKAGE_NAME_WE}")
476
- # Target name to build intermediate list file
477
- set(PACKAGE_LIST_TARGET_NAME "${PACKAGE_TARGET_NAME}${TARGET_SEPARATOR}PKGLIST")
478
- # Directory (absolute) to set as "current directory" for genrb (does not include package directory, -p)
479
- # We make our "cook" there to prevent any conflict
480
- if(DEFINED CMAKE_PLATFORM_ROOT_BIN) # CMake < 2.8.10
481
- set(RESOURCE_GENRB_CHDIR_DIR "${CMAKE_PLATFORM_ROOT_BIN}/${PACKAGE_TARGET_NAME}.dir/")
482
- else(DEFINED CMAKE_PLATFORM_ROOT_BIN) # CMake >= 2.8.10
483
- set(RESOURCE_GENRB_CHDIR_DIR "${CMAKE_PLATFORM_INFO_DIR}/${PACKAGE_TARGET_NAME}.dir/")
484
- endif(DEFINED CMAKE_PLATFORM_ROOT_BIN)
485
- # Directory (absolute) where resource bundles are built: concatenation of RESOURCE_GENRB_CHDIR_DIR and package name
486
- set(RESOURCE_OUTPUT_DIR "${RESOURCE_GENRB_CHDIR_DIR}/${PACKAGE_NAME_WE}/")
487
- # Output (relative) path for built package
488
- if(MSVC AND TYPE STREQUAL PKGDATA_LIBRARY_ALIAS)
489
- set(PACKAGE_OUTPUT_PATH "${RESOURCE_GENRB_CHDIR_DIR}/${PACKAGE_NAME_WE}/${PKGDATA_${TYPE}_PREFIX}${PACKAGE_NAME_WE}${PKGDATA_${TYPE}_SUFFIX}")
490
- else(MSVC AND TYPE STREQUAL PKGDATA_LIBRARY_ALIAS)
491
- set(PACKAGE_OUTPUT_PATH "${RESOURCE_GENRB_CHDIR_DIR}/${PKGDATA_${TYPE}_PREFIX}${PACKAGE_NAME_WE}${PKGDATA_${TYPE}_SUFFIX}")
492
- endif(MSVC AND TYPE STREQUAL PKGDATA_LIBRARY_ALIAS)
493
- # Output (absolute) path for the list file
494
- set(PACKAGE_LIST_OUTPUT_PATH "${RESOURCE_GENRB_CHDIR_DIR}/pkglist.txt")
495
-
496
- file(MAKE_DIRECTORY "${RESOURCE_OUTPUT_DIR}")
497
- else(PARSED_ARGS_PACKAGE)
498
- set(RESOURCE_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/")
499
- # set(RESOURCE_GENRB_CHDIR_DIR "UNUSED")
500
- endif(PARSED_ARGS_PACKAGE)
501
-
502
- set(TARGET_RESOURCES )
503
- set(COMPILED_RESOURCES_PATH )
504
- set(COMPILED_RESOURCES_BASENAME )
505
- foreach(RESOURCE_SOURCE ${PARSED_ARGS_FILES})
506
- _icu_extract_locale_from_rb(${RESOURCE_SOURCE} RESOURCE_NAME_WE)
507
- get_filename_component(SOURCE_BASENAME ${RESOURCE_SOURCE} NAME)
508
- get_filename_component(ABSOLUTE_SOURCE ${RESOURCE_SOURCE} ABSOLUTE)
509
-
510
- if(UPPER_FORMAT STREQUAL "XLIFF")
511
- if(RESOURCE_NAME_WE STREQUAL "root")
512
- set(XLIFF_LANGUAGE "en")
513
- else(RESOURCE_NAME_WE STREQUAL "root")
514
- string(REGEX REPLACE "[^a-z].*$" "" XLIFF_LANGUAGE "${RESOURCE_NAME_WE}")
515
- endif(RESOURCE_NAME_WE STREQUAL "root")
516
- endif(UPPER_FORMAT STREQUAL "XLIFF")
517
-
518
- ##### <templates> #####
519
- set(RESOURCE_TARGET_NAME "${RESOURCE_TARGET_PREFIX}${TARGET_SEPARATOR}${PARSED_ARGS_NAME}${TARGET_SEPARATOR}${RESOURCE_NAME_WE}")
520
-
521
- set(RESOURCE_OUTPUT__PATH "${RESOURCE_NAME_WE}.res")
522
- if(RESOURCE_NAME_WE STREQUAL "root")
523
- set(RESOURCE_OUTPUT_JAVA_PATH "${PARSED_ARGS_BUNDLE}.java")
524
- else(RESOURCE_NAME_WE STREQUAL "root")
525
- set(RESOURCE_OUTPUT_JAVA_PATH "${PARSED_ARGS_BUNDLE}_${RESOURCE_NAME_WE}.java")
526
- endif(RESOURCE_NAME_WE STREQUAL "root")
527
- set(RESOURCE_OUTPUT_XLIFF_PATH "${RESOURCE_NAME_WE}.xlf")
528
-
529
- set(GENRB__OPTIONS "")
530
- set(GENRB_JAVA_OPTIONS "-j" "-b" "${PARSED_ARGS_BUNDLE}")
531
- set(GENRB_XLIFF_OPTIONS "-x" "-l" "${XLIFF_LANGUAGE}")
532
- ##### </templates> #####
533
-
534
- # build <locale>.txt from <locale>.res
535
- if(PARSED_ARGS_PACKAGE)
536
- add_custom_command(
537
- OUTPUT "${RESOURCE_OUTPUT_DIR}${RESOURCE_OUTPUT_${UPPER_FORMAT}_PATH}"
538
- COMMAND ${CMAKE_COMMAND} -E chdir ${RESOURCE_GENRB_CHDIR_DIR} ${${ICU_PUBLIC_VAR_NS}_GENRB_EXECUTABLE} ${GENRB_${UPPER_FORMAT}_OPTIONS} -d ${PACKAGE_NAME_WE} ${ABSOLUTE_SOURCE}
539
- DEPENDS ${RESOURCE_SOURCE}
540
- )
541
- else(PARSED_ARGS_PACKAGE)
542
- add_custom_command(
543
- OUTPUT "${RESOURCE_OUTPUT_DIR}${RESOURCE_OUTPUT_${UPPER_FORMAT}_PATH}"
544
- COMMAND ${${ICU_PUBLIC_VAR_NS}_GENRB_EXECUTABLE} ${GENRB_${UPPER_FORMAT}_OPTIONS} -d ${RESOURCE_OUTPUT_DIR} ${ABSOLUTE_SOURCE}
545
- DEPENDS ${RESOURCE_SOURCE}
546
- )
547
- endif(PARSED_ARGS_PACKAGE)
548
- # dummy target (ICU+RB+<name>+<locale>) for each locale to build the <locale>.res file from its <locale>.txt by the add_custom_command above
549
- add_custom_target(
550
- "${RESOURCE_TARGET_NAME}" ALL
551
- COMMENT ""
552
- DEPENDS "${RESOURCE_OUTPUT_DIR}${RESOURCE_OUTPUT_${UPPER_FORMAT}_PATH}"
553
- SOURCES ${RESOURCE_SOURCE}
554
- )
555
-
556
- if(PARSED_ARGS_DESTINATION AND NOT PARSED_ARGS_PACKAGE)
557
- install(FILES "${RESOURCE_OUTPUT_DIR}${RESOURCE_OUTPUT_${UPPER_FORMAT}_PATH}" DESTINATION ${PARSED_ARGS_DESTINATION} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
558
- endif(PARSED_ARGS_DESTINATION AND NOT PARSED_ARGS_PACKAGE)
559
-
560
- list(APPEND TARGET_RESOURCES "${RESOURCE_TARGET_NAME}")
561
- list(APPEND COMPILED_RESOURCES_PATH "${RESOURCE_OUTPUT_DIR}${RESOURCE_OUTPUT_${UPPER_FORMAT}_PATH}")
562
- list(APPEND COMPILED_RESOURCES_BASENAME "${RESOURCE_NAME_WE}.${BUNDLES_${UPPER_FORMAT}_SUFFIX}")
563
- endforeach(RESOURCE_SOURCE)
564
- # convert semicolon separated list to a space separated list
565
- # NOTE: if the pkglist.txt file starts (or ends?) with a whitespace, pkgdata add an undefined symbol (named <package>_) for it
566
- string(REPLACE ";" " " COMPILED_RESOURCES_BASENAME "${COMPILED_RESOURCES_BASENAME}")
567
-
568
- if(PARSED_ARGS_PACKAGE)
569
- # create a text file (pkglist.txt) with the list of the *.res to package together
570
- add_custom_command(
571
- OUTPUT "${PACKAGE_LIST_OUTPUT_PATH}"
572
- COMMAND ${CMAKE_COMMAND} -E echo "${COMPILED_RESOURCES_BASENAME}" > "${PACKAGE_LIST_OUTPUT_PATH}"
573
- DEPENDS ${COMPILED_RESOURCES_PATH}
574
- )
575
- # run pkgdata from pkglist.txt
576
- add_custom_command(
577
- OUTPUT "${PACKAGE_OUTPUT_PATH}"
578
- COMMAND ${CMAKE_COMMAND} -E chdir ${RESOURCE_GENRB_CHDIR_DIR} ${${ICU_PUBLIC_VAR_NS}_PKGDATA_EXECUTABLE} -F ${PKGDATA_${TYPE}_OPTIONS} -s ${PACKAGE_NAME_WE} -p ${PACKAGE_NAME_WE} ${PACKAGE_LIST_OUTPUT_PATH}
579
- DEPENDS "${PACKAGE_LIST_OUTPUT_PATH}"
580
- VERBATIM
581
- )
582
- if(PKGDATA_LIBRARY_${TYPE}_TYPE)
583
- # assert(${PARSED_ARGS_DEPENDS} != "")
584
- if(NOT PARSED_ARGS_DEPENDS)
585
- message(FATAL_ERROR "${__FUNCTION__}(): static and library mode imply a list of targets to link to, DEPENDS parameter missing")
586
- endif(NOT PARSED_ARGS_DEPENDS)
587
- add_library(${PACKAGE_TARGET_NAME} ${PKGDATA_LIBRARY_${TYPE}_TYPE} IMPORTED)
588
- if(MSVC)
589
- string(REGEX REPLACE "${PKGDATA_LIBRARY_SUFFIX}\$" "${CMAKE_IMPORT_LIBRARY_SUFFIX}" PACKAGE_OUTPUT_LIB "${PACKAGE_OUTPUT_PATH}")
590
- set_target_properties(${PACKAGE_TARGET_NAME} PROPERTIES IMPORTED_LOCATION ${PACKAGE_OUTPUT_PATH} IMPORTED_IMPLIB ${PACKAGE_OUTPUT_LIB})
591
- else(MSVC)
592
- set_target_properties(${PACKAGE_TARGET_NAME} PROPERTIES IMPORTED_LOCATION ${PACKAGE_OUTPUT_PATH})
593
- endif(MSVC)
594
- foreach(DEPENDENCY ${PARSED_ARGS_DEPENDS})
595
- target_link_libraries(${DEPENDENCY} ${PACKAGE_TARGET_NAME})
596
- if(NOT PARSED_ARGS_NO_SHARED_FLAGS)
597
- get_property(ENABLED_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
598
- list(LENGTH "${ENABLED_LANGUAGES}" ENABLED_LANGUAGES_LENGTH)
599
- if(ENABLED_LANGUAGES_LENGTH GREATER 1)
600
- message(WARNING "Project has more than one language enabled, skip automatic shared flags appending")
601
- else(ENABLED_LANGUAGES_LENGTH GREATER 1)
602
- set_property(TARGET "${DEPENDENCY}" APPEND PROPERTY COMPILE_FLAGS "${${ICU_PUBLIC_VAR_NS}_${ENABLED_LANGUAGES}_SHARED_FLAGS}")
603
- endif(ENABLED_LANGUAGES_LENGTH GREATER 1)
604
- endif(NOT PARSED_ARGS_NO_SHARED_FLAGS)
605
- endforeach(DEPENDENCY)
606
- # http://www.mail-archive.com/cmake-commits@cmake.org/msg01135.html
607
- set(PACKAGE_INTERMEDIATE_TARGET_NAME "${PACKAGE_TARGET_NAME}${TARGET_SEPARATOR}DUMMY")
608
- # dummy intermediate target (ICU+PKG+<name>+DUMMY) to link the package to the produced library by running pkgdata (see add_custom_command above)
609
- add_custom_target(
610
- ${PACKAGE_INTERMEDIATE_TARGET_NAME}
611
- COMMENT ""
612
- DEPENDS "${PACKAGE_OUTPUT_PATH}"
613
- )
614
- add_dependencies("${PACKAGE_TARGET_NAME}" "${PACKAGE_INTERMEDIATE_TARGET_NAME}")
615
- else(PKGDATA_LIBRARY_${TYPE}_TYPE)
616
- # dummy target (ICU+PKG+<name>) to run pkgdata (see add_custom_command above)
617
- add_custom_target(
618
- "${PACKAGE_TARGET_NAME}" ALL
619
- COMMENT ""
620
- DEPENDS "${PACKAGE_OUTPUT_PATH}"
621
- )
622
- endif(PKGDATA_LIBRARY_${TYPE}_TYPE)
623
- # dummy target (ICU+PKG+<name>+PKGLIST) to build the file pkglist.txt
624
- add_custom_target(
625
- "${PACKAGE_LIST_TARGET_NAME}" ALL
626
- COMMENT ""
627
- DEPENDS "${PACKAGE_LIST_OUTPUT_PATH}"
628
- )
629
- # package => pkglist.txt
630
- add_dependencies("${PACKAGE_TARGET_NAME}" "${PACKAGE_LIST_TARGET_NAME}")
631
- # pkglist.txt => *.res
632
- add_dependencies("${PACKAGE_LIST_TARGET_NAME}" ${TARGET_RESOURCES})
633
-
634
- if(PARSED_ARGS_DESTINATION)
635
- install(FILES "${PACKAGE_OUTPUT_PATH}" DESTINATION ${PARSED_ARGS_DESTINATION} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
636
- endif(PARSED_ARGS_DESTINATION)
637
- endif(PARSED_ARGS_PACKAGE)
638
-
639
- endfunction(icu_generate_resource_bundle)
640
-
641
- ########## </resource bundle support> ##########
642
-
643
- ########## <debug> ##########
644
-
645
- if(${ICU_PUBLIC_VAR_NS}_DEBUG)
646
-
647
- function(icudebug _VARNAME)
648
- if(DEFINED ${ICU_PUBLIC_VAR_NS}_${_VARNAME})
649
- message("${ICU_PUBLIC_VAR_NS}_${_VARNAME} = ${${ICU_PUBLIC_VAR_NS}_${_VARNAME}}")
650
- else(DEFINED ${ICU_PUBLIC_VAR_NS}_${_VARNAME})
651
- message("${ICU_PUBLIC_VAR_NS}_${_VARNAME} = <UNDEFINED>")
652
- endif(DEFINED ${ICU_PUBLIC_VAR_NS}_${_VARNAME})
653
- endfunction(icudebug)
654
-
655
- # IN (args)
656
- icudebug("FIND_COMPONENTS")
657
- icudebug("FIND_REQUIRED")
658
- icudebug("FIND_QUIETLY")
659
- icudebug("FIND_VERSION")
660
-
661
- # OUT
662
- # Found
663
- icudebug("FOUND")
664
- # Flags
665
- icudebug("C_FLAGS")
666
- icudebug("CPP_FLAGS")
667
- icudebug("CXX_FLAGS")
668
- icudebug("C_SHARED_FLAGS")
669
- icudebug("CPP_SHARED_FLAGS")
670
- icudebug("CXX_SHARED_FLAGS")
671
- # Linking
672
- icudebug("INCLUDE_DIRS")
673
- icudebug("LIBRARIES")
674
- # Version
675
- icudebug("VERSION_MAJOR")
676
- icudebug("VERSION_MINOR")
677
- icudebug("VERSION_PATCH")
678
- icudebug("VERSION")
679
- # <COMPONENT>_(FOUND|LIBRARY)
680
- set(${ICU_PRIVATE_VAR_NS}_COMPONENT_VARIABLES "FOUND" "LIBRARY" "LIBRARY_RELEASE" "LIBRARY_DEBUG")
681
- foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PRIVATE_VAR_NS}_COMPONENTS})
682
- string(TOUPPER "${${ICU_PRIVATE_VAR_NS}_COMPONENT}" ${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT)
683
- foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT_VARIABLE ${${ICU_PRIVATE_VAR_NS}_COMPONENT_VARIABLES})
684
- icudebug("${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_${${ICU_PRIVATE_VAR_NS}_COMPONENT_VARIABLE}")
685
- endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT_VARIABLE)
686
- endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
687
-
688
- endif(${ICU_PUBLIC_VAR_NS}_DEBUG)
689
-
690
- ########## </debug> ##########