From 0a440c9515c4a37ab6e0c0c433d28638919c58dd Mon Sep 17 00:00:00 2001 From: Curve Date: Sun, 3 Dec 2023 00:53:06 +0100 Subject: [PATCH] refactor: more logging, don't use early return in macro * early return behavior in macro may vary in different cmake versions --- Examples/CMakeLists.txt | 1 + Tests/CMakeLists.txt | 1 + cmake/vtk.cmake | 18 ++++++++---------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Examples/CMakeLists.txt b/Examples/CMakeLists.txt index b49a3350..acd4eea5 100644 --- a/Examples/CMakeLists.txt +++ b/Examples/CMakeLists.txt @@ -15,5 +15,6 @@ foreach(entry ${entries}) continue() endif() + message(STATUS "[ViennaLS] Adding Example ${entry}") add_subdirectory(${entry}) endforeach() diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index d8289552..2ecf7b43 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -15,5 +15,6 @@ foreach(entry ${entries}) continue() endif() + message(STATUS "[ViennaLS] Adding Test ${entry}") add_subdirectory(${entry}) endforeach() diff --git a/cmake/vtk.cmake b/cmake/vtk.cmake index 36a4b25e..10c4360d 100644 --- a/cmake/vtk.cmake +++ b/cmake/vtk.cmake @@ -1,16 +1,14 @@ macro(setup_vtk_env TARGET OUTPUT) - if(NOT WIN32) message( STATUS "[ViennaLS] Skipping VTK-Environment setup for ${TARGET} (Only required on Windows)") - return() - endif() + else() + message(STATUS "[ViennaLS] Setting up VTK for ${TARGET}") + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY $<1:${PROJECT_BINARY_DIR}/${OUTPUT}>) - message(STATUS "[ViennaLS] Setting up VTK for ${TARGET}") - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY $<1:${PROJECT_BINARY_DIR}/${OUTPUT}>) - - add_custom_command( - TARGET ${TARGET} - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_directory ${VTK_LIBS} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + add_custom_command( + TARGET ${TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory ${VTK_LIBS} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + endif() endmacro()