Move the uninstall definition at the end

of the root CMakeLists and add custom
commands to remove the lv2/vst directories
This commit is contained in:
Paul Fd 2020-03-14 10:37:35 +01:00
parent 643acbc644
commit 8b639845a9
3 changed files with 24 additions and 11 deletions

View file

@ -64,4 +64,9 @@ if (SFIZZ_TESTS)
add_subdirectory (tests)
endif()
# Put it at the end so that the vst/lv2 directories are registered
if (NOT MSVC)
include(SfizzUninstall)
endif()
show_build_info_if_needed()

View file

@ -94,15 +94,4 @@ Compiler CXX min size flags: ${CMAKE_CXX_FLAGS_MINSIZEREL}
endif()
endfunction()
if(NOT TARGET uninstall)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/MakeUninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/MakeUninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/MakeUninstall.cmake)
endif()
find_package (Threads REQUIRED)

View file

@ -0,0 +1,19 @@
if(NOT TARGET uninstall)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/MakeUninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/MakeUninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/MakeUninstall.cmake)
if (SFIZZ_LV2 AND LV2PLUGIN_INSTALL_DIR)
add_custom_command(TARGET uninstall
COMMAND rm -rv "${LV2PLUGIN_INSTALL_DIR}/${PROJECT_NAME}.lv2")
endif()
if (SFIZZ_VST AND VSTPLUGIN_INSTALL_DIR)
add_custom_command(TARGET uninstall
COMMAND rm -rv "${VSTPLUGIN_INSTALL_DIR}/${PROJECT_NAME}.vst3")
endif()
endif()