Blame lib/CMakeLists.txt

Packit 0b5880
#
Packit 0b5880
# Check: a unit test framework for C
Packit 0b5880
# Copyright (C) 2011 Mateusz Loskot
Packit 0b5880
#
Packit 0b5880
# This library is free software; you can redistribute it and/or
Packit 0b5880
# modify it under the terms of the GNU Lesser General Public
Packit 0b5880
# License as published by the Free Software Foundation; either
Packit 0b5880
# version 2.1 of the License, or (at your option) any later version.
Packit 0b5880
#
Packit 0b5880
# This library is distributed in the hope that it will be useful,
Packit 0b5880
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 0b5880
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 0b5880
# Lesser General Public License for more details.
Packit 0b5880
#
Packit 0b5880
# You should have received a copy of the GNU Lesser General Public
Packit 0b5880
# License along with this library; if not, write to the
Packit 0b5880
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Packit 0b5880
# Boston, MA 02111-1307, USA.
Packit 0b5880
#
Packit 0b5880
Packit 0b5880
Packit 0b5880
set(SOURCES libcompat.c)
Packit 0b5880
Packit 0b5880
set(SOURCES ${SOURCES} fpclassify.c)
Packit 0b5880
Packit 0b5880
if (NOT HAVE_LIBRT)
Packit 0b5880
  set(SOURCES ${SOURCES} clock_gettime.c)
Packit 0b5880
  set(SOURCES ${SOURCES} timer_create.c)
Packit 0b5880
  set(SOURCES ${SOURCES} timer_delete.c)
Packit 0b5880
  set(SOURCES ${SOURCES} timer_settime.c)
Packit 0b5880
endif(NOT HAVE_LIBRT)
Packit 0b5880
Packit 0b5880
if(NOT HAVE_GETLINE)
Packit 0b5880
  set(SOURCES ${SOURCES} getline.c)
Packit 0b5880
endif(NOT HAVE_GETLINE)
Packit 0b5880
Packit 0b5880
if(NOT HAVE_GETTIMEOFDAY)
Packit 0b5880
  set(SOURCES ${SOURCES} gettimeofday.c)
Packit 0b5880
endif(NOT HAVE_GETTIMEOFDAY)
Packit 0b5880
Packit 0b5880
if(NOT HAVE_DECL_LOCALTIME_R)
Packit 0b5880
  set(SOURCES ${SOURCES} localtime_r.c)
Packit 0b5880
endif(NOT HAVE_DECL_LOCALTIME_R)
Packit 0b5880
Packit 0b5880
if(NOT HAVE_MALLOC)
Packit 0b5880
  set(SOURCES ${SOURCES} malloc.c)
Packit 0b5880
endif(NOT HAVE_MALLOC)
Packit 0b5880
Packit 0b5880
if(NOT HAVE_REALLOC)
Packit 0b5880
  set(SOURCES ${SOURCES} realloc.c)
Packit 0b5880
endif(NOT HAVE_REALLOC)
Packit 0b5880
Packit 0b5880
if(NOT HAVE_SNPRINTF)
Packit 0b5880
    set(SOURCES ${SOURCES} snprintf.c)
Packit 0b5880
endif(NOT HAVE_SNPRINTF)
Packit 0b5880
Packit 0b5880
if(NOT HAVE_DECL_STRDUP AND NOT HAVE__STRDUP)
Packit 0b5880
  set(SOURCES ${SOURCES} strdup.c)
Packit 0b5880
endif(NOT HAVE_DECL_STRDUP AND NOT HAVE__STRDUP)
Packit 0b5880
Packit 0b5880
if(NOT HAVE_DECL_STRSIGNAL)
Packit 0b5880
  set(SOURCES ${SOURCES} strsignal.c)
Packit 0b5880
endif(NOT HAVE_DECL_STRSIGNAL)
Packit 0b5880
Packit 0b5880
Packit 0b5880
set(HEADERS libcompat.h)
Packit 0b5880
Packit 0b5880
add_library(compat STATIC ${SOURCES} ${HEADERS})
Packit 0b5880
Packit 0b5880
install(TARGETS compat
Packit 0b5880
  RUNTIME DESTINATION bin
Packit 0b5880
  LIBRARY DESTINATION lib
Packit 0b5880
  ARCHIVE DESTINATION lib) 
Packit 0b5880
Packit 0b5880
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/libcompat.h DESTINATION include)