Skip to content

Commit

Permalink
refactor: more logging, don't use early return in macro
Browse files Browse the repository at this point in the history
* early return behavior in macro may vary in different cmake versions
  • Loading branch information
Curve committed Dec 2, 2023
1 parent a8acd4c commit 0a440c9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
1 change: 1 addition & 0 deletions Examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ foreach(entry ${entries})
continue()
endif()

message(STATUS "[ViennaLS] Adding Example ${entry}")
add_subdirectory(${entry})
endforeach()
1 change: 1 addition & 0 deletions Tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ foreach(entry ${entries})
continue()
endif()

message(STATUS "[ViennaLS] Adding Test ${entry}")
add_subdirectory(${entry})
endforeach()
18 changes: 8 additions & 10 deletions cmake/vtk.cmake
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 0a440c9

Please sign in to comment.