1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
|
# plplot_lite/CMakeLists.txt
# Configure the build of a "lite" version of PLplot (with fewer dependencies
# but with fewer features as well).
# Copyright (C) 2013 Alan W. Irwin
# This file is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# This file is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public
# License along with this file; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
set(PACKAGE plplot_lite)
# List of dependencies (most of which are build tools) which should be
# ignored.
set(ignored_dependencies_LIST ${extra_ignored_dependencies_list})
set(dependencies_LIST
libagg
libharu
libqhull
shapelib
)
# Do boilerplate tasks that must be done for each different project
# that is configured as part of epa_build.
epa_boilerplate(
ignored_dependencies_LIST
PACKAGE
dependencies_LIST
dependencies_targets
EPA_PATH
source_PATH
)
set(CFLAGS "$ENV{CFLAGS}")
set(CXXFLAGS "$ENV{CXXFLAGS}")
set(FFLAGS "$ENV{FFLAGS}")
# Turn off wxwidgets, cairo, and qt for plplot_lite.
set(cmake_args
-DPLD_wxwidgets=OFF
-DENABLE_wxwidgets=OFF
-DDEFAULT_NO_CAIRO_DEVICES:BOOL=ON
-DDEFAULT_NO_QT_DEVICES:BOOL=ON
-DENABLE_qt=OFF
)
# Assumption that the top-level local PLplot source tree is two directories
# up from the present top-level directory for epa_build.
# This assumption is correct if you are accessing epa_build as
# a subset of the PLplot source tree so that its location is in
# cmake/epa_build within that source tree.
# But it is not the case if you have independently
# checked out just the epa_build subset of the normal PLplot source
# tree so check that the result really is a plplot source tree.
get_filename_component(PLPLOT_LOCAL_SOURCE_DIR ${CMAKE_SOURCE_DIR} PATH)
get_filename_component(PLPLOT_LOCAL_SOURCE_DIR ${PLPLOT_LOCAL_SOURCE_DIR} PATH)
find_file(IS_PLPLOT_SOURCE_TREE plcore.c
HINTS ${PLPLOT_LOCAL_SOURCE_DIR}/src
NO_DEFAULT_PATH
)
if(NOT IS_PLPLOT_SOURCE_TREE)
message(FATAL_ERROR "epa_build not located in cmake/epa_build in a PLplot source tree")
endif(NOT IS_PLPLOT_SOURCE_TREE)
# Data that is related to the PATH that must be used.
if(MSYS_PLATFORM)
set(EPA_PATH_NODLL "${EPA_PATH}")
set(EPA_PATH "${EPA_BASE}/Build/build_${PACKAGE}/dll;${EPA_PATH_NODLL}")
determine_msys_path(EPA_PATH "${EPA_PATH}")
endif(MSYS_PLATFORM)
ExternalProject_Add(
build_${PACKAGE}
DEPENDS "${dependencies_targets}"
DOWNLOAD_COMMAND ${CMAKE_COMMAND} -E copy_directory ${PLPLOT_LOCAL_SOURCE_DIR} ${EPA_BASE}/Source/build_${PACKAGE}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_BEFORE_INSTALL OFF
TEST_COMMAND ""
STEP_TARGETS configure build install test
)
if(COMPREHENSIVE_PLPLOT_TEST_INTERACTIVE OR COMPREHENSIVE_PLPLOT_TEST_NONINTERACTIVE)
string(REGEX REPLACE ";" " " blank_delimited_cmake_args "${cmake_args}")
if(COMPREHENSIVE_PLPLOT_TEST_INTERACTIVE)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/interactive_comprehensive_test.sh
"echo yes | ${EPA_BASE}/Source/build_${PACKAGE}/scripts/comprehensive_test.sh --generator_string \"${CMAKE_GENERATOR}\" --cmake_added_options \"${blank_delimited_cmake_args}\" --build_command \"${EPA_BUILD_COMMAND} -j${NUMBER_PARALLEL_JOBS}\" --ctest_command \"${CMAKE_CTEST_COMMAND} -j${NUMBER_PARALLEL_JOBS} --timeout 15000 \" --do_ctest no --do_test_noninteractive no"
)
add_custom_command(
OUTPUT
${EPA_BASE}/Stamp/build_${PACKAGE}/build_${PACKAGE}-test
COMMAND ${CMAKE_COMMAND} -E echo "comprehensive interactive tests"
COMMAND ${ENV_EXECUTABLE} PATH=${EPA_PATH} ${BASH_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/interactive_comprehensive_test.sh
APPEND
)
endif(COMPREHENSIVE_PLPLOT_TEST_INTERACTIVE)
if(COMPREHENSIVE_PLPLOT_TEST_NONINTERACTIVE)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/noninteractive_comprehensive_test.sh
"echo yes | ${EPA_BASE}/Source/build_${PACKAGE}/scripts/comprehensive_test.sh --generator_string \"${CMAKE_GENERATOR}\" --cmake_added_options \"${blank_delimited_cmake_args}\" --build_command \"${EPA_BUILD_COMMAND} -j${NUMBER_PARALLEL_JOBS}\" --ctest_command \"${CMAKE_CTEST_COMMAND} -j${NUMBER_PARALLEL_JOBS} --timeout 15000 \" --do_test_interactive no"
)
add_custom_command(
OUTPUT
${EPA_BASE}/Stamp/build_${PACKAGE}/build_${PACKAGE}-test
COMMAND ${CMAKE_COMMAND} -E echo "comprehensive noninteractive tests"
COMMAND ${ENV_EXECUTABLE} PATH=${EPA_PATH} ${BASH_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/noninteractive_comprehensive_test.sh
APPEND
)
endif(COMPREHENSIVE_PLPLOT_TEST_NONINTERACTIVE)
else(COMPREHENSIVE_PLPLOT_TEST_INTERACTIVE OR COMPREHENSIVE_PLPLOT_TEST_NONINTERACTIVE)
# If ENABLE_COMPREHENSIVE_PLPLOT_TEST is not true, then just
# configure a pure default case and build and install it.
add_custom_command(
OUTPUT
${EPA_BASE}/Stamp/build_${PACKAGE}/build_${PACKAGE}-configure
COMMAND ${CMAKE_COMMAND} -E echo "configure"
COMMAND ${ENV_EXECUTABLE} PATH=${EPA_PATH} "CFLAGS=${CFLAGS}" "CXXFLAGS=${CXXFLAGS}" "FFLAGS=${FFLAGS}" ${EPA_CMAKE_COMMAND} -DBUILD_TEST=ON ${cmake_args} ${EPA_BASE}/Source/build_${PACKAGE}
APPEND
)
add_custom_command(
OUTPUT
${EPA_BASE}/Stamp/build_${PACKAGE}/build_${PACKAGE}-build
COMMAND ${CMAKE_COMMAND} -E echo "build"
COMMAND ${ENV_EXECUTABLE} PATH=${EPA_PATH} ${EPA_PARALLEL_BUILD_COMMAND}
APPEND
)
add_custom_command(
OUTPUT
${EPA_BASE}/Stamp/build_${PACKAGE}/build_${PACKAGE}-install
COMMAND ${CMAKE_COMMAND} -E echo "install"
COMMAND ${ENV_EXECUTABLE} PATH=${EPA_PATH} ${EPA_PARALLEL_BUILD_COMMAND} install
APPEND
)
endif(COMPREHENSIVE_PLPLOT_TEST_INTERACTIVE OR COMPREHENSIVE_PLPLOT_TEST_NONINTERACTIVE)
|