Restructuring directory layout. Move towards "Modern CMake" usage.

This commit is contained in:
Jim Evins
2017-11-23 22:15:24 -05:00
parent 8bec3594ec
commit b8ee5e1f73
198 changed files with 4509 additions and 5324 deletions
+25 -4
View File
@@ -2,8 +2,9 @@
# Once done this will define
#
# LIBZINT_FOUND - System has Zint barcode
# LIBZINT_INCLUDE_DIR - The Zint barcode include directory
# LIBZINT_INCLUDE_DIRS - The Zint barcode include directory
# LIBZINT_LIBRARIES - The libraries needed to use Zint barcode
# LIBZINT_DEFINITIONS - Definitions needed to use Zint barcode
# LIBZINT_VERSION_STRING - the version of Zint barcode found
set (LIBZINT_DEFINITIONS "")
@@ -12,6 +13,26 @@ find_path (LIBZINT_INCLUDE_DIR NAMES zint.h)
find_library (LIBZINT_LIBRARIES NAMES zint )
if (LIBZINT_LIBRARY AND LIBZINT_INCLUDE_DIR)
set (LIBZINT_INCLUDE_DIRS ${LIBZINT_INCLUDE_DIR})
set (LIBZINT_LIBRARIES ${LIBZINT_LIBRARY})
set (LIBZINT_DEFINITIONS "")
if (NOT TARGET ZINT::ZINT)
add_library (ZINT::ZINT UNKNOWN IMPORTED)
set_target_properties (ZINT::ZINT PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "${LIBZINT_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${LIBZINT_INCLUDE_DIRS}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${LIBZINT_LIBRARY}"
)
endif ()
endif ()
if (LIBZINT_INCLUDE_DIR AND EXISTS "${LIBZINT_INCLUDE_DIR}/zint.h")
file (STRINGS "${LIBZINT_INCLUDE_DIR}/zint.h" ZINT_MAJOR_H REGEX "^#define ZINT_VERSION_MAJOR *[0-9]*")
file (STRINGS "${LIBZINT_INCLUDE_DIR}/zint.h" ZINT_MINOR_H REGEX "^#define ZINT_VERSION_MINOR *[0-9]*")
@@ -25,8 +46,8 @@ endif()
# handle the QUIETLY and REQUIRED arguments and set LIBZINT_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibZint
REQUIRED_VARS LIBZINT_LIBRARIES LIBZINT_INCLUDE_DIR
find_package_handle_standard_args(LibZint
REQUIRED_VARS LIBZINT_LIBRARY LIBZINT_INCLUDE_DIR
VERSION_VAR LIBZINT_VERSION_STRING)
mark_as_advanced(LIBZINT_INCLUDE_DIR LIBZINT_LIBRARIES)
mark_as_advanced(LIBZINT_INCLUDE_DIR LIBZINT_LIBRARY)