Skip to content

Commit

Permalink
Made studio and rendering module builds optional
Browse files Browse the repository at this point in the history
  • Loading branch information
marip8 committed Aug 16, 2023
1 parent 5d05dd8 commit f7dd85d
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 27 deletions.
55 changes: 36 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ if(WIN32)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()

option(BUILD_RENDERING "Build the rendering module" ON)
option(BUILD_STUDIO "Build the studio module" ON)

add_subdirectory(common)
add_subdirectory(acm)
add_subdirectory(collision)
Expand All @@ -21,13 +24,43 @@ add_subdirectory(joint_trajectory)
add_subdirectory(kinematic_groups)
add_subdirectory(manipulation)
add_subdirectory(plot)
add_subdirectory(rendering)
add_subdirectory(scene_graph)
add_subdirectory(planning)
add_subdirectory(srdf)
add_subdirectory(tool_path)
add_subdirectory(workbench)
add_subdirectory(studio)

set(DEPS
"Qt5 COMPONENTS Core Gui Widgets Svg OpenGL Xml"
"Boost COMPONENTS program_options"
tesseract_environment
tesseract_kinematics
tesseract_scene_graph
tesseract_common
tesseract_support
tesseract_urdf
tesseract_srdf
tesseract_visualization
tesseract_command_language
tesseract_motion_planners
tesseract_task_composer)

if(${BUILD_RENDERING})
message("Building rendering module")
add_subdirectory(rendering)
list(
APPEND
DEPS
gz-rendering7
gz-math7-eigen3
"gz-common5 COMPONENTS profiler events av")
endif()

if(${BUILD_STUDIO} AND ${BUILD_RENDERING})
message("Building studio module")
add_subdirectory(studio)
list(APPEND DEPS qtadvanceddocking)
endif()

install(FILES "${CMAKE_CURRENT_LIST_DIR}/cmake/FindQwt.cmake" "${CMAKE_CURRENT_LIST_DIR}/cmake/FindGraphviz.cmake"
DESTINATION lib/cmake/${PROJECT_NAME})
Expand All @@ -37,22 +70,6 @@ install(FILES "${CMAKE_CURRENT_LIST_DIR}/cmake/tesseract_qt-extras.cmake" DESTIN
configure_package(
NAMESPACE tesseract
DEPENDENCIES
"Qt5 COMPONENTS Core Gui Widgets Svg OpenGL Xml"
"Boost COMPONENTS program_options"
tesseract_environment
tesseract_kinematics
tesseract_scene_graph
tesseract_common
tesseract_support
tesseract_urdf
tesseract_srdf
tesseract_visualization
tesseract_command_language
tesseract_motion_planners
tesseract_task_composer
qtadvanceddocking
gz-rendering7
gz-math7-eigen3
"gz-common5 COMPONENTS profiler events av"
${DEPS}
CFG_EXTRAS
tesseract_qt-extras.cmake)
22 changes: 14 additions & 8 deletions srdf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ tesseract_variables()
qt5_wrap_cpp(SRDF_EDITOR_WIDGET_headers_MOC include/tesseract_qt/srdf/srdf_editor_widget.h)
qt5_wrap_ui(SRDF_EDITOR_WIDGET_headers_UI include/tesseract_qt/srdf/srdf_editor_widget.ui)

set(SRDF_TARGETS ${PROJECT_NAME}_srdf)

add_library(${PROJECT_NAME}_srdf SHARED ${SRDF_EDITOR_WIDGET_headers_MOC} ${SRDF_EDITOR_WIDGET_headers_UI}
src/srdf_editor_widget.cpp)
target_link_libraries(
Expand All @@ -21,16 +23,20 @@ target_include_directories(
${PROJECT_NAME}_srdf PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/srdf>" "$<INSTALL_INTERFACE:include>")

add_executable(${PROJECT_NAME}_srdf_app src/srdf_editor_app.cpp)
target_link_libraries(
${PROJECT_NAME}_srdf_app
PRIVATE ${PROJECT_NAME}_srdf
${PROJECT_NAME}_render_widgets
${PROJECT_NAME}_environment_widgets
tesseract::tesseract_common)
if(${BUILD_RENDERING})
add_executable(${PROJECT_NAME}_srdf_app src/srdf_editor_app.cpp)
target_link_libraries(
${PROJECT_NAME}_srdf_app
PRIVATE ${PROJECT_NAME}_srdf
${PROJECT_NAME}_render_widgets
${PROJECT_NAME}_environment_widgets
tesseract::tesseract_common)

list(APPEND SRDF_TARGETS ${PROJECT_NAME}_srdf_app)
endif()

# Mark cpp header files for installation
install(DIRECTORY include/${PROJECT_NAME} DESTINATION include)

# Install
install_targets(TARGETS ${PROJECT_NAME}_srdf ${PROJECT_NAME}_srdf_app)
install_targets(TARGETS ${SRDF_TARGETS})

0 comments on commit f7dd85d

Please sign in to comment.