From 721dace0c5882c7c70ff3ea55fe0cb8aabd9553e Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Thu, 17 Jun 2021 12:49:42 +0200 Subject: [PATCH] update cmake to be sure vcg is included just one time --- CMakeLists.txt | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 663c74cf..acc67cd0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -279,14 +279,18 @@ set(SOURCES ) if (VCG_HEADER_ONLY) - add_library(vcglib INTERFACE) - target_include_directories( - vcglib INTERFACE - ${CMAKE_CURRENT_LIST_DIR} - ${EIGEN_INCLUDE_DIRS}) + if (NOT TARGET vcglib) # to be sure that vcglib target is created just one time + add_library(vcglib INTERFACE) + target_include_directories( + vcglib INTERFACE + ${CMAKE_CURRENT_LIST_DIR} + ${EIGEN_INCLUDE_DIRS}) - #just to show headers in ide - add_custom_target(vcglib_ide SOURCES ${VCG_HEADERS}) + #just to show headers in ide + add_custom_target(vcglib_ide SOURCES ${VCG_HEADERS}) + else() + message(STATUS "- VCGLib - jumped - already included") + endif() else() #TODO make vcglib that includes all the wrap sources, checking everytime # if the the required targets (e.g. qt, gl, glew...) exists