Fix build with CMake

- Fix library finding ('nfc' instead of 'libnfc');
- Generate config.h from template on non-win32 platforms;
- While here, include protection for config.h in several files.
This commit is contained in:
Stefan Walkner 2017-04-12 13:45:33 +02:00 committed by Romain Tartière
parent 358df7759a
commit 565ee18b8e
25 changed files with 94 additions and 24 deletions

View file

@ -0,0 +1,13 @@
#ifndef __CONFIG_POSIX_H__
#define __CONFIG_POSIX_H__
#cmakedefine _XOPEN_SOURCE @_XOPEN_SOURCE@
#cmakedefine HAVE_SYS_ENDIAN_H @_HAVE_SYS_ENDIAN_H@
#cmakedefine HAVE_ENDIAN_H @_HAVE_ENDIAN_H@
#cmakedefine HAVE_BYTESWAP_H @_HAVE_BYTESWAP_H@
#cmakedefine HAVE_COREFOUNDATION_COREFOUNDATION_H @_HAVE_COREFOUNDATION_COREFOUNDATION_H@
#endif /* !__CONFIG_POSIX_H__ */

View file

@ -9,7 +9,7 @@ message("libnfc install dir: " ${LIBNFC_INSTALL_DIR})
find_path(LIBNFC_INCLUDE_DIRS NAMES nfc/nfc.h PATHS ${LIBNFC_INSTALL_DIR}/include)
message("libnfc include dir found: " ${LIBNFC_INCLUDE_DIRS})
find_library(LIBNFC_LIBRARIES libnfc PATHS ${LIBNFC_INSTALL_DIR}/lib)
find_library(LIBNFC_LIBRARIES nfc PATHS ${LIBNFC_INSTALL_DIR}/lib)
message("libnfc library found: " ${LIBNFC_LIBRARIES})
INCLUDE(FindPackageHandleStandardArgs)