Move subdirlist macro to cmake/GtsamPythonWrap.cmake
Conflicts: cmake/GtsamPythonWrap.cmakerelease/4.3a0
parent
4f98ec889c
commit
ea6ecdd9d5
|
@ -347,12 +347,13 @@ endif()
|
|||
|
||||
# Python wrap
|
||||
if (GTSAM_BUILD_PYTHON)
|
||||
include(GtsamPythonWrap)
|
||||
|
||||
# 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.
|
||||
# Once the python wrapping from the interface file is working, you can _swap_ the
|
||||
# comments on the next lines
|
||||
|
||||
# include(GtsamPythonWrap)
|
||||
# wrap_and_install_python(gtsampy.h "${GTSAM_ADDITIONAL_LIBRARIES}" "")
|
||||
|
||||
add_subdirectory(python)
|
||||
|
|
|
@ -87,3 +87,15 @@ function(wrap_python TARGET_NAME PYTHON_MODULE_DIRECTORY)
|
|||
list(APPEND AMCF ${PYTHON_MODULE_DIRECTORY}/${PYLIB_SO_NAME})
|
||||
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${AMCF}")
|
||||
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
|
||||
SUBDIRLIST(SUBDIRS ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
subdirlist(SUBDIRS ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
# get the sources needed to compile gtsam python module
|
||||
SET(gtsam_python_srcs "")
|
||||
FOREACH(subdir ${SUBDIRS})
|
||||
set(gtsam_python_srcs "")
|
||||
foreach(subdir ${SUBDIRS})
|
||||
file(GLOB ${subdir}_src "${subdir}/*.cpp")
|
||||
LIST(APPEND gtsam_python_srcs ${${subdir}_src})
|
||||
ENDFOREACH()
|
||||
list(APPEND gtsam_python_srcs ${${subdir}_src})
|
||||
endforeach()
|
||||
|
||||
# Create the library
|
||||
set(moduleName gtsam)
|
||||
|
|
Loading…
Reference in New Issue