]> granicus.if.org Git - check/blob - lib/CMakeLists.txt
Add alarm.c to the build
[check] / lib / CMakeLists.txt
1 #
2 # Check: a unit test framework for C
3 # Copyright (C) 2011 Mateusz Loskot
4 #
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
9 #
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 # Lesser General Public License for more details.
14 #
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the
17 # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 # Boston, MA 02111-1307, USA.
19 #
20
21
22 set(SOURCES libcompat.c)
23
24 set(SOURCES ${SOURCES} fpclassify.c)
25
26 if (NOT HAVE_LIBRT)
27   set(SOURCES ${SOURCES} clock_gettime.c)
28   set(SOURCES ${SOURCES} timer_create.c)
29   set(SOURCES ${SOURCES} timer_delete.c)
30   set(SOURCES ${SOURCES} timer_settime.c)
31 endif(NOT HAVE_LIBRT)
32
33 if(NOT HAVE_GETLINE)
34   set(SOURCES ${SOURCES} getline.c)
35 endif(NOT HAVE_GETLINE)
36
37 if(NOT HAVE_GETTIMEOFDAY)
38   set(SOURCES ${SOURCES} gettimeofday.c)
39 endif(NOT HAVE_GETTIMEOFDAY)
40
41 if(NOT HAVE_DECL_LOCALTIME_R)
42   set(SOURCES ${SOURCES} localtime_r.c)
43 endif(NOT HAVE_DECL_LOCALTIME_R)
44
45 if(NOT HAVE_MALLOC)
46   set(SOURCES ${SOURCES} malloc.c)
47 endif(NOT HAVE_MALLOC)
48
49 if(NOT HAVE_REALLOC)
50   set(SOURCES ${SOURCES} realloc.c)
51 endif(NOT HAVE_REALLOC)
52
53 if(NOT HAVE_SNPRINTF)
54     set(SOURCES ${SOURCES} snprintf.c)
55 endif(NOT HAVE_SNPRINTF)
56
57 if(NOT HAVE_DECL_STRDUP AND NOT HAVE__STRDUP)
58   set(SOURCES ${SOURCES} strdup.c)
59 endif(NOT HAVE_DECL_STRDUP AND NOT HAVE__STRDUP)
60
61 if(NOT HAVE_DECL_STRSIGNAL)
62   set(SOURCES ${SOURCES} strsignal.c)
63 endif(NOT HAVE_DECL_STRSIGNAL)
64
65 if(NOT HAVE_DECL_ALARM)
66   set(SOURCES ${SOURCES} alarm.c)
67 endif(NOT HAVE_DECL_ALARM)
68
69 set(HEADERS libcompat.h)
70
71 add_library(compat STATIC ${SOURCES} ${HEADERS})
72
73 install(TARGETS compat
74   RUNTIME DESTINATION bin
75   LIBRARY DESTINATION lib
76   ARCHIVE DESTINATION lib) 
77
78 install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/libcompat.h DESTINATION include)