Skip to content

Commit f0254cc

Browse files
authored
Merge pull request #2429 from blowekamp/enable_language_tests
For tests fix check if language is enabled
2 parents f3fd5a1 + 9a24d73 commit f0254cc

5 files changed

Lines changed: 8 additions & 16 deletions

File tree

CMake/sitkAddTest.cmake

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ endfunction()
9696
# This is a function which set up the environment for executing python examples and tests
9797
#
9898
function(sitk_add_python_test name)
99-
if(NOT WRAP_PYTHON)
99+
if(NOT WRAP_PYTHON AND NOT CMAKE_PROJECT_NAME STREQUAL "SimpleITK_Python")
100100
return()
101101
endif()
102102

@@ -141,7 +141,7 @@ endfunction()
141141
# This is a function which set up the environment for executing python examples and tests
142142
#
143143
function(sitk_add_pytest_test name)
144-
if(NOT WRAP_PYTHON)
144+
if(NOT WRAP_PYTHON AND NOT CMAKE_PROJECT_NAME STREQUAL "SimpleITK_Python")
145145
return()
146146
endif()
147147

@@ -192,7 +192,7 @@ endfunction()
192192
# This is a function which set up the enviroment for executing lua examples and tests
193193
#
194194
function(sitk_add_lua_test name)
195-
if(NOT WRAP_LUA)
195+
if(NOT WRAP_LUA AND NOT CMAKE_PROJECT_NAME STREQUAL "SimpleITK_Lua")
196196
return()
197197
endif()
198198

@@ -235,7 +235,7 @@ endfunction()
235235
# This is a function which set up the enviroment for executing ruby examples and tests
236236
#
237237
function(sitk_add_ruby_test name)
238-
if(NOT WRAP_RUBY)
238+
if(NOT WRAP_RUBY AND NOT CMAKE_PROJECT_NAME STREQUAL "SimpleITK_Ruby")
239239
return()
240240
endif()
241241

@@ -278,7 +278,7 @@ endfunction()
278278
# This is a function which set up the enviroment for executing TCL examples and tests
279279
#
280280
function(sitk_add_tcl_test name)
281-
if(NOT WRAP_TCL)
281+
if(NOT WRAP_TCL AND NOT CMAKE_PROJECT_NAME STREQUAL "SimpleITK_Tcl")
282282
return()
283283
endif()
284284

@@ -313,7 +313,7 @@ endfunction()
313313
# This is a function which set up the enviroment for executing JAVA examples and tests
314314
#
315315
function(sitk_add_java_test name java_file)
316-
if(NOT WRAP_JAVA)
316+
if(NOT WRAP_JAVA AND NOT CMAKE_PROJECT_NAME STREQUAL "SimpleITK_Java")
317317
return()
318318
endif()
319319

@@ -383,7 +383,7 @@ endfunction()
383383
# This is a function which set up the enviroment for executing R examples and tests
384384
#
385385
function(sitk_add_r_test name)
386-
if(NOT WRAP_R)
386+
if(NOT WRAP_R AND NOT CMAKE_PROJECT_NAME STREQUAL "SimpleITK_R")
387387
return()
388388
endif()
389389

@@ -438,7 +438,7 @@ endfunction()
438438
# enviroment for executing CSharp examples and tests.
439439
#
440440
function(sitk_add_csharp_test name csharp_file)
441-
if(NOT WRAP_CSHARP)
441+
if(NOT WRAP_CSHARP AND NOT CMAKE_PROJECT_NAME STREQUAL "SimpleITK_CSharp")
442442
return()
443443
endif()
444444

Wrapping/CSharp/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,6 @@ add_dependencies(
219219
add_subdirectory(dist)
220220
221221
if(NOT CMAKE_PROJECT_NAME STREQUAL "SimpleITK" AND BUILD_TESTING)
222-
set(WRAP_CSHARP 1)
223-
224222
add_subdirectory(
225223
"${SimpleITK_SOURCE_DIR}/Testing/Unit/CSharp"
226224
"${CMAKE_BINARY_DIR}/Testing/Unit"

Wrapping/Java/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,6 @@ string(
138138
add_subdirectory(dist)
139139

140140
if(NOT CMAKE_PROJECT_NAME STREQUAL "SimpleITK" AND BUILD_TESTING)
141-
set(WRAP_JAVA 1)
142-
143141
add_subdirectory(
144142
"${SimpleITK_SOURCE_DIR}/Testing/Unit/Java"
145143
"${CMAKE_BINARY_DIR}/Testing/Unit"

Wrapping/Python/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,6 @@ if(BUILD_TESTING)
338338
endif()
339339

340340
if(NOT CMAKE_PROJECT_NAME STREQUAL "SimpleITK" AND BUILD_TESTING)
341-
set(WRAP_PYTHON 1)
342-
343341
if(BUILD_EXAMPLES)
344342
add_subdirectory(
345343
"${SimpleITK_SOURCE_DIR}/Examples"

Wrapping/R/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,6 @@ add_custom_command(
248248
)
249249

250250
if(NOT CMAKE_PROJECT_NAME STREQUAL "SimpleITK" AND BUILD_TESTING)
251-
set(WRAP_R 1)
252-
253251
add_subdirectory(
254252
"${SimpleITK_SOURCE_DIR}/Testing/Unit/R"
255253
"${CMAKE_BINARY_DIR}/Testing/Unit"

0 commit comments

Comments
 (0)