From: Pawday Date: Mon, 26 Jul 2021 15:52:29 +0000 (+0300) Subject: Setted cmake "uninstall" target to exist in unix like operating systems only X-Git-Tag: json-c-0.16-20220414~34^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F718%2Fhead;p=thirdparty%2Fjson-c.git Setted cmake "uninstall" target to exist in unix like operating systems only --- diff --git a/CMakeLists.txt b/CMakeLists.txt index ed7bc03b..8e66ea4b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -435,12 +435,15 @@ include_directories(${PROJECT_BINARY_DIR}) add_subdirectory(doc) -# uninstall -if(NOT TARGET uninstall) - add_custom_target(uninstall - COMMAND cat ${PROJECT_BINARY_DIR}/install_manifest.txt | xargs rm - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - ) +# "uninstall" custom target for make generators in unix like operating systems +# and if that target is not present +if (CMAKE_GENERATOR STREQUAL "Unix Makefiles") + if(NOT TARGET uninstall) + add_custom_target(uninstall + COMMAND cat ${PROJECT_BINARY_DIR}/install_manifest.txt | xargs rm + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + ) + endif() endif() # XXX for a normal full distribution we'll need to figure out