1 # - Define macro to check return type of signals (int/void)
3 # GMX_TEST_RETSIGTYPE(VARIABLE)
5 # VARIABLE will be set to the return type of signals - "int" or "void"
7 # Remember to have a cmakedefine for it too...
9 MACRO(GMX_TEST_RETSIGTYPE VARIABLE)
10 IF(NOT DEFINED ${VARIABLE})
12 MESSAGE(STATUS "Checking for return type of signals")
14 # First check without any special flags
15 TRY_COMPILE(RETSIGTYPE_INT_OK "${CMAKE_BINARY_DIR}"
16 "${CMAKE_SOURCE_DIR}/cmake/TestRetSigType.c")
19 MESSAGE(STATUS "Checking for return type of signals - int")
20 set(${VARIABLE} "int" CACHE INTERNAL "Result of test for signal return type" FORCE)
21 else(RETSIGTYPE_INT_OK)
22 MESSAGE(STATUS "Checking for return type of signals - void")
23 set(${VARIABLE} "void" CACHE INTERNAL "Result of test for signal return type" FORCE)
24 endif(RETSIGTYPE_INT_OK)
26 ENDIF(NOT DEFINED ${VARIABLE})
27 ENDMACRO(GMX_TEST_RETSIGTYPE VARIABLE)
31 # - Define macro to check if SIGUSR1 is defined
33 # GMX_TEST_SIGUSR1(VARIABLE)
35 # VARIABLE will be set if SIGUSR1 is present in signal.h
38 MACRO(GMX_TEST_SIGUSR1 VARIABLE)
39 IF(NOT DEFINED HAVE_${VARIABLE})
41 MESSAGE(STATUS "Checking for SIGUSR1")
43 TRY_COMPILE(HAVE_${VARIABLE} "${CMAKE_BINARY_DIR}"
44 "${CMAKE_SOURCE_DIR}/cmake/TestSIGUSR1.c")
47 MESSAGE(STATUS "Checking for SIGUSR1 - found")
48 set(${VARIABLE} 1 CACHE INTERNAL "Result of test for SIGUSR1" FORCE)
49 ELSE(HAVE_${VARIABLE})
50 MESSAGE(STATUS "Checking for SIGUSR1 - not found")
51 set(${VARIABLE} 0 CACHE INTERNAL "Result of test for SIGUSR1" FORCE)
52 ENDIF(HAVE_${VARIABLE})
54 ENDIF(NOT DEFINED HAVE_${VARIABLE})
55 ENDMACRO(GMX_TEST_SIGUSR1 VARIABLE)