From d507dbb5dd2422948fed8b4fe9276e4e6a9be50d Mon Sep 17 00:00:00 2001 From: Max Paperno Date: Mon, 9 Jul 2018 11:53:38 -0400 Subject: [PATCH] Add SIMU_TARGET build option to exclude libsimulator & simu from all/install. --- companion/src/CMakeLists.txt | 6 ++++-- radio/src/targets/simu/CMakeLists.txt | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/companion/src/CMakeLists.txt b/companion/src/CMakeLists.txt index 4e9e0186c..3d884bcf1 100644 --- a/companion/src/CMakeLists.txt +++ b/companion/src/CMakeLists.txt @@ -333,8 +333,10 @@ string(TOLOWER ${PCB} FLAVOUR) if(POLICY CMP0026) cmake_policy(SET CMP0026 OLD) # https://cmake.org/cmake/help/v3.0/policy/CMP0026.html endif() -get_property(current_plugin TARGET opentx-${FLAVOUR}-simulator PROPERTY LOCATION) -list(APPEND simulator_plugins "${current_plugin}") +if(SIMU_TARGET) + get_property(current_plugin TARGET opentx-${FLAVOUR}-simulator PROPERTY LOCATION) + list(APPEND simulator_plugins "${current_plugin}") +endif() if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") diff --git a/radio/src/targets/simu/CMakeLists.txt b/radio/src/targets/simu/CMakeLists.txt index 284c2a446..6fd71aa1e 100644 --- a/radio/src/targets/simu/CMakeLists.txt +++ b/radio/src/targets/simu/CMakeLists.txt @@ -1,3 +1,10 @@ + +option(SIMU_TARGET "Configure libsimulator/simu targets (can be turned off for compiling Companion only)" ON) +if(NOT SIMU_TARGET) + message(STATUS "libsimulator/simu targets disabled") + return() +endif() + foreach(FILE ${SRC}) set(SIMU_SRC ${SIMU_SRC} ../../${FILE}) endforeach()