From: Kristóf Katus Date: Tue, 23 Aug 2011 09:28:30 +0000 (+0200) Subject: Added checking for header files in order to get proper define directives in the confi... X-Git-Tag: v0.3~11^2~4 X-Git-Url: http://developer.intra2net.com/git/?p=libasyncio;a=commitdiff_plain;h=7b52dc4069da7565693f5bc1491091c97c7dc904 Added checking for header files in order to get proper define directives in the config hpp file. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index bd5d8e4..8559ce3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,6 +74,53 @@ endif(DOXYGEN_FOUND) # Spec file configure_file(${CMAKE_SOURCE_DIR}/libasyncio.spec.in ${CMAKE_SOURCE_DIR}/libasyncio.spec @ONLY) +# Check include files and availability of libraries for config file +include(CheckIncludeFiles) + +if(Boost_FOUND) + set(HAVE_BOOST 1) +endif() +if(Boost_SIGNALS_FOUND) + set(HAVE_BOOST_SIGNALS 1) +endif() +if(Boost_UNIT_TEST_FRAMEWORK_FOUND) + set(HAVE_BOOST_UNIT_TEST_FRAMEWORK 1) +endif() +if(LIBI2NCOMMON_FOUND) + set(HAVE_LIBI2NCOMMON 1) +endif() +if(LIBT2N_FOUND) + set(HAVE_LIBT2N 1) +endif() +check_include_files(dlfcn.h HAVE_DLFCN_H) +check_include_files(inttypes.h HAVE_INTTYPES_H) +check_include_files(memory.h HAVE_MEMORY_H) +check_include_files(stdint.h HAVE_STDINT_H) +check_include_files(stdlib.h HAVE_STDLIB_H) +check_include_files(strings.h HAVE_STRINGS_H) +check_include_files(string.h HAVE_STRING_H) +check_include_files(sys/stat.h HAVE_SYS_STAT_H) +check_include_files(sys/types.h HAVE_SYS_TYPES_H) +check_include_files(unistd.h HAVE_UNISTD_H) +set(STDC_HEADER_NAMES + assert.h + ctype.h + errno.h + float.h + limits.h + locale.h + math.h + setjmp.h + signal.h + stdarg.h + stddef.h + stdio.h + stdlib.h + string.h + time.h +) +check_include_files("${STDC_HEADER_NAMES}" STDC_HEADERS) + # Config file configure_file(${CMAKE_SOURCE_DIR}/asyncio_config.hpp.in.cmake ${CMAKE_BINARY_DIR}/asyncio_config.hpp) include_directories(BEFORE ${CMAKE_BINARY_DIR}) diff --git a/asyncio/CMakeLists.txt b/asyncio/CMakeLists.txt index 4d16a7f..8a1521d 100644 --- a/asyncio/CMakeLists.txt +++ b/asyncio/CMakeLists.txt @@ -28,7 +28,7 @@ set_target_properties(libasyncio PROPERTIES VERSION ${VERSION} SOVERSION 0) set_target_properties(libasyncio PROPERTIES OUTPUT_NAME asyncio) # Dependencies -target_link_libraries(libasyncio ${LIBI2NCOMMON_LIBRARIES} ${Boost_LIBRARIES}) +target_link_libraries(libasyncio ${LIBI2NCOMMON_LIBRARIES} ${Boost_SIGNALS_LIBRARIES}) # Headerlist foreach(header_file_in ${libasyncio_HEADERS}) diff --git a/asyncio_config.hpp.in.cmake b/asyncio_config.hpp.in.cmake index b21e03a..91d6e8c 100644 --- a/asyncio_config.hpp.in.cmake +++ b/asyncio_config.hpp.in.cmake @@ -1,13 +1,13 @@ -/* asyncio_config.hpp.in: configure input file for cmake */ +/* asyncio_config.hpp.in.cmake: configure input file for cmake */ /* define if the Boost library is available */ -#cmakedefine HAVE_BOOST ${Boost_FOUND} +#cmakedefine HAVE_BOOST /* define if the Boost::Signals library is available */ -#cmakedefine HAVE_BOOST_SIGNALS ${Boost_SIGNALS_FOUND} +#cmakedefine HAVE_BOOST_SIGNALS /* define if the Boost::Unit_Test_Framework library is available */ -#cmakedefine HAVE_BOOST_UNIT_TEST_FRAMEWORK ${Boost_UNIT_TEST_FRAMEWORK_FOUND} +#cmakedefine HAVE_BOOST_UNIT_TEST_FRAMEWORK /* Define to 1 if you have the header file. */ #cmakedefine01 HAVE_DLFCN_H @@ -16,10 +16,10 @@ #cmakedefine01 HAVE_INTTYPES_H /* define if libi2ncommon is available */ -#cmakedefine HAVE_LIBI2NCOMMON ${LIBI2NCOMMON_FOUND} +#cmakedefine HAVE_LIBI2NCOMMON /* define if libt2n is available */ -#cmakedefine HAVE_LIBT2N ${LIBT2N_FOUND} +#cmakedefine HAVE_LIBT2N /* Define to 1 if you have the header file. */ #cmakedefine01 HAVE_MEMORY_H @@ -45,29 +45,26 @@ /* Define to 1 if you have the header file. */ #cmakedefine01 HAVE_UNISTD_H -/* Define to the sub-directory in which libtool stores uninstalled libraries. */ -#cmakedefine LT_OBJDIR "${LT_OBJDIR}" - /* Name of package */ -#cmakedefine PACKAGE "${PROJECT_NAME}" +#define PACKAGE "${PROJECT_NAME}" /* Define to the address where bug reports for this package should be sent. */ -#cmakedefine PACKAGE_BUGREPORT "" +#define PACKAGE_BUGREPORT "" /* Define to the full name of this package. */ -#cmakedefine PACKAGE_NAME "${PROJECT_NAME}" +#define PACKAGE_NAME "${PROJECT_NAME}" /* Define to the full name and version of this package. */ -#cmakedefine PACKAGE_STRING "${PROJECT_NAME} ${VERSION}" +#define PACKAGE_STRING "${PROJECT_NAME} ${VERSION}" /* Define to the one symbol short name of this package. */ -#cmakedefine PACKAGE_TARNAME "${PROJECT_NAME}" +#define PACKAGE_TARNAME "${PROJECT_NAME}" /* Define to the version of this package. */ -#cmakedefine PACKAGE_VERSION "${VERSION}" +#define PACKAGE_VERSION "${VERSION}" /* Define to 1 if you have the ANSI C header files. */ #cmakedefine01 STDC_HEADERS /* Version number of package */ -#cmakedefine VERSION "${VERSION}" +#define VERSION "${VERSION}"