Fix python import check
for when target name is not the same as the output base nameLT1AB
parent
e9ccc6857a
commit
52951b5a5f
|
|
@ -32,9 +32,10 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_LIST_DIR}")
|
||||||
# override this to also test the resulting extension
|
# override this to also test the resulting extension
|
||||||
function(Python_add_library target)
|
function(Python_add_library target)
|
||||||
_Python_add_library(${target} ${ARGN})
|
_Python_add_library(${target} ${ARGN})
|
||||||
|
set(name "$<TARGET_PROPERTY:${target},OUTPUT_NAME>")
|
||||||
add_test(NAME import_${target}
|
add_test(NAME import_${target}
|
||||||
COMMAND ${Python_EXECUTABLE} -c
|
COMMAND ${Python_EXECUTABLE} -c
|
||||||
"import ${target}"
|
"import $<IF:$<BOOL:${name}>,${name},${target}>"
|
||||||
)
|
)
|
||||||
endfunction()
|
endfunction()
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue