Improved paths and added checks
parent
cb151dd9ee
commit
e08e392020
|
@ -41,7 +41,7 @@ execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c"
|
||||||
function(wrap_and_install_library_cython interface_header extra_imports install_path libs dependencies)
|
function(wrap_and_install_library_cython interface_header extra_imports install_path libs dependencies)
|
||||||
# Paths for generated files
|
# Paths for generated files
|
||||||
get_filename_component(module_name "${interface_header}" NAME_WE)
|
get_filename_component(module_name "${interface_header}" NAME_WE)
|
||||||
set(generated_files_path "${GTSAM_CYTHON_INSTALL_PATH}/${module_name}")
|
set(generated_files_path "${install_path}")
|
||||||
wrap_library_cython("${interface_header}" "${generated_files_path}" "${extra_imports}" "${libs}" "${dependencies}")
|
wrap_library_cython("${interface_header}" "${generated_files_path}" "${extra_imports}" "${libs}" "${dependencies}")
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
@ -138,7 +138,9 @@ function(cythonize target pyx_file output_lib_we output_dir include_dirs libs in
|
||||||
endif()
|
endif()
|
||||||
add_dependencies(${target} ${target}_pyx2cpp)
|
add_dependencies(${target} ${target}_pyx2cpp)
|
||||||
|
|
||||||
|
if(TARGET ${python_install_target})
|
||||||
add_dependencies(${python_install_target} ${target})
|
add_dependencies(${python_install_target} ${target})
|
||||||
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
# Internal function that wraps a library and compiles the wrapper
|
# Internal function that wraps a library and compiles the wrapper
|
||||||
|
@ -151,9 +153,12 @@ function(wrap_library_cython interface_header generated_files_path extra_imports
|
||||||
get_filename_component(module_name "${interface_header}" NAME_WE)
|
get_filename_component(module_name "${interface_header}" NAME_WE)
|
||||||
|
|
||||||
# Wrap module to Cython pyx
|
# Wrap module to Cython pyx
|
||||||
message(STATUS "Cython wrapper generating ${module_name}.pyx")
|
message(STATUS "Cython wrapper generating ${generated_files_path}/${module_name}.pyx")
|
||||||
set(generated_pyx "${generated_files_path}/${module_name}.pyx")
|
set(generated_pyx "${generated_files_path}/${module_name}.pyx")
|
||||||
|
if(NOT EXISTS ${generated_files_path})
|
||||||
file(MAKE_DIRECTORY "${generated_files_path}")
|
file(MAKE_DIRECTORY "${generated_files_path}")
|
||||||
|
endif()
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${generated_pyx}
|
OUTPUT ${generated_pyx}
|
||||||
DEPENDS ${interface_header} wrap
|
DEPENDS ${interface_header} wrap
|
||||||
|
|
|
@ -37,4 +37,6 @@ add_dependencies(cythonize_eigency_core cythonize_eigency_conversions)
|
||||||
add_custom_target(cythonize_eigency)
|
add_custom_target(cythonize_eigency)
|
||||||
add_dependencies(cythonize_eigency cythonize_eigency_conversions cythonize_eigency_core)
|
add_dependencies(cythonize_eigency cythonize_eigency_conversions cythonize_eigency_core)
|
||||||
|
|
||||||
|
if(TARGET ${python_install_target})
|
||||||
add_dependencies(${python_install_target} cythonize_eigency)
|
add_dependencies(${python_install_target} cythonize_eigency)
|
||||||
|
endif()
|
||||||
|
|
Loading…
Reference in New Issue