diff options
author | Pawday <pawday@mail.ru> | 2021-07-26 18:52:29 +0300 |
---|---|---|
committer | Pawday <pawday@mail.ru> | 2021-07-26 18:52:29 +0300 |
commit | e91e4cc9fbb804ca8f3c3cf92d0a974298ca1ab3 (patch) | |
tree | 528ac9c8c5d244e54d8a7753da176cbae10cee9d | |
parent | f61f1a7a91dd25808e2081ed187ed5298ddad036 (diff) | |
download | json-c-e91e4cc9fbb804ca8f3c3cf92d0a974298ca1ab3.tar.gz |
Setted cmake "uninstall" target to exist in unix like operating systems only
-rw-r--r-- | CMakeLists.txt | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ed7bc03..8e66ea4 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 |