blob: 6a824b1b859f4b61fc57da70a23abdedd74e7c77 [file] [log] [blame]
# CMake build for xalan-c
#
# Written by Roger Leigh <rleigh@codelibre.net>
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Run "cmake" to generate the build files for your platform
cmake_minimum_required(VERSION 3.2.0)
# Use new variable expansion policy.
if (POLICY CMP0053)
cmake_policy(SET CMP0053 NEW)
endif(POLICY CMP0053)
if (POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif(POLICY CMP0054)
if (POLICY CMP0067)
cmake_policy(SET CMP0067 NEW)
endif(POLICY CMP0067)
# Try C++14, then fall back to C++11 and C++98. Used for feature tests
# for optional features.
set(CMAKE_CXX_STANDARD 14)
# Use folders (for IDE project grouping)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Source additional modules from the "cmake" directory
list(APPEND CMAKE_MODULE_PATH
"${CMAKE_CURRENT_LIST_DIR}/cmake")
# Read version information from version.incl.
include(XalanDLL)
string(REGEX REPLACE "([^_]+)_([^_]+)_([^_]+)" "\\1.\\2.\\3" xalan_c_version "${XALAN_META_VER}")
message(STATUS "Configuring Apache Xalan-C++ version ${xalan_c_version}")
# Project version
project(${XALAN_META_PROJECT_NAME}
VERSION "${xalan_c_version}"
LANGUAGES C CXX)
enable_testing()
# For autotools header compatibility
set(PACKAGE "${PROJECT_NAME}")
set(PACKAGE_NAME "${PROJECT_NAME}")
set(PACKAGE_TARNAME "${PROJECT_NAME}")
set(PACKAGE_VERSION "${PROJECT_VERSION}")
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_BUGREPORT "dev@xalan.apache.org")
set(PACKAGE_URL "https://xalan.apache.org/xalan-c/")
find_package(Threads)
include(GNUInstallDirs)
include(XalanWarnings)
include(XalanICU)
include(XalanXerces)
include(XalanMsgLoaderSelection)
include(XalanTranscoderSelection)
include(XalanOperatorDelete)
include(XalanPathMax)
include(XalanLFS)
# Generate pkg-config file
set(pkgconfig-dir "${CMAKE_INSTALL_LIBDIR}/pkgconfig" CACHE STRING "pkg-config installation directory (default ${CMAKE_INSTALL_LIBDIR}/pkgconfig)")
set(PKGCONFIGDIR "${pkgconfig-dir}")
set(prefix "${CMAKE_INSTALL_PREFIX}")
set(exec_prefix "${CMAKE_INSTALL_PREFIX}")
set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}")
set(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/xalan-c.pc.in
${CMAKE_CURRENT_BINARY_DIR}/xalan-c.pc)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/xalan-c.pc
DESTINATION "${PKGCONFIGDIR}"
COMPONENT "development")
# Process subdirectories
add_subdirectory(src/xalanc/Utils/MsgCreator)
add_subdirectory(src/xalanc/Utils)
add_subdirectory(src/xalanc/Utils/XalanMsgLib)
add_subdirectory(src/xalanc)
add_subdirectory(src/xalanc/TestXSLT)
add_subdirectory(src/xalanc/TestXPath)
add_subdirectory(samples)
add_subdirectory(Tests)
# Display configuration summary
message(STATUS "")
message(STATUS "Xalan-C++ configuration summary")
message(STATUS "-------------------------------")
message(STATUS "")
message(STATUS " Version: ${xalan-c_VERSION}")
message(STATUS " Library version: ${XALAN_META_VER}")
if(MSVC)
message(STATUS " Library major version: ${XALAN_META_MS_LIB_MAJOR_VER}")
message(STATUS " Library minor version: ${XALAN_META_MS_LIB_MINOR_VER}")
else()
message(STATUS " Library major version: ${XALAN_META_LIB_MAJOR_VER}")
message(STATUS " Library minor version: ${XALAN_META_LIB_MINOR_VER}")
endif()
message(STATUS "")
message(STATUS " Installation directory: ${prefix}")
message(STATUS " C compiler: ${CMAKE_C_COMPILER}")
message(STATUS " C++ compiler: ${CMAKE_CXX_COMPILER}")
message(STATUS "")
message(STATUS " Build shared libraries: ${BUILD_SHARED_LIBS}")
message(STATUS " Transcoder: ${transcoder}")
message(STATUS " Message Loader: ${msgloader}")
message(STATUS " Message Loader Locale: ${message-locale}")