]> git.ipfire.org Git - thirdparty/json-c.git/commitdiff
Setted cmake "uninstall" target to exist in unix like operating systems only 718/head
authorPawday <pawday@mail.ru>
Mon, 26 Jul 2021 15:52:29 +0000 (18:52 +0300)
committerPawday <pawday@mail.ru>
Mon, 26 Jul 2021 15:52:29 +0000 (18:52 +0300)
CMakeLists.txt

index ed7bc03bfe2c4e7d690da922cea35656826c98c8..8e66ea4b9788c1a8c06804b9c6012a005d5712fa 100644 (file)
@@ -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