Browse Source

Merge pull request #718 from Pawday/master

CMake create uninstall target if unix generator is used
tags/json-c-0.16-20220414
Eric Hawicz GitHub 4 years ago
parent
commit
dc1ef7d566
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 6 deletions
  1. +9
    -6
      CMakeLists.txt

+ 9
- 6
CMakeLists.txt View 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


Loading…
Cancel
Save