File: FindAIO.cmake

package info (click to toggle)
eckit 1.32.4-3
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 305,876 kB
  • sloc: cpp: 111,654; ansic: 2,826; yacc: 590; lex: 361; python: 237; sh: 202; makefile: 42
file content (70 lines) | stat: -rw-r--r-- 1,946 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# (C) Copyright 2011- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernmental organisation nor
# does it submit to any jurisdiction.

# OUTPUT:
# RT_LIB  = the library to link against

if( CMAKE_SYSTEM_NAME MATCHES "Linux" )

    find_package( Realtime )

    if( REALTIME_FOUND ) # check that aio needs realtime
        set( AIO_LIBRARIES ${RT_LIB} )
    endif()

endif()

find_path( AIO_INCLUDE_DIRS NAMES aio.h HINTS ENV AIO_PATH ${AIO_PATH} )

mark_as_advanced( AIO_INCLUDE_DIRS )

include(FindPackageHandleStandardArgs)

find_package_handle_standard_args( AIO  DEFAULT_MSG  AIO_INCLUDE_DIRS  )

# # checks for AIO64 vs AIO
# if( AIO_FOUND )
#
# 	include( CheckCSourceCompiles )
# 	include( CMakePushCheckState )
#
#     cmake_push_check_state()
#
# 		set( CMAKE_REQUIRED_INCLUDES ${AIO_INCLUDE_DIRS} )
#
# 		if( AIO_LIBRARIES )
# 			set( CMAKE_REQUIRED_LIBRARIES ${AIO_LIBRARIES} )
# 		endif()
#
# 		if( NOT DEFINED EC_HAVE_AIOCB )
# 			ecbuild_cache_check_c_source_compiles( "#include <aio.h>
# 									  #include <fcntl.h>
# 									  int main(){
# 										  struct aiocb* aiocbp;
# 										  int n = aio_write(aiocbp);
# 										  n = aio_read(aiocbp);
# 										  n = aio_fsync(O_SYNC,aiocbp);
# 										  return 0; }"
# 									EC_HAVE_AIOCB )
# 		endif()
#
# 		if( NOT DEFINED EC_HAVE_AIOCB64 )
# 			check_c_source_compiles( "#include <aio.h>
# 									  #include <fcntl.h>
# 									  int main(){
# 										  struct aiocb64* aiocbp;
# 										  int n = aio_write64(aiocbp);
# 										  n = aio_read64(aiocbp);
# 										  n = aio_fsync64(O_SYNC,aiocbp);
# 										  return 0; }"
# 									EC_HAVE_AIOCB64 )
# 		endif()
#
#     cmake_pop_check_state()
#
# endif()