Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added Libxml2, Random and support scripts for Libxml2

  • Loading branch information...
commit 0a797da5b84fff611dd8f01c55cd8ba1f188200d 1 parent 2125fe4
@jeremytregunna jeremytregunna authored
View
4 addons/CMakeLists.txt
@@ -42,7 +42,7 @@ add_subdirectory(HttpClient)
#add_subdirectory(Image)
#add_subdirectory(LZO)
#add_subdirectory(LibSndFile)
-#add_subdirectory(Libxml2)
+add_subdirectory(Libxml2)
#add_subdirectory(Loki)
#add_subdirectory(Loudmouth)
add_subdirectory(MD5)
@@ -61,7 +61,7 @@ add_subdirectory(NotificationCenter)
#add_subdirectory(Postgres)
#add_subdirectory(Python)
#add_subdirectory(QDBM)
-#add_subdirectory(Random)
+add_subdirectory(Random)
add_subdirectory(Range)
add_subdirectory(Rational)
#add_subdirectory(ReadLine)
View
34 addons/Libxml2/CMakeLists.txt
@@ -0,0 +1,34 @@
+# Base Io build system
+# Written by Jeremy Tregunna <jeremy.tregunna@me.com>
+#
+# Builds the Libxml2 addon
+
+# Find libxml2
+find_package(LibXml2)
+
+# Create the _build bundle hierarchy if needed.
+make_build_bundle(_build)
+
+# Did we find libevent? if so, set up the targets and all the
+# support variables.
+if(LIBXML2_FOUND)
+ # Output our dynamic library to the top-level _build hierarchy
+ set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/_build/dll)
+
+ # Add LibXml2 definitions
+ add_definitions(${LIBXML2_DEFINITIONS})
+
+ # Additional include directories
+ include_directories(${LIBXML2_INCLUDE_DIR})
+
+ # Our library sources.
+ file(GLOB SRCS "${CMAKE_CURRENT_SOURCE_DIR}/source/*.c")
+
+ # Now build the shared library
+ add_library(IoLibxml2 SHARED ${SRCS})
+ add_dependencies(IoLibxml2 iovmall)
+ target_link_libraries(IoLibxml2 iovmall ${LIBXML2_LIBRARIES})
+
+ # Install the addon to our global addons hierarchy.
+ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/io/addons)
+endif(LIBXML2_FOUND)
View
21 addons/Random/CMakeLists.txt
@@ -0,0 +1,21 @@
+# Base Io build system
+# Written by Jeremy Tregunna <jeremy.tregunna@me.com>
+#
+# Builds the Random addon
+
+# Create the _build bundle hierarchy if needed.
+make_build_bundle(_build)
+
+# Output our dynamic library to the top-level _build hierarchy
+set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/_build/dll)
+
+# Our library sources.
+file(GLOB SRCS "${CMAKE_CURRENT_SOURCE_DIR}/source/*.c")
+
+# Now build the shared library
+add_library(IoRandom SHARED ${SRCS})
+add_dependencies(IoRandom iovmall)
+target_link_libraries(IoRandom iovmall)
+
+# Install the addon to our global addons hierarchy.
+install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/io/addons)
View
54 modules/FindLibXml2.cmake
@@ -0,0 +1,54 @@
+# - Try to find the LibXml2 xml processing library
+# Once done this will define
+#
+# LIBXML2_FOUND - System has LibXml2
+# LIBXML2_INCLUDE_DIR - The LibXml2 include directory
+# LIBXML2_LIBRARIES - The libraries needed to use LibXml2
+# LIBXML2_DEFINITIONS - Compiler switches required for using LibXml2
+# LIBXML2_XMLLINT_EXECUTABLE - The XML checking tool xmllint coming with LibXml2
+
+#=============================================================================
+# Copyright 2006-2009 Kitware, Inc.
+# Copyright 2006 Alexander Neundorf <neundorf@kde.org>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distributed this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+# use pkg-config to get the directories and then use these values
+# in the FIND_PATH() and FIND_LIBRARY() calls
+FIND_PACKAGE(PkgConfig)
+PKG_CHECK_MODULES(PC_LIBXML libxml-2.0)
+SET(LIBXML2_DEFINITIONS ${PC_LIBXML_CFLAGS_OTHER})
+
+FIND_PATH(LIBXML2_INCLUDE_DIR NAMES libxml/xpath.h
+ HINTS
+ ${PC_LIBXML_INCLUDEDIR}
+ ${PC_LIBXML_INCLUDE_DIRS}
+ PATH_SUFFIXES libxml2
+ )
+
+FIND_LIBRARY(LIBXML2_LIBRARIES NAMES xml2 libxml2
+ HINTS
+ ${PC_LIBXML_LIBDIR}
+ ${PC_LIBXML_LIBRARY_DIRS}
+ )
+
+FIND_PROGRAM(LIBXML2_XMLLINT_EXECUTABLE xmllint)
+# for backwards compat. with KDE 4.0.x:
+SET(XMLLINT_EXECUTABLE "${LIBXML2_XMLLINT_EXECUTABLE}")
+
+INCLUDE(FindPackageHandleStandardArgs)
+
+# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if
+# all listed variables are TRUE
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
+
+MARK_AS_ADVANCED(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES LIBXML2_XMLLINT_EXECUTABLE)
+
Please sign in to comment.
Something went wrong with that request. Please try again.