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 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188
|
# 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-2015 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
# agg website now (2014-04-13) a broken link, and this library only
# needed in any case for a purpose that may disappear (wxwidgets).
# So drop it.
#libagg
libharu
libqhull
shapelib
#wxwidgets
)
# For now only add in these dependencies for the Unix case because
# these epa_builds do not yet work on Windows.
if(NOT MSYS_PLATFORM)
list(APPEND dependencies_LIST
#pango
#qt5_lite
#libLASi
octave_lite
)
endif(NOT MSYS_PLATFORM)
# 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}")
set(cmake_args)
# Drop gtk+2-only dependencies since those clash (at build time for static
# device drivers and at run-time with dynamic device drivers) with
# gtk+3 that is used with epa_build.
list(APPEND cmake_args
-DDROP_GTK_PLUS_2_BUILDS=ON
)
# In addition turn off psttf (which depends on libLASi), wxwidgets, cairo, and qt for plplot_lite.
list(APPEND cmake_args
-DPLD_psttf=OFF
-DPLD_wxwidgets=OFF
-DENABLE_wxwidgets=OFF
-DDEFAULT_NO_CAIRO_DEVICES:BOOL=ON
-DDEFAULT_NO_QT_DEVICES:BOOL=ON
-DENABLE_qt=OFF
# Also turn off simple testing of dynamically loaded devices
# because on Windows sometimes the simple test fails (in the
# sense of giving the correct result while generating a
# non-zero return code for unknown reasons) but the
# actual dynload done by the PLplot library succeeds for some reason.
-DTEST_DYNDRIVERS=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)
|