Skip to content

Commit

Permalink
Move CMake stuff to separate directory
Browse files Browse the repository at this point in the history
  • Loading branch information
widgetii committed Feb 27, 2021
1 parent bc02a80 commit dd246ab
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 4 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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})
74 changes: 74 additions & 0 deletions cmake/config.h
Original file line number Diff line number Diff line change
@@ -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 <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <ctype.h>


/*
* 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);
File renamed without changes.

0 comments on commit dd246ab

Please sign in to comment.