From dd246ab5f0cb16d597dc136a459188f7617faa3e Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin Date: Sat, 27 Feb 2021 13:10:39 +0300 Subject: [PATCH] Move CMake stuff to separate directory --- CMakeLists.txt | 8 +-- cmake/config.h | 74 ++++++++++++++++++++++ mxmlConfig.cmake => cmake/mxmlConfig.cmake | 0 3 files changed, 78 insertions(+), 4 deletions(-) create mode 100644 cmake/config.h rename mxmlConfig.cmake => cmake/mxmlConfig.cmake (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 612f9c7..8daabc5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,11 +19,11 @@ set(SOURCES mxml-set.c mxml-string.c) -configure_file(config.h.in config.h) -set(HEADERS mxml-private.h ${CMAKE_CURRENT_BINARY_DIR}/config.h) +#configure_file(config.h.in config.h) +set(HEADERS mxml-private.h cmake/config.h) add_library(${PROJECT_NAME} ${SOURCES} ${HEADERS}) -target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) add_library(MSweet::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) # install library @@ -47,6 +47,6 @@ install(FILES mxml.h DESTINATION include) include(CMakePackageConfigHelpers) write_basic_package_version_file(${PROJECT_NAME}ConfigVersion.cmake COMPATIBILITY SameMajorVersion) -install(FILES ${PROJECT_NAME}Config.cmake +install(FILES cmake/${PROJECT_NAME}Config.cmake ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake DESTINATION lib/cmake/${PROJECT_NAME}) diff --git a/cmake/config.h b/cmake/config.h new file mode 100644 index 0000000..ebcc302 --- /dev/null +++ b/cmake/config.h @@ -0,0 +1,74 @@ +/* + * Xcode configuration file for Mini-XML, a small XML file parsing library. + * + * https://www.msweet.org/mxml + * + * Copyright © 2003-2020 by Michael R Sweet. + * + * Licensed under Apache License v2.0. See the file "LICENSE" for more + * information. + */ + +/* + * Include necessary headers... + */ + +#include +#include +#include +#include +#include + + +/* + * Version number... + */ + +#define MXML_VERSION "Mini-XML v3.2" + + +/* + * Inline function support... + */ + +#define inline + + +/* + * Long long support... + */ + +#define HAVE_LONG_LONG 1 + + +/* + * Do we have the *printf() functions? + */ + +#define HAVE_SNPRINTF 1 +#define HAVE_VASPRINTF 1 +#define HAVE_VSNPRINTF 1 + + +/* + * Do we have the strXXX() functions? + */ + +#define HAVE_STRDUP 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRLCPY 1 + + +/* + * Do we have threading support? + */ + +#define HAVE_PTHREAD_H 1 + + +/* + * Define prototypes for string functions as needed... + */ + +extern char *_mxml_strdupf(const char *, ...); +extern char *_mxml_vstrdupf(const char *, va_list); diff --git a/mxmlConfig.cmake b/cmake/mxmlConfig.cmake similarity index 100% rename from mxmlConfig.cmake rename to cmake/mxmlConfig.cmake