Move subdirlist macro to cmake/GtsamPythonWrap.cmake
Conflicts: cmake/GtsamPythonWrap.cmakerelease/4.3a0
parent
4f98ec889c
commit
ea6ecdd9d5
|
@ -347,12 +347,13 @@ endif()
|
||||||
|
|
||||||
# Python wrap
|
# Python wrap
|
||||||
if (GTSAM_BUILD_PYTHON)
|
if (GTSAM_BUILD_PYTHON)
|
||||||
|
include(GtsamPythonWrap)
|
||||||
|
|
||||||
# NOTE: The automatic generation of python wrapper from the gtsampy.h interface is
|
# NOTE: The automatic generation of python wrapper from the gtsampy.h interface is
|
||||||
# not working yet, so we're using a handwritten wrapper files on python/handwritten.
|
# not working yet, so we're using a handwritten wrapper files on python/handwritten.
|
||||||
# Once the python wrapping from the interface file is working, you can _swap_ the
|
# Once the python wrapping from the interface file is working, you can _swap_ the
|
||||||
# comments on the next lines
|
# comments on the next lines
|
||||||
|
|
||||||
# include(GtsamPythonWrap)
|
|
||||||
# wrap_and_install_python(gtsampy.h "${GTSAM_ADDITIONAL_LIBRARIES}" "")
|
# wrap_and_install_python(gtsampy.h "${GTSAM_ADDITIONAL_LIBRARIES}" "")
|
||||||
|
|
||||||
add_subdirectory(python)
|
add_subdirectory(python)
|
||||||
|
|
|
@ -87,3 +87,15 @@ function(wrap_python TARGET_NAME PYTHON_MODULE_DIRECTORY)
|
||||||
list(APPEND AMCF ${PYTHON_MODULE_DIRECTORY}/${PYLIB_SO_NAME})
|
list(APPEND AMCF ${PYTHON_MODULE_DIRECTORY}/${PYLIB_SO_NAME})
|
||||||
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${AMCF}")
|
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${AMCF}")
|
||||||
endfunction(wrap_python)
|
endfunction(wrap_python)
|
||||||
|
|
||||||
|
# Macro to get list of subdirectories
|
||||||
|
macro(SUBDIRLIST result curdir)
|
||||||
|
file(GLOB children RELATIVE ${curdir} ${curdir}/*)
|
||||||
|
set(dirlist "")
|
||||||
|
foreach(child ${children})
|
||||||
|
if(IS_DIRECTORY ${curdir}/${child})
|
||||||
|
list(APPEND dirlist ${child})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
set(${result} ${dirlist})
|
||||||
|
endmacro()
|
||||||
|
|
|
@ -1,24 +1,13 @@
|
||||||
# Macro to get list of subdirectories
|
|
||||||
MACRO(SUBDIRLIST result curdir)
|
|
||||||
FILE(GLOB children RELATIVE ${curdir} ${curdir}/*)
|
|
||||||
SET(dirlist "")
|
|
||||||
FOREACH(child ${children})
|
|
||||||
IF(IS_DIRECTORY ${curdir}/${child})
|
|
||||||
LIST(APPEND dirlist ${child})
|
|
||||||
ENDIF()
|
|
||||||
ENDFOREACH()
|
|
||||||
SET(${result} ${dirlist})
|
|
||||||
ENDMACRO()
|
|
||||||
|
|
||||||
# get subdirectories list
|
# get subdirectories list
|
||||||
SUBDIRLIST(SUBDIRS ${CMAKE_CURRENT_SOURCE_DIR})
|
subdirlist(SUBDIRS ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
# get the sources needed to compile gtsam python module
|
# get the sources needed to compile gtsam python module
|
||||||
SET(gtsam_python_srcs "")
|
set(gtsam_python_srcs "")
|
||||||
FOREACH(subdir ${SUBDIRS})
|
foreach(subdir ${SUBDIRS})
|
||||||
file(GLOB ${subdir}_src "${subdir}/*.cpp")
|
file(GLOB ${subdir}_src "${subdir}/*.cpp")
|
||||||
LIST(APPEND gtsam_python_srcs ${${subdir}_src})
|
list(APPEND gtsam_python_srcs ${${subdir}_src})
|
||||||
ENDFOREACH()
|
endforeach()
|
||||||
|
|
||||||
# Create the library
|
# Create the library
|
||||||
set(moduleName gtsam)
|
set(moduleName gtsam)
|
||||||
|
|
Loading…
Reference in New Issue