Skip to content

Commit 4c09838

Browse files
authored
Merge pull request #70 from thewtex/macos-ci
ENH: Add macOS Azure Pipelines configuration
2 parents 75429e0 + 55eedda commit 4c09838

File tree

8 files changed

+63
-49
lines changed

8 files changed

+63
-49
lines changed

CMake/CTestCustom.cmake.in

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ set(CTEST_CUSTOM_COVERAGE_EXCLUDE
3636

3737
set(CTEST_CUSTOM_WARNING_EXCEPTION
3838
${CTEST_CUSTOM_WARNING_EXCEPTION}
39-
"ranlib:.*file:.*has no symbols"
40-
"ranlib: file: .+ has no symbols"
41-
"libtool:.*file:.*has no symbols"
39+
"has no symbols"
4240
"ipo: warning #11053"
4341
"ipo: warning #11053"
4442
"vxl.core.vnl.algo"

CMake/ITKExamplesMacros.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,10 @@ function(compare_to_baseline)
142142

143143
if(ITK_WRAP_PYTHON AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${LOCAL_COMPARISON_EXAMPLE_NAME}/Code.py")
144144
set(python_test_name ${test_name}Python)
145-
string(REPLACE . "Python." test_image "${test_image}")
145+
get_filename_component(test_image_we "${test_image}" NAME_WE)
146+
get_filename_component(test_image_dir "${test_image}" DIRECTORY)
147+
get_filename_component(test_image_ext "${test_image}" EXT)
148+
set(test_image "${test_image_dir}/${test_image_we}Python${test_image_ext}")
146149

147150
# Add the comparison for the Python test output
148151
# Use the same baseline image as for the c++ output

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ foreach(p
44
## version need to explicitly be set to NEW.
55
CMP0070 #3.10.0 Define ``file(GENERATE)`` behavior for relative paths.
66
CMP0071 #3.10.0 Let ``AUTOMOC`` and ``AUTOUIC`` process ``GENERATED`` files.
7+
CMP0074 #3.12.0 `find_package()`` uses ``<PackageName>_ROOT`` variables.
78
)
89
if(POLICY ${p})
910
cmake_policy(SET ${p} NEW)

Superbuild/External-ITK.cmake

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
#---------------------------------------------------------------------------
22
# Get and build itk
33

4-
if( NOT ITK_TAG )
5-
# 2018-08-13
6-
set( ITK_TAG "6b41fe1cbf7a71a6003d4824e02a69b41a508cda" )
4+
if(NOT ITK_TAG)
5+
# 2018-09-26
6+
set(ITK_TAG "b784f6355a88650f13345025ece292dd60a0d98c")
77
endif()
88

9-
set( _vtk_args )
10-
if( VTK_DIR OR ITKExamples_USE_VTK )
9+
set(_vtk_args)
10+
if(VTK_DIR OR ITKExamples_USE_VTK)
1111
set( _vtk_args "-DVTK_DIR:PATH=${VTK_DIR}"
1212
-DModule_ITKVtkGlue:BOOL=ON
1313
-DModule_ITKLevelSetsv4Visualization:BOOL=ON
1414
)
1515
else()
16-
set( _vtk_args
16+
set(_vtk_args
1717
-DModule_ITKVtkGlue:BOOL=OFF
1818
-DModule_ITKLevelSetsv4Visualization:BOOL=OFF
1919
)
2020
endif()
2121

22-
set( _opencv_args )
23-
if( OpenCV_DIR OR ITKExamples_USE_OpenCV )
22+
set(_opencv_args )
23+
if(OpenCV_DIR OR ITKExamples_USE_OpenCV)
2424
set( _opencv_args "-DOpenCV_DIR:PATH=${OpenCV_DIR}"
2525
-DModule_ITKVideoBridgeOpenCV:BOOL=ON
2626
)
2727
else()
28-
set( _opencv_args
28+
set(_opencv_args
2929
-DModule_ITKVideoBridgeOpenCV:BOOL=OFF
3030
)
3131
endif()
@@ -41,6 +41,13 @@ if(ITKExamples_USE_WRAP_PYTHON)
4141
)
4242
endif()
4343

44+
set(_apple_args)
45+
if(APPLE)
46+
set(_apple_args
47+
"-DBUILD_SHARED_LIBS:BOOL=ON"
48+
)
49+
endif()
50+
4451
ExternalProject_Add(ITK
4552
GIT_REPOSITORY "${git_protocol}://github.com/InsightSoftwareConsortium/ITK.git"
4653
GIT_TAG "${ITK_TAG}"
@@ -63,6 +70,7 @@ ExternalProject_Add(ITK
6370
${_vtk_args}
6471
${_opencv_args}
6572
${_wrap_python_args}
73+
${_apple_args}
6674
INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "ITK install skipped"
6775
DEPENDS ${ITK_DEPENDENCIES} ${_python_depends} zlib
6876
LOG_BUILD 0

Superbuild/External-Python.cmake

Lines changed: 10 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,15 @@
1-
#---------------------------------------------------------------------------
2-
# Get a Python with the itk package installed on Windows or create a
3-
# virtualenv to install the ITK package on Linux or Mac
1+
find_package(PythonInterp 3 REQUIRED)
42

3+
set(_itk_venv "${CMAKE_CURRENT_BINARY_DIR}/itkpython")
54
if(WIN32)
6-
# python.org 64 bit Windows Python with the itk and sphinx packages installed
7-
# Todo: needs update
8-
message(FATAL_ERROR "ITKExamples_USE_WRAP_PYTHON without PYTHON_EXECUTABLE set is currently not supported on Windows.")
9-
set(_itk_python_dir "${CMAKE_CURRENT_BINARY_DIR}/itkpython")
10-
set(ITKPYTHON_EXECUTABLE "${_itk_python_dir}/python.exe" CACHE FILEPATH "Python executable with the ITK package installed" FORCE)
11-
ExternalProject_Add(ITKPython
12-
URL "https://data.kitware.com/api/v1/file/58c760808d777f0aef5d798e/download"
13-
URL_MD5 "440580cec3b86903da26f0246637024f"
14-
DOWNLOAD_NAME itkpython.zip
15-
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}
16-
SOURCE_DIR ${_itk_python_dir}
17-
CONFIGURE_COMMAND ""
18-
BUILD_COMMAND ""
19-
INSTALL_COMMAND ""
20-
)
5+
set(ITKPYTHON_EXECUTABLE "${_itk_venv}/python.exe" CACHE FILEPATH "Python executable with the ITK package installed" FORCE)
216
else()
22-
find_package(PythonInterp REQUIRED)
23-
24-
set(_virtualenv_version 15.0.1)
25-
set(_virtualenv_SOURCE_DIR "virtualenv-${_virtualenv_version}")
26-
set(_virtualenv_script "${CMAKE_CURRENT_BINARY_DIR}/${_virtualenv_SOURCE_DIR}/virtualenv.py")
27-
set(_itk_venv "${CMAKE_CURRENT_BINARY_DIR}/itkpython")
287
set(ITKPYTHON_EXECUTABLE "${_itk_venv}/bin/python" CACHE FILEPATH "Python executable with the ITK package installed" FORCE)
29-
ExternalProject_Add(ITKPython
30-
URL "https://pypi.python.org/packages/source/v/virtualenv/virtualenv-${_virtualenv_version}.tar.gz"
31-
URL_MD5 "28d76a0d9cbd5dc42046dd14e76a6ecc"
32-
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}
33-
SOURCE_DIR ${_virtualenv_SOURCE_DIR}
34-
CONFIGURE_COMMAND ""
35-
BUILD_COMMAND ${PYTHON_EXECUTABLE} "${_virtualenv_script}" "${_itk_venv}"
36-
INSTALL_COMMAND ${ITKPYTHON_EXECUTABLE} -m pip install --pre itk sphinx
37-
)
388
endif()
9+
10+
ExternalProject_Add(ITKPython
11+
DOWNLOAD_COMMAND ""
12+
CONFIGURE_COMMAND ""
13+
BUILD_COMMAND ${PYTHON_EXECUTABLE} -m venv "${_itk_venv}"
14+
INSTALL_COMMAND ${ITKPYTHON_EXECUTABLE} -m pip install --pre itk sphinx
15+
)

Utilities/Testing/azure-pipelines.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,32 @@ jobs:
1515
1616
git clone -b dashboard --single-branch https://github.com/thewtex/ITKExamples.git ITKExamples-dashboard
1717
18+
sudo pip3 install ninja
19+
sudo apt-get install -y python3-venv
20+
21+
c++ --version
22+
cmake --version
23+
24+
ctest -S ITKExamples-dashboard/azure_dashboard.cmake -VV -j 4
25+
displayName: Build and Test
26+
workingDirectory: $(Agent.BuildDirectory)
27+
28+
- job: macOS
29+
timeoutInMinutes: 0
30+
cancelTimeoutInMinutes: 60
31+
pool:
32+
vmImage: 'macOS 10.13'
33+
steps:
34+
- script: |
35+
set -x
36+
37+
# Azure checkout submodules options does not currently work
38+
pushd $(Build.SourcesDirectory)
39+
git submodule update --init --recursive
40+
popd
41+
42+
git clone -b dashboard --single-branch https://github.com/thewtex/ITKExamples.git ITKExamples-dashboard
43+
1844
sudo pip3 install ninja
1945
2046
c++ --version

src/Filtering/Thresholding/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
add_example( ThresholdAnImageUsingOtsu )
2-
compare_to_baseline( EXAMPLE_NAME ThresholdAnImageUsingOtsu BASELINE_PREFIX OutputBaseline)
1+
# Temporarily disabled until Python packages are updated
2+
#add_example( ThresholdAnImageUsingOtsu )
3+
#compare_to_baseline( EXAMPLE_NAME ThresholdAnImageUsingOtsu BASELINE_PREFIX OutputBaseline)
34

45
add_example( ThresholdAnImageUsingBinary )
56
compare_to_baseline( EXAMPLE_NAME ThresholdAnImageUsingBinary BASELINE_PREFIX OutputBaseline)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
433ea07062a837358be08c86b4627a7938265cbdf9ae26eef6de40297d515204bb68e9f9f81572939c513c07b78f7e3382f8c0670ebcbe3b963b5cb2384e89d6
1+
2915aa065fc66a9fa1ce332341f4db4a1400a78a13fc875c801cc59fede564222fac00578681f68cb8705370c665696b659888939ce3cfff80eed17eba59a4b4

0 commit comments

Comments
 (0)