2 # Check: a unit test framework for C
3 # Copyright (C) 2011 Mateusz Loskot
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.
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.
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.
22 set(SOURCES libcompat.c)
24 set(SOURCES ${SOURCES} fpclassify.c)
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)
34 set(SOURCES ${SOURCES} getline.c)
35 endif(NOT HAVE_GETLINE)
37 if(NOT HAVE_GETTIMEOFDAY)
38 set(SOURCES ${SOURCES} gettimeofday.c)
39 endif(NOT HAVE_GETTIMEOFDAY)
41 if(NOT HAVE_DECL_LOCALTIME_R)
42 set(SOURCES ${SOURCES} localtime_r.c)
43 endif(NOT HAVE_DECL_LOCALTIME_R)
46 set(SOURCES ${SOURCES} malloc.c)
47 endif(NOT HAVE_MALLOC)
50 set(SOURCES ${SOURCES} realloc.c)
51 endif(NOT HAVE_REALLOC)
54 set(SOURCES ${SOURCES} snprintf.c)
55 endif(NOT HAVE_SNPRINTF)
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)
61 if(NOT HAVE_DECL_STRSIGNAL)
62 set(SOURCES ${SOURCES} strsignal.c)
63 endif(NOT HAVE_DECL_STRSIGNAL)
65 if(NOT HAVE_DECL_ALARM)
66 set(SOURCES ${SOURCES} alarm.c)
67 endif(NOT HAVE_DECL_ALARM)
69 set(HEADERS libcompat.h)
71 add_library(compat STATIC ${SOURCES} ${HEADERS})
73 install(TARGETS compat
74 RUNTIME DESTINATION bin
75 LIBRARY DESTINATION lib
76 ARCHIVE DESTINATION lib)
78 install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/libcompat.h DESTINATION include)