expat: Re-write CMake build system for our needs

Hard-code production of a static library.  Rename to `cmexpat`.
This commit is contained in:
Brad King 2016-05-05 15:13:10 -04:00
parent 4544c68a6e
commit f177c8a0a7
2 changed files with 14 additions and 33 deletions

View File

@ -1,38 +1,17 @@
# This file is copyrighted under the BSD-license for buildsystem files of KDE
# copyright 2010, Patrick Spendrin <ps_ml@gmx.de>
project(expat)
cmake_minimum_required(VERSION 2.6)
include(ConfigureChecks.cmake) include(ConfigureChecks.cmake)
include_directories(${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/lib)
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS -wd4996)
endif(MSVC)
if(WIN32) if(WIN32)
add_definitions(-DCOMPILING_FOR_WINDOWS) add_definitions(-DCOMPILING_FOR_WINDOWS)
endif(WIN32) endif(WIN32)
set(expat_SRCS include_directories(
lib/xmlparse.c ${CMAKE_CURRENT_BINARY_DIR}
lib/xmlrole.c ${CMAKE_CURRENT_SOURCE_DIR}/lib
lib/xmltok.c )
lib/xmltok_impl.c
lib/xmltok_ns.c
)
if(BUILD_shared) add_library(cmexpat STATIC
set(_SHARED SHARED) lib/xmlparse.c
if(WIN32) lib/xmlrole.c
set(expat_SRCS ${expat_SRCS} lib/libexpat.def) lib/xmltok.c
endif(WIN32) lib/xmltok_impl.c
else(BUILD_shared) lib/xmltok_ns.c
set(_SHARED STATIC) )
if(WIN32)
add_definitions(-DXML_STATIC)
endif(WIN32)
endif(BUILD_shared)
add_library(expat ${_SHARED} ${expat_SRCS})

View File

@ -53,6 +53,8 @@
#endif #endif
#endif /* not defined XMLCALL */ #endif /* not defined XMLCALL */
/* Build within CMake hard-codes use of a static library. */
#define XML_STATIC
#if !defined(XML_STATIC) && !defined(XMLIMPORT) #if !defined(XML_STATIC) && !defined(XMLIMPORT)
#ifndef XML_BUILDING_EXPAT #ifndef XML_BUILDING_EXPAT