Commit f2517495 authored by Jacob Becker's avatar Jacob Becker

add a means to suppress third party build output in mac and linux

parent a6843c54
......@@ -16,6 +16,7 @@ set (CTEST_CUSTOM_WARNING_EXCEPTION
"/usr/bin/ranlib: file: .*/libtiff.a"
"/usr/bin/ranlib: warning for library: .*/libvil3d_io.a"
"/usr/bin/ranlib: warning for library: .*/libvimt_algo.a"
"src.*smtk.*ThirdParty"
"szip/src/szip"
"hdf5/src/hdf5"
......
......@@ -17,13 +17,16 @@ function(_PVExternalProject_Add_Win32 name)
set (arguments)
set (optional_depends)
set (accumulate TRUE)
set (suppress_output FALSE)
foreach(arg IN LISTS ARGN)
if ("${arg}" MATCHES "^PROCESS_ENVIRONMENT$")
set (accumulate FALSE)
elseif ("${arg}" MATCHES "${_ep_keywords_ExternalProject_Add}")
set (accumulate TRUE)
elseif ("${arg}" MATCHES SUPPRESS_BUILD_OUTPUT)
set (suppress_output TRUE)
endif()
if (accumulate)
if (accumulate AND NOT "${arg}" MATCHES SUPPRESS_BUILD_OUTPUT)
list(APPEND arguments "${arg}")
endif()
endforeach()
......@@ -31,6 +34,7 @@ function(_PVExternalProject_Add_Win32 name)
unset(arguments)
unset(optional_depends)
unset(accumulate)
unset(suppress_output)
endfunction()
function (PVExternalProject_Add name)
......@@ -44,12 +48,23 @@ function (PVExternalProject_Add name)
# just create a temporary target so we can set target properties.
add_custom_target(pv-${name})
_ep_parse_arguments(PVExternalProject_Add pv-${name} _EP_ "${ARGN}")
set( source )
set( suppress_output FALSE )
foreach(arg IN LISTS ARGN)
if ("${arg}" MATCHES SUPPRESS_BUILD_OUTPUT)
set (suppress_output TRUE)
else()
list(APPEND source "${arg}")
endif()
endforeach()
_ep_parse_arguments(PVExternalProject_Add pv-${name} _EP_ "${source}")
get_property(loc_TEMP TARGET pv-${name}
PROPERTY _EP_BUILD_IN_SOURCE)
get_property(has_process_environment TARGET pv-${name}
PROPERTY _EP_PROCESS_ENVIRONMENT SET)
if (NOT has_process_environment)
ExternalProject_Add(${name} "${ARGN}")
ExternalProject_Add(${name} "${source}")
return()
endif()
......@@ -78,6 +93,11 @@ function (PVExternalProject_Add name)
# check if we have a BUILD_COMMAND
get_property(has_build_command TARGET pv-${name}
PROPERTY _EP_BUILD_COMMAND SET)
if(suppress_output)
set(SUPPRESS_BUILD_OUTPUT TRUE)
else()
set(SUPPRESS_BUILD_OUTPUT FALSE)
endif()
if(has_build_command)
get_property(build_cmd TARGET pv-${name}
PROPERTY _EP_BUILD_COMMAND)
......@@ -135,7 +155,7 @@ function (PVExternalProject_Add name)
# now strip PROCESS_ENVIRONMENT from argments.
set (skip TRUE)
foreach(arg IN LISTS ARGN)
foreach(arg IN LISTS source)
if (arg MATCHES "${_ep_keywords_PVExternalProject_Add}")
if (arg MATCHES "^(PROCESS_ENVIRONMENT|BUILD_COMMAND|INSTALL_COMMAND|CONFIGURE_COMMAND)$")
set (skip FALSE)
......@@ -169,6 +189,7 @@ function (PVExternalProject_Add name)
if (has_build_command)
get_target_property(step_command pv-${name} _EP_BUILD_COMMAND)
_ep_replace_location_tags(${name} step_command)
set(process_suppress_output ${suppress_output})
configure_file(${SuperBuild_CMAKE_DIR}/pep_configure.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/pv-${name}-build.cmake
@ONLY)
......
set (environment "@process_environment@")
set (command @step_command@)
set (suppress_output @process_suppress_output@)
set (key)
foreach (arg IN ITEMS ${environment})
......@@ -19,8 +20,18 @@ foreach (arg IN ITEMS ${environment})
endif()
endforeach()
execute_process(COMMAND ${command}
RESULT_VARIABLE rv)
if(suppress_output)
message("Start suppressing output for ${command}")
execute_process(COMMAND ${command}
OUTPUT_QUIET
ERROR_QUIET
RESULT_VARIABLE rv)
message("Done suppressing output for ${command}")
else()
execute_process(COMMAND ${command}
RESULT_VARIABLE rv)
endif()
if (NOT "${rv}" STREQUAL "0")
message(FATAL_ERROR "Failed!!!")
......
......@@ -19,12 +19,24 @@ endif()
string(REPLACE " " "\\ " boost_build_dir ${SuperBuild_BINARY_DIR}/boost/src/boost)
string(REPLACE " " "\\ " boost_install_dir ${install_location})
option(SUPPRESS_BOOST_BUILD_OUTPUT
"Suppress boost build output"
ON)
mark_as_advanced(SUPPRESS_BOOST_BUILD_OUTPUT)
set(suppress_build_out)
if(SUPPRESS_BOOST_BUILD_OUTPUT)
set(suppress_build_out SUPPRESS_BUILD_OUTPUT)
endif()
add_external_project(boost
DEPENDS zlib
CONFIGURE_COMMAND ./bootstrap.sh ${boost_toolset} --prefix=${boost_install_dir}
BUILD_COMMAND ./b2 ${boost_toolset} ${boost_lib} --build-dir=${boost_build_dir} address-model=${am} ${boost_with_args}
INSTALL_COMMAND ./b2 ${boost_toolset} ${boost_lib} address-model=${am} ${boost_with_args} install
BUILD_IN_SOURCE 1
${suppress_build_out}
)
add_extra_cmake_args(
......
option(SUPPRESS_GDAL_BUILD_OUTPUT
"Suppress GDAL build output"
ON)
mark_as_advanced(SUPPRESS_GDAL_BUILD_OUTPUT)
set(suppress_build_out)
if(SUPPRESS_GDAL_BUILD_OUTPUT)
set(suppress_build_out SUPPRESS_BUILD_OUTPUT)
endif()
add_external_project(gdal
# apple gdal doesn't install properly, so we have to patch the cmake lists
......@@ -7,4 +16,5 @@ add_external_project(gdal
<SOURCE_DIR>/CMakeLists.txt
CMAKE_ARGS
${ignore_cmake_commandline_warning_option}
${suppress_build_out}
)
......@@ -34,4 +34,5 @@ file(GLOB fixedUpLibs "${TMP_DIR}/SMTKPlugin/*")
foreach(lib ${fixedUpLibs})
message(STATUS "instaling plugin: ${lib}")
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${lib} ${plugin_install_dir})
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${lib} ${SMTK_BIN_DIR}/python)
endforeach()
\ No newline at end of file
option(SUPPRESS_MOLEQUEUE_BUILD_OUTPUT
"Suppress Molequeue build output"
ON)
mark_as_advanced(SUPPRESS_MOLEQUEUE_BUILD_OUTPUT)
set(suppress_build_out)
if(SUPPRESS_MOLEQUEUE_BUILD_OUTPUT)
set(suppress_build_out SUPPRESS_BUILD_OUTPUT)
endif()
add_external_project(molequeue
DEPENDS qt
CMAKE_ARGS
-DBUILD_SHARED_LIBS:BOOL=ON
-DENABLE_TESTING:BOOL=OFF
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
${suppress_build_out}
)
option(SUPPRESS_SHIBOKEN_BUILD_OUTPUT
"Suppress SHIBOKEN build output"
ON)
mark_as_advanced(SUPPRESS_SHIBOKEN_BUILD_OUTPUT)
set(suppress_build_out)
if(SUPPRESS_SHIBOKEN_BUILD_OUTPUT)
set(suppress_build_out SUPPRESS_BUILD_OUTPUT)
endif()
add_external_project(shiboken
DEPENDS qt python
CMAKE_ARGS
${ignore_cmake_commandline_warning_option}
-DDISABLE_DOCSTRINGS:BOOL=ON
${suppress_build_out}
)
......@@ -5,6 +5,17 @@ else()
set(am 32)
endif()
option(SUPPRESS_BOOST_BUILD_OUTPUT
"Suppress boost build output"
ON)
mark_as_advanced(SUPPRESS_BOOST_BUILD_OUTPUT)
set(suppress_build_out)
if(SUPPRESS_BOOST_BUILD_OUTPUT)
set(suppress_build_out SUPPRESS_BUILD_OUTPUT)
endif()
set(boost_with_args --with-date_time --with-filesystem --with-system --with-thread)
#since we don't specify a prefix for the superbuild,
......@@ -20,6 +31,7 @@ add_external_project(boost
BUILD_COMMAND ./b2 --build-dir=${boost_build_dir} address-model=${am} ${boost_with_args}
INSTALL_COMMAND ./b2 address-model=${am} ${boost_with_args} install
BUILD_IN_SOURCE 1
${suppress_build_out}
)
add_extra_cmake_args(
......
option(SUPPRESS_GDAL_BUILD_OUTPUT
"Suppress GDAL build output"
ON)
mark_as_advanced(SUPPRESS_GDAL_BUILD_OUTPUT)
set(suppress_build_out)
if(SUPPRESS_GDAL_BUILD_OUTPUT)
set(suppress_build_out SUPPRESS_BUILD_OUTPUT)
endif()
add_external_project(gdal
CMAKE_ARGS
${ignore_cmake_commandline_warning_option}
${suppress_build_out}
)
option(SUPPRESS_HDF5_BUILD_OUTPUT
"Suppress HDF5 build output"
ON)
mark_as_advanced(SUPPRESS_HDF5_BUILD_OUTPUT)
set(suppress_build_out)
if(SUPPRESS_HDF5_BUILD_OUTPUT)
set(suppress_build_out SUPPRESS_BUILD_OUTPUT)
endif()
add_external_project(
hdf5
......@@ -17,4 +27,5 @@ add_external_project(
-DHDF5_ENABLE_SZIP_ENCODING:BOOL=TRUE
-DHDF5_BUILD_HL_LIB:BOOL=TRUE
-DHDF5_BUILD_WITH_INSTALL_NAME:BOOL=TRUE
${suppress_build_out}
)
option(SUPPRESS_KML_BUILD_OUTPUT
"Suppress KML build output"
ON)
mark_as_advanced(SUPPRESS_KML_BUILD_OUTPUT)
set(suppress_build_out)
if(SUPPRESS_KML_BUILD_OUTPUT)
set(suppress_build_out SUPPRESS_BUILD_OUTPUT)
endif()
add_external_project(kml
# kml has problems with newer gcc compilers with not including unistd.h
......@@ -8,4 +17,5 @@ add_external_project(kml
CMAKE_ARGS
-DBUILD_SHARED_LIBS=OFF
${ignore_cmake_commandline_warning_option}
${suppress_build_out}
)
......@@ -5,11 +5,24 @@ if (WIN32)
set (_install_location "../../../install")
endif()
option(SUPPRESS_NUMPY_BUILD_OUTPUT
"Suppress numpy build output"
ON)
mark_as_advanced(SUPPRESS_NUMPY_BUILD_OUTPUT)
set(suppress_build_out)
if(SUPPRESS_NUMPY_BUILD_OUTPUT)
set(suppress_build_out SUPPRESS_BUILD_OUTPUT)
endif()
add_external_project(numpy
DEPENDS python
CONFIGURE_COMMAND ""
INSTALL_COMMAND ""
BUILD_IN_SOURCE 1
${suppress_build_out}
SUPPRESS_BUILD_OUTPUT
BUILD_COMMAND
${pv_python_executable} setup.py install --prefix=${_install_location}
)
option(SUPPRESS_PNG_BUILD_OUTPUT
"Suppress PNG build output"
ON)
mark_as_advanced(SUPPRESS_PNG_BUILD_OUTPUT)
set(suppress_build_out)
if(SUPPRESS_PNG_BUILD_OUTPUT)
set(suppress_build_out SUPPRESS_BUILD_OUTPUT)
endif()
add_external_project(png
DEPENDS zlib
......@@ -10,4 +21,5 @@ add_external_project(png
# work right for debug mode (libpng.{so,a} points to libpng14.{so,a}
# instead of libpng14d.{so,a}).
-DCMAKE_BUILD_TYPE:STRING=Release
${suppress_build_out}
)
......@@ -2,6 +2,17 @@ if (APPLE)
message(FATAL_ERROR "ABORT")
endif()
option(SUPPRESS_PYTHON_BUILD_OUTPUT
"Suppress Python build output"
ON)
mark_as_advanced(SUPPRESS_PYTHON_BUILD_OUTPUT)
set(suppress_build_out)
if(SUPPRESS_PYTHON_BUILD_OUTPUT)
set(suppress_build_out SUPPRESS_BUILD_OUTPUT)
endif()
set(libtype "--enable-shared")
if (CROSS_BUILD_STAGE STREQUAL "TOOLS")
set(libtype "--enable-static --disable-shared")
......@@ -13,5 +24,6 @@ add_external_project_or_use_system(python
--prefix=<INSTALL_DIR>
--enable-unicode
${libtype}
${suppress_build_out}
)
set (pv_python_executable "${install_location}/bin/python" CACHE INTERNAL "" FORCE)
option(SUPPRESS_SHIBOKEN_BUILD_OUTPUT
"Suppress SHIBOKEN build output"
ON)
mark_as_advanced(SUPPRESS_SHIBOKEN_BUILD_OUTPUT)
set(suppress_build_out)
if(SUPPRESS_SHIBOKEN_BUILD_OUTPUT)
set(suppress_build_out SUPPRESS_BUILD_OUTPUT)
endif()
add_external_project(shiboken
DEPENDS qt python
......@@ -7,4 +17,5 @@ add_external_project(shiboken
-DSET_RPATH:BOOL=ON
-DBUILD_SHARED_LIBS:BOOL=ON
-DDISABLE_DOCSTRINGS:BOOL=ON
${suppress_build_out}
)
option(SUPPRESS_SZIP_BUILD_OUTPUT
"Suppress SZIP build output"
ON)
mark_as_advanced(SUPPRESS_SZIP_BUILD_OUTPUT)
set(suppress_build_out)
if(SUPPRESS_SZIP_BUILD_OUTPUT)
set(suppress_build_out SUPPRESS_BUILD_OUTPUT)
endif()
add_external_project(szip
CONFIGURE_COMMAND <SOURCE_DIR>/configure
--enable-encoding
--prefix=<INSTALL_DIR>
${suppress_build_out}
)
# any project depending on szip, inherits these cmake variables
......
option(SUPPRESS_NUMPY_BUILD_OUTPUT
"Suppress numpy build output"
ON)
mark_as_advanced(SUPPRESS_NUMPY_BUILD_OUTPUT)
set(suppress_build_out)
if(SUPPRESS_NUMPY_BUILD_OUTPUT)
set(suppress_build_out SUPPRESS_BUILD_OUTPUT)
endif()
add_external_project_or_use_system(numpy
DEPENDS python
CONFIGURE_COMMAND ""
INSTALL_COMMAND ""
BUILD_IN_SOURCE 1
${suppress_build_out}
BUILD_COMMAND
${pv_python_executable} setup.py install --prefix=<INSTALL_DIR>
)
option(SUPPRESS_VXL_BUILD_OUTPUT
"Suppress VXL build output"
ON)
mark_as_advanced(SUPPRESS_VXL_BUILD_OUTPUT)
set(suppress_build_out)
if(SUPPRESS_VXL_BUILD_OUTPUT)
set(suppress_build_out SUPPRESS_BUILD_OUTPUT)
endif()
add_external_project(vxl
DEPENDS png
......@@ -35,4 +45,5 @@ add_external_project(vxl
-DBUILD_UNMAINTAINED_LIBRARIES=OFF
-DBUILD_VGUI=OFF
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
${suppress_build_out}
)
option(SUPPRESS_ZEROMQ_BUILD_OUTPUT
"Suppress ZeroMQ build output"
ON)
mark_as_advanced(SUPPRESS_ZEROMQ_BUILD_OUTPUT)
set(suppress_build_out)
if(SUPPRESS_ZEROMQ_BUILD_OUTPUT)
set(suppress_build_out SUPPRESS_BUILD_OUTPUT)
endif()
add_external_project(zeroMQ
CONFIGURE_COMMAND <SOURCE_DIR>/configure
......@@ -5,4 +15,5 @@ add_external_project(zeroMQ
--disable-static
--prefix=<INSTALL_DIR>
BUILD_IN_SOURCE 1
${suppress_build_out}
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment