Skip to content

Commit

Permalink
Rename a few CMake variables for coherence
Browse files Browse the repository at this point in the history
CREATE_LIB_MATH -> YARP_COMPILE_libYARP_math
CREATE_GUIS -> YARP_COMPILE_GUIS
CREATE_<EXE> -> YARP_COMPILE_<exe>
  • Loading branch information
drdanz committed Mar 26, 2019
1 parent ded06fa commit 32781cd
Show file tree
Hide file tree
Showing 18 changed files with 93 additions and 62 deletions.
119 changes: 75 additions & 44 deletions cmake/YarpFindDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -413,33 +413,64 @@ if(SKIP_ACE)
unset(YARP_HAS_ACE) # Not set = disabled
endif()

option(CREATE_LIB_MATH "Create math library libYARP_math?" ${YARP_HAS_EIGEN3})
cmake_dependent_option(CREATE_YARPROBOTINTERFACE "Do you want to compile yarprobotinterface?" ON YARP_COMPILE_EXECUTABLES OFF)
cmake_dependent_option(CREATE_YARPMANAGER_CONSOLE "Do you want to compile YARP Module Manager (console)?" ON YARP_COMPILE_EXECUTABLES OFF)
cmake_dependent_option(CREATE_YARPDATADUMPER "Do you want to compile yarpdatadumper?" ON YARP_COMPILE_EXECUTABLES OFF)
cmake_dependent_option(CREATE_GUIS "Do you want to compile GUIs" OFF YARP_COMPILE_EXECUTABLES OFF)
cmake_dependent_option(CREATE_YARPVIEW "Do you want to compile yarpview?" ON CREATE_GUIS OFF)
cmake_dependent_option(CREATE_YARPMANAGER "Do you want to compile yarpmanager?" ON CREATE_GUIS OFF)
cmake_dependent_option(CREATE_YARPLOGGER "Do you want to create yarplogger?" ON CREATE_GUIS OFF)
cmake_dependent_option(CREATE_YARPSCOPE "Do you want to create yarpscope?" ON CREATE_GUIS OFF)
cmake_dependent_option(CREATE_YARPDATAPLAYER "Do you want to compile yarpdataplayer?" ON CREATE_GUIS OFF)
cmake_dependent_option(CREATE_YARPMOTORGUI "Do you want to compile yarpmotorgui?" ON CREATE_GUIS OFF)
cmake_dependent_option(CREATE_YARPLASERSCANNERGUI "Do you want to compile yarplaserscannergui?" OFF CREATE_GUIS OFF)
cmake_dependent_option(CREATE_YARPBATTERYGUI "Do you want to compile yarpbatterygui?" OFF CREATE_GUIS OFF)
cmake_dependent_option(CREATE_YARPVIZ "Do you want to compile yarpviz?" OFF CREATE_GUIS OFF)

if(CREATE_YARPMANAGER_CONSOLE OR CREATE_YARPMANAGER)
set(CREATE_LIB_MANAGER ON CACHE INTERNAL "Create manager library libYARP_manager?")
else()
unset(CREATE_LIB_MANAGER CACHE)
option(YARP_COMPILE_libYARP_math "Create math library libYARP_math?" ${YARP_HAS_Eigen3})
yarp_renamed_option(CREATE_LIB_MATH YARP_COMPILE_libYARP_math) # Deprecated since YARP 3.2

cmake_dependent_option(YARP_COMPILE_GUIS "Do you want to compile GUIs" ${YARP_HAS_Qt5} YARP_COMPILE_EXECUTABLES OFF)
yarp_renamed_option(CREATE_GUIS YARP_COMPILE_GUIS) # Deprecated since YARP 3.2

cmake_dependent_option(YARP_COMPILE_yarprobotinterface "Do you want to compile yarprobotinterface?" ON YARP_COMPILE_EXECUTABLES OFF)
cmake_dependent_option(YARP_COMPILE_yarpmanager-console "Do you want to compile YARP Module Manager (console)?" ON YARP_COMPILE_EXECUTABLES OFF)
cmake_dependent_option(YARP_COMPILE_yarpdatadumper "Do you want to compile yarpdatadumper?" ON YARP_COMPILE_EXECUTABLES OFF)
cmake_dependent_option(YARP_COMPILE_yarpview "Do you want to compile yarpview?" ON YARP_COMPILE_GUIS OFF)
cmake_dependent_option(YARP_COMPILE_yarpmanager "Do you want to compile yarpmanager?" ON YARP_COMPILE_GUIS OFF)
cmake_dependent_option(YARP_COMPILE_yarplogger "Do you want to create yarplogger?" ON YARP_COMPILE_GUIS OFF)
cmake_dependent_option(YARP_COMPILE_yarpscope "Do you want to create yarpscope?" ON YARP_COMPILE_GUIS OFF)
cmake_dependent_option(YARP_COMPILE_yarpdataplayer "Do you want to compile yarpdataplayer?" ON YARP_COMPILE_GUIS OFF)
cmake_dependent_option(YARP_COMPILE_yarpmotorgui "Do you want to compile yarpmotorgui?" ON YARP_COMPILE_GUIS OFF)
cmake_dependent_option(YARP_COMPILE_yarplaserscannergui "Do you want to compile yarplaserscannergui?" OFF YARP_COMPILE_GUIS OFF)
cmake_dependent_option(YARP_COMPILE_yarpbatterygui "Do you want to compile yarpbatterygui?" OFF YARP_COMPILE_GUIS OFF)
cmake_dependent_option(YARP_COMPILE_yarpviz "Do you want to compile yarpviz?" OFF YARP_COMPILE_GUIS OFF)

yarp_renamed_option(CREATE_YARPROBOTINTERFACE YARP_COMPILE_yarprobotinterface) # Deprecated since YARP 3.2
yarp_renamed_option(CREATE_YARPMANAGER_CONSOLE YARP_COMPILE_yarpmanager-console) # Deprecated since YARP 3.2
yarp_renamed_option(CREATE_YARPDATADUMPER YARP_COMPILE_yarpdatadumper) # Deprecated since YARP 3.2
yarp_renamed_option(CREATE_YARPVIEW YARP_COMPILE_yarpview) # Deprecated since YARP 3.2
yarp_renamed_option(CREATE_YARPMANAGER YARP_COMPILE_yarpmanager) # Deprecated since YARP 3.2
yarp_renamed_option(CREATE_YARPLOGGER YARP_COMPILE_yarplogger) # Deprecated since YARP 3.2
yarp_renamed_option(CREATE_YARPSCOPE YARP_COMPILE_yarpscope) # Deprecated since YARP 3.2
yarp_renamed_option(CREATE_YARPDATAPLAYER YARP_COMPILE_yarpdataplayer) # Deprecated since YARP 3.2
yarp_renamed_option(CREATE_YARPMOTORGUI YARP_COMPILE_yarpmotorgui) # Deprecated since YARP 3.2
yarp_renamed_option(CREATE_YARPLASERSCANNERGUI YARP_COMPILE_yarplaserscannergui) # Deprecated since YARP 3.2
yarp_renamed_option(CREATE_YARPBATTERYGUI YARP_COMPILE_yarpbatterygui) # Deprecated since YARP 3.2
yarp_renamed_option(CREATE_YARPVIZ YARP_COMPILE_yarpviz) # Deprecated since YARP 3.2


################################################################################
# Disable some parts if they are not required

if(YARP_COMPILE_yarpmanager-console OR YARP_COMPILE_yarpmanager)
set(YARP_COMPILE_libYARP_manager ON)
endif()

if(CREATE_YARPVIZ OR CREATE_YARPMANAGER)
set(CREATE_LIB_PROFILER ON CACHE INTERNAL "Create profiler library libYARP_profiler?")
else()
unset(CREATE_LIB_PROFILER CACHE)
if(YARP_COMPILE_yarpviz OR YARP_COMPILE_yarpmanager)
set(YARP_COMPILE_libYARP_profiler ON)
endif()

if(NOT YARP_COMPILE_yarprobotinterface OR NOT YARP_COMPILE_yarpscope OR NOT YARP_COMPILE_libYARP_manager)
set(YARP_BUILD_TinyXML FALSE)
unset(YARP_HAS_TinyXML)
endif()

if(NOT YARP_COMPILE_yarpviz)
set(YARP_BUILD_QGVCore FALSE)
unset(YARP_HAS_QGVCore)
endif()

if(NOT YARP_COMPILE_yarpscope)
set(YARP_BUILD_QCustomPlot FALSE)
unset(YARP_HAS_QCustomPlot)
endif()

################################################################################
# Print dependencies status
Expand Down Expand Up @@ -492,13 +523,13 @@ print_dependency(I2C)
check_skip_dependency(SKIP_ACE ACE)
check_required_dependency(hmac)
check_required_dependency(SQLite)
check_optional_dependency(CREATE_LIB_MATH Eigen3)
check_optional_dependency(CREATE_LIB_MANAGER TinyXML)
check_optional_dependency(CREATE_YARPSCOPE TinyXML)
check_optional_dependency(CREATE_GUIS Qt5)
check_optional_dependency(CREATE_YARPSCOPE QCustomPlot)
check_optional_dependency(CREATE_YARPLASERSCANNERGUI OpenCV)
check_optional_dependency(CREATE_YARPVIZ Graphviz)
check_optional_dependency(YARP_COMPILE_libYARP_math Eigen3)
check_optional_dependency(YARP_COMPILE_libYARP_manager TinyXML)
check_optional_dependency(YARP_COMPILE_yarpscope TinyXML)
check_optional_dependency(YARP_COMPILE_GUIS Qt5)
check_optional_dependency(YARP_COMPILE_yarpscope QCustomPlot)
check_optional_dependency(YARP_COMPILE_yarplaserscannergui OpenCV)
check_optional_dependency(YARP_COMPILE_yarpviz Graphviz)
check_optional_dependency(YARP_COMPILE_BINDINGS SWIG)
check_optional_dependency(YARP_COMPILE_RTF_ADDONS RTF)

Expand All @@ -513,22 +544,22 @@ yarp_print_feature(SKIP_ACE 0 "Disable ACE library")
yarp_print_feature(YARP_NO_DEPRECATED 0 "Filter out deprecated declarations from YARP API")
yarp_print_feature(YARP_NO_DEPRECATED_WARNINGS 1 "Do not warn when using YARP deprecated declarations")

yarp_print_feature(CREATE_LIB_MATH 0 "Compile YARP_math library")
yarp_print_feature(YARP_COMPILE_libYARP_math 0 "Compile YARP_math library")

yarp_print_feature(YARP_COMPILE_EXECUTABLES 0 "Compile executables")
yarp_print_feature(CREATE_YARPROBOTINTERFACE 1 "Compile yarprobotinterface")
yarp_print_feature(CREATE_YARPMANAGER_CONSOLE 1 "Compile YARP Module Manager (console)")
yarp_print_feature(CREATE_YARPDATADUMPER 1 "Compile yarpdatadumper")
yarp_print_feature(CREATE_GUIS 1 "Compile GUIs")
yarp_print_feature(CREATE_YARPVIEW 2 "Compile yarpview")
yarp_print_feature(CREATE_YARPMANAGER 2 "Compile yarpmanager")
yarp_print_feature(CREATE_YARPLOGGER 2 "Compile yarplogger")
yarp_print_feature(CREATE_YARPSCOPE 2 "Compile yarpscope")
yarp_print_feature(CREATE_YARPDATAPLAYER 2 "Compile yarpdataplayer")
yarp_print_feature(CREATE_YARPMOTORGUI 2 "Compile yarpmotorgui")
yarp_print_feature(CREATE_YARPLASERSCANNERGUI 2 "Compile yarplaserscannergui")
yarp_print_feature(CREATE_YARPBATTERYGUI 2 "Compile yarpbatterygui")
yarp_print_feature(CREATE_YARPVIZ 2 "Compile yarpviz")
yarp_print_feature(YARP_COMPILE_yarprobotinterface 1 "Compile yarprobotinterface")
yarp_print_feature(YARP_COMPILE_yarpmanager-console 1 "Compile YARP Module Manager (console)")
yarp_print_feature(YARP_COMPILE_yarpdatadumper 1 "Compile yarpdatadumper")
yarp_print_feature(YARP_COMPILE_GUIS 1 "Compile GUIs")
yarp_print_feature(YARP_COMPILE_yarpview 2 "Compile yarpview")
yarp_print_feature(YARP_COMPILE_yarpmanager 2 "Compile yarpmanager")
yarp_print_feature(YARP_COMPILE_yarplogger 2 "Compile yarplogger")
yarp_print_feature(YARP_COMPILE_yarpscope 2 "Compile yarpscope")
yarp_print_feature(YARP_COMPILE_yarpdataplayer 2 "Compile yarpdataplayer")
yarp_print_feature(YARP_COMPILE_yarpmotorgui 2 "Compile yarpmotorgui")
yarp_print_feature(YARP_COMPILE_yarplaserscannergui 2 "Compile yarplaserscannergui")
yarp_print_feature(YARP_COMPILE_yarpbatterygui 2 "Compile yarpbatterygui")
yarp_print_feature(YARP_COMPILE_yarpviz 2 "Compile yarpviz")

yarp_print_feature(YARP_COMPILE_RTF_ADDONS 0 "Compile Robot Testing Framework addons")
yarp_print_feature(YARP_COMPILE_UNMAINTAINED 0 "Compile Unmaintained components")
Expand Down
4 changes: 2 additions & 2 deletions data/yarpmanager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

# TODO Figure out what to do with the files in this folder

if(CREATE_LIB_MANAGER)
add_subdirectory(tests) #should be renamed to xml or templates
if(YARP_COMPILE_libYARP_manager)
add_subdirectory(tests) #should be renamed to xml or templates
endif()


2 changes: 1 addition & 1 deletion src/libYARP_manager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This software may be modified and distributed under the terms of the
# BSD-3-Clause license. See the accompanying LICENSE file for details.

if(CREATE_LIB_MANAGER)
if(YARP_COMPILE_libYARP_manager)

project(YARP_manager)

Expand Down
2 changes: 1 addition & 1 deletion src/libYARP_math/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# This software may be modified and distributed under the terms of the
# BSD-3-Clause license. See the accompanying LICENSE file for details.

if (CREATE_LIB_MATH)
if (YARP_COMPILE_libYARP_math)

project(YARP_math)

Expand Down
2 changes: 1 addition & 1 deletion src/libYARP_profiler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This software may be modified and distributed under the terms of the
# BSD-3-Clause license. See the accompanying LICENSE file for details.

if(CREATE_LIB_PROFILER)
if(YARP_COMPILE_libYARP_profiler)

project(YARP_profiler)

Expand Down
2 changes: 1 addition & 1 deletion src/yarpbatterygui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This software may be modified and distributed under the terms of the
# BSD-3-Clause license. See the accompanying LICENSE file for details.

if(CREATE_YARPBATTERYGUI)
if(YARP_COMPILE_yarpbatterygui)

include(YarpUseQt5)
include(YarpOSXUtilities)
Expand Down
2 changes: 1 addition & 1 deletion src/yarpdatadumper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# This software may be modified and distributed under the terms of the
# BSD-3-Clause license. See the accompanying LICENSE file for details.

if(CREATE_YARPDATADUMPER)
if(YARP_COMPILE_yarpdatadumper)
if(YARP_HAS_OpenCV)
add_definitions(-DADD_VIDEO)
include_directories(${OpenCV_INCLUDE_DIRS})
Expand Down
2 changes: 1 addition & 1 deletion src/yarpdataplayer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This software may be modified and distributed under the terms of the
# BSD-3-Clause license. See the accompanying LICENSE file for details.

if(CREATE_YARPDATAPLAYER)
if(YARP_COMPILE_yarpdataplayer)

include(YarpUseQt5)
include(YarpOSXUtilities)
Expand Down
2 changes: 1 addition & 1 deletion src/yarplaserscannergui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This software may be modified and distributed under the terms of the
# BSD-3-Clause license. See the accompanying LICENSE file for details.

if(CREATE_YARPLASERSCANNERGUI)
if(YARP_COMPILE_yarplaserscannergui)

include(YarpUseQt5)
include(YarpOSXUtilities)
Expand Down
2 changes: 1 addition & 1 deletion src/yarplogger-console/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This software may be modified and distributed under the terms of the
# BSD-3-Clause license. See the accompanying LICENSE file for details.

if(CREATE_YARPLOGGER)
if(YARP_COMPILE_yarplogger)
add_executable(yarplogger-console main.cpp)
target_link_libraries(yarplogger-console YARP::YARP_OS
YARP::YARP_init
Expand Down
2 changes: 1 addition & 1 deletion src/yarplogger/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This software may be modified and distributed under the terms of the
# BSD-3-Clause license. See the accompanying LICENSE file for details.

if(CREATE_YARPLOGGER)
if(YARP_COMPILE_yarplogger)

project(yarplogger)

Expand Down
2 changes: 1 addition & 1 deletion src/yarpmanager-console/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This software may be modified and distributed under the terms of the
# BSD-3-Clause license. See the accompanying LICENSE file for details.

if(CREATE_YARPMANAGER_CONSOLE)
if(YARP_COMPILE_yarpmanager-console)
set(yarpmanager_console_SRCS yarpmanager.cpp
ymanager.cpp)
set(yarpmanager_console_HDRS ymanager.h)
Expand Down
2 changes: 1 addition & 1 deletion src/yarpmanager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This software may be modified and distributed under the terms of the
# BSD-3-Clause license. See the accompanying LICENSE file for details.

if(CREATE_YARPMANAGER)
if(YARP_COMPILE_yarpmanager)

include(YarpUseQt5)
include(YarpOSXUtilities)
Expand Down
2 changes: 1 addition & 1 deletion src/yarpmotorgui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This software may be modified and distributed under the terms of the
# BSD-3-Clause license. See the accompanying LICENSE file for details.

if(CREATE_YARPMOTORGUI)
if(YARP_COMPILE_yarpmotorgui)

include(YarpUseQt5)
include(YarpOSXUtilities)
Expand Down
2 changes: 1 addition & 1 deletion src/yarprobotinterface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This software may be modified and distributed under the terms of the
# BSD-3-Clause license. See the accompanying LICENSE file for details.

if(CREATE_YARPROBOTINTERFACE)
if(YARP_COMPILE_yarprobotinterface)

include_directories(${TinyXML_INCLUDE_DIRS})

Expand Down
2 changes: 1 addition & 1 deletion src/yarpscope/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This software may be modified and distributed under the terms of the
# BSD-3-Clause license. See the accompanying LICENSE file for details.

if(CREATE_YARPSCOPE)
if(YARP_COMPILE_yarpscope)

include(YarpUseQt5)

Expand Down
2 changes: 1 addition & 1 deletion src/yarpview/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This software may be modified and distributed under the terms of the
# BSD-3-Clause license. See the accompanying LICENSE file for details.

if(CREATE_YARPVIEW)
if(YARP_COMPILE_yarpview)

include(YarpUseQt5)

Expand Down
2 changes: 1 addition & 1 deletion src/yarpviz/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This software may be modified and distributed under the terms of the
# BSD-3-Clause license. See the accompanying LICENSE file for details.

if(CREATE_YARPVIZ)
if(YARP_COMPILE_yarpviz)

project(yarpviz)

Expand Down

0 comments on commit 32781cd

Please sign in to comment.