Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make build of rendering and studio modules optional #70

Merged
merged 2 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()
marip8 marked this conversation as resolved.
Show resolved Hide resolved

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)
6 changes: 0 additions & 6 deletions plot/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ find_package(
Xml
REQUIRED)
find_package(Qwt REQUIRED)
find_package(qtadvanceddocking REQUIRED)

# Load variable for clang tidy args, compiler options and cxx version
tesseract_variables()
Expand All @@ -17,15 +16,13 @@ qt5_wrap_ui(
PLOT_headers_UI
include/tesseract_qt/plot/plot_widget_editor.ui
include/tesseract_qt/plot/plot_widget_transforms.ui
include/tesseract_qt/plot/plot_docker_toolbar.ui
include/tesseract_qt/plot/transforms/first_derivative.ui
include/tesseract_qt/plot/transforms/integral_transform.ui
include/tesseract_qt/plot/transforms/moving_average_filter.ui
include/tesseract_qt/plot/transforms/moving_rms.ui
include/tesseract_qt/plot/transforms/outlier_removal.ui
include/tesseract_qt/plot/transforms/scale_transform.ui
include/tesseract_qt/plot/transforms/transform_selector.ui)

qt5_wrap_cpp(
PLOT_headers_MOC
include/tesseract_qt/plot/custom_tracker.h
Expand All @@ -36,7 +33,6 @@ qt5_wrap_cpp(
include/tesseract_qt/plot/plot_widget_editor.h
include/tesseract_qt/plot/plot_widget_transforms.h
include/tesseract_qt/plot/plot_zoomer.h
include/tesseract_qt/plot/plot_docker.h
include/tesseract_qt/plot/plot_subplots.h
include/tesseract_qt/plot/transform_function.h
include/tesseract_qt/plot/transforms/transform_selector.h)
Expand All @@ -54,7 +50,6 @@ add_library(
src/plot_widget_editor.cpp
src/plot_widget_transforms.cpp
src/plot_zoomer.cpp
src/plot_docker.cpp
src/plot_subplots.cpp
src/point_series_xy.cpp
src/timeseries_qwt.cpp
Expand All @@ -76,7 +71,6 @@ target_link_libraries(
Qt5::Xml
Qwt::Qwt
tesseract::tesseract_common
ads::qtadvanceddocking
${PROJECT_NAME}_common)
target_include_directories(
${PROJECT_NAME}_plot PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
Expand Down
12 changes: 1 addition & 11 deletions plot/demo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,10 @@ target_link_libraries(${PROJECT_NAME}_plot_demo PRIVATE ${PROJECT_NAME}_plot)
target_include_directories(${PROJECT_NAME}_plot_demo PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>")

add_executable(${PROJECT_NAME}_plot_docker_demo plot_docker_demo.cpp)
target_link_libraries(${PROJECT_NAME}_plot_docker_demo PRIVATE ${PROJECT_NAME}_plot)
target_include_directories(
${PROJECT_NAME}_plot_docker_demo PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>")

add_executable(${PROJECT_NAME}_plot_subplots_demo plot_subplots_demo.cpp)
target_link_libraries(${PROJECT_NAME}_plot_subplots_demo PRIVATE ${PROJECT_NAME}_plot)
target_include_directories(
${PROJECT_NAME}_plot_subplots_demo PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>")

install_targets(
TARGETS
${PROJECT_NAME}_plot_demo
${PROJECT_NAME}_plot_docker_demo
${PROJECT_NAME}_plot_subplots_demo)
install_targets(TARGETS ${PROJECT_NAME}_plot_demo ${PROJECT_NAME}_plot_subplots_demo)
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})
19 changes: 15 additions & 4 deletions studio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,17 @@ endif()
# Variable for task composer plugins
set(TESSERACT_STUDIO_PLUGINS "")

qt5_wrap_cpp(STUDIO_PLUGIN_FACTORY_headers_MOC include/tesseract_qt/studio/studio_dock_widget.h)
qt5_wrap_ui(STUDIO_PLUGIN_FACTORY_headers_UI include/tesseract_qt/studio/plot_docker_toolbar.ui)
qt5_wrap_cpp(STUDIO_PLUGIN_FACTORY_headers_MOC include/tesseract_qt/studio/studio_dock_widget.h
include/tesseract_qt/studio/plot_docker.h)

add_library(${PROJECT_NAME}_studio_plugin_factory ${STUDIO_PLUGIN_FACTORY_headers_MOC}
src/studio_dock_widget_factory.cpp src/studio_dock_widget.cpp)
add_library(
${PROJECT_NAME}_studio_plugin_factory
${STUDIO_PLUGIN_FACTORY_headers_UI}
${STUDIO_PLUGIN_FACTORY_headers_MOC}
src/studio_dock_widget_factory.cpp
src/studio_dock_widget.cpp
src/plot_docker.cpp)

target_link_libraries(
${PROJECT_NAME}_studio_plugin_factory
Expand All @@ -28,7 +35,8 @@ target_link_libraries(
Qt5::Gui
Qt5::Widgets
ads::qtadvanceddocking
${PROJECT_NAME}_common)
${PROJECT_NAME}_common
${PROJECT_NAME}_plot)
target_include_directories(
${PROJECT_NAME}_studio_plugin_factory
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>" "$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/studio>"
Expand Down Expand Up @@ -132,6 +140,9 @@ target_include_directories(
${PROJECT_NAME}_studio PRIVATE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/studio>" "$<INSTALL_INTERFACE:include>")

# Add the demo subdirectory
add_subdirectory(demo)

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

Expand Down
3 changes: 3 additions & 0 deletions studio/demo/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
add_executable(${PROJECT_NAME}_plot_docker_demo plot_docker_demo.cpp)
target_link_libraries(${PROJECT_NAME}_plot_docker_demo PRIVATE ${PROJECT_NAME}_studio_plugin_factory)
install_targets(TARGETS ${PROJECT_NAME}_plot_docker_demo)
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <QDebug>
TESSERACT_COMMON_IGNORE_WARNINGS_POP

#include <tesseract_qt/plot/plot_docker.h>
#include <tesseract_qt/studio/plot_docker.h>

int main(int argc, char** argv)
{
Expand Down
2 changes: 1 addition & 1 deletion plot/src/plot_docker.cpp → studio/src/plot_docker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <tesseract_qt/plot/plot_docker.h>
#include <tesseract_qt/studio/plot_docker.h>
#include <tesseract_qt/plot/plot_widget_editor.h>
#include <tesseract_qt/common/svg_util.h>
#include <DockSplitter.h>
Expand Down
Loading