From 90784cefe32c74b2c069a621607cd15a9a775982 Mon Sep 17 00:00:00 2001 From: Frederick Roy Date: Thu, 3 Aug 2017 11:17:08 +0200 Subject: [PATCH] [applications] meshconv: notify the user that he need to build miniflowVR, dont build it otherwise --- SofaKernel/SofaFramework/SofaMacros.cmake | 7 +++++-- applications/projects/meshconv/CMakeLists.txt | 8 ++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/SofaKernel/SofaFramework/SofaMacros.cmake b/SofaKernel/SofaFramework/SofaMacros.cmake index b9f5db2fef2..83b82fb3230 100644 --- a/SofaKernel/SofaFramework/SofaMacros.cmake +++ b/SofaKernel/SofaFramework/SofaMacros.cmake @@ -178,8 +178,11 @@ macro(sofa_add_generic directory name type) if(${option}) message("Adding ${type} ${name}") add_subdirectory(${directory} ${name}) - set_target_properties(${name} PROPERTIES FOLDER ${type}s) # IDE folder - set_target_properties(${name} PROPERTIES DEBUG_POSTFIX "_d") + #Check if the target has been successfully added + if(TARGET ${name}) + set_target_properties(${name} PROPERTIES FOLDER ${type}s) # IDE folder + set_target_properties(${name} PROPERTIES DEBUG_POSTFIX "_d") + endif() endif() set_property(GLOBAL APPEND PROPERTY __GlobalTargetList__ ${name}) diff --git a/applications/projects/meshconv/CMakeLists.txt b/applications/projects/meshconv/CMakeLists.txt index 0de4d6d5100..961921240c4 100644 --- a/applications/projects/meshconv/CMakeLists.txt +++ b/applications/projects/meshconv/CMakeLists.txt @@ -5,5 +5,9 @@ find_package(SofaGeneral) find_package(SofaAdvanced) find_package(SofaMisc) -add_executable(${PROJECT_NAME} meshconv.cpp tesselate.cpp) -target_link_libraries(${PROJECT_NAME} SofaComponentGeneral SofaComponentAdvanced SofaComponentMisc) +if(SOFA_HAVE_MINIFLOWVR) + add_executable(${PROJECT_NAME} meshconv.cpp tesselate.cpp) + target_link_libraries(${PROJECT_NAME} SofaComponentGeneral SofaComponentAdvanced SofaComponentMisc) +else() + message("WARNING: meshconv needs miniFlowVR, enable SOFA_BUILD_MINIFLOWVR if you want to build it. meshconv won't be built.") +endif() \ No newline at end of file