blob: 940c388127bab78af50a12c586c59f826e983c7d [file] [log] [blame]
Oscar Fuentes00905d52008-09-22 01:08:49 +00001# - Check if for hash_set.
2# CHECK_HASHSET ()
3#
4
5include(CheckCXXSourceCompiles)
6
7macro(CHECK_HASHSET)
8 message(STATUS "Checking for C++ hash_set implementation...")
9 check_cxx_source_compiles("
10 #include <ext/hash_set>
11 int main() {
12 __gnu_cxx::hash_set<int> t;
13 }
14"
15 HAVE_GNU_EXT_HASH_SET
16 )
17 if(HAVE_GNU_EXT_HASH_SET)
18 message(STATUS "C++ hash_set found in 'ext' dir in namespace __gnu_cxx::")
19 endif(HAVE_GNU_EXT_HASH_SET)
20
21 check_cxx_source_compiles("
22 #include <ext/hash_set>
23 int main() {
24 std::hash_set<int> t;
25 }
26"
27 HAVE_STD_EXT_HASH_SET
28 )
29 if(HAVE_STD_EXT_HASH_SET)
30 message(STATUS "C++ hash_set found in 'ext' dir in namespace std::")
31 endif(HAVE_STD_EXT_HASH_SET)
32
33 check_cxx_source_compiles("
34 #include <hash_set>
35 int main() {
36 hash_set<int> t;
37 }
38"
39 HAVE_GLOBAL_HASH_SET
40 )
41 if(HAVE_GLOBAL_HASH_SET)
42 message(STATUS "C++ hash_set found in global namespace")
43 endif(HAVE_GLOBAL_HASH_SET)
44
45 if(NOT HAVE_GNU_EXT_HASH_SET)
46 if(NOT HAVE_STD_EXT_HASH_SET)
47 if(NOT HAVE_GLOBAL_HASH_SET)
48 message(STATUS "C++ hash_set not found")
49 endif(NOT HAVE_GLOBAL_HASH_SET)
50 endif(NOT HAVE_STD_EXT_HASH_SET)
51 endif(NOT HAVE_GNU_EXT_HASH_SET)
52endmacro(CHECK_HASHSET)