Skip to content

Commit

Permalink
Respect DISABLE_PYTHON
Browse files Browse the repository at this point in the history
PYTHON_EXECUTABLE will always be true
  • Loading branch information
Jamie Snape committed Nov 23, 2016
1 parent d942e81 commit e98b0d5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ drake_add_external(drake LOCAL PUBLIC CMAKE ALWAYS TEST MATLAB PYTHON
BINARY_DIR ${PROJECT_BINARY_DIR}/drake
CMAKE_ARGS
-DDISABLE_MATLAB:BOOL=${DISABLE_MATLAB}
-DDISABLE_PYTHON:BOOL=${DISABLE_PYTHON}
-DWITH_AVL:BOOL=${WITH_AVL}
-DWITH_BOT_CORE_LCMTYPES:BOOL=${WITH_BOT_CORE_LCMTYPES}
-DWITH_BULLET:BOOL=${WITH_BULLET}
Expand Down
2 changes: 1 addition & 1 deletion drake/bindings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ find_program(SWIG_EXECUTABLE swig
PATHS ${CMAKE_INSTALL_PREFIX}/bin NO_DEFAULT_PATH)
if(SWIG_EXECUTABLE)
add_subdirectory(swig)
if(PYTHON_EXECUTABLE)
if(NOT DISABLE_PYTHON)
add_subdirectory(python)
endif()
add_subdirectory(matlab/test)
Expand Down
2 changes: 1 addition & 1 deletion drake/bindings/swig/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-misleading-indentation")
endif()

if(PYTHON_EXECUTABLE)
if(NOT DISABLE_PYTHON)
include(SwigPython)
set(python_install_subdir lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/dist-packages ${CMAKE_CURRENT_SOURCE_DIR}/../python)

Expand Down
14 changes: 12 additions & 2 deletions drake/lcmtypes/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
include(GenerateExportHeader)
include(${LCM_USE_FILE})

if(NOT DISABLE_PYTHON)
set(python_args PYTHON_SOURCES python_install_sources)
else()
set(python_args)
endif()

if(JAVA_FOUND)
set(java_args JAVA_SOURCES java_sources)
else()
set(java_args)
endif()

lcm_wrap_types(
C_EXPORT drake_lcmtypes
C_SOURCES c_sources
C_HEADERS c_install_headers
CPP_HEADERS cpp_install_headers
PYTHON_SOURCES python_install_sources
${java_args}
${python_args}
lcmt_body_acceleration.lcm
lcmt_body_motion_data.lcm
lcmt_body_wrench_data.lcm
Expand Down Expand Up @@ -84,7 +92,9 @@ install(TARGETS drake_lcmtypes drakeLCMTypes
INCLUDES DESTINATION "${DRAKE_INSTALL_INCLUDE_DIR}/lcmtypes"
)

lcm_install_python(${python_install_sources})
if(NOT DISABLE_PYTHON)
lcm_install_python(${python_install_sources})
endif()

if(JAVA_FOUND)
if(NOT TARGET lcm-java)
Expand Down

0 comments on commit e98b0d5

Please sign in to comment.