update cmake to be sure vcg is included just one time

This commit is contained in:
alemuntoni 2021-06-17 12:49:42 +02:00
parent 8dc26dbe93
commit 721dace0c5
1 changed files with 11 additions and 7 deletions

View File

@ -279,14 +279,18 @@ set(SOURCES
) )
if (VCG_HEADER_ONLY) if (VCG_HEADER_ONLY)
add_library(vcglib INTERFACE) if (NOT TARGET vcglib) # to be sure that vcglib target is created just one time
target_include_directories( add_library(vcglib INTERFACE)
vcglib INTERFACE target_include_directories(
${CMAKE_CURRENT_LIST_DIR} vcglib INTERFACE
${EIGEN_INCLUDE_DIRS}) ${CMAKE_CURRENT_LIST_DIR}
${EIGEN_INCLUDE_DIRS})
#just to show headers in ide #just to show headers in ide
add_custom_target(vcglib_ide SOURCES ${VCG_HEADERS}) add_custom_target(vcglib_ide SOURCES ${VCG_HEADERS})
else()
message(STATUS "- VCGLib - jumped - already included")
endif()
else() else()
#TODO make vcglib that includes all the wrap sources, checking everytime #TODO make vcglib that includes all the wrap sources, checking everytime
# if the the required targets (e.g. qt, gl, glew...) exists # if the the required targets (e.g. qt, gl, glew...) exists