diff --git a/CHANGELOG.md b/CHANGELOG.md index f27723a..e0eb6d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,28 +1,29 @@ # Change log ## Release 0.1.0 * New: Double Arrow annotation tool. ([#23](https://github.com/DamirPorobic/kImageAnnotator/issues/23)) * New: Marker Rectangle and Ellipse annotation tool. ([#26](https://github.com/DamirPorobic/kImageAnnotator/issues/26)) * New: Add icons for dark theme. ([#37](https://github.com/DamirPorobic/kImageAnnotator/issues/37)) * New: Add config option to setup blur radius. ([#25](https://github.com/DamirPorobic/kImageAnnotator/issues/25)) +* New: Add cmake uninstall target. ([#47](https://github.com/DamirPorobic/kImageAnnotator/issues/47)) * Changed: Blur tool is now preciser and fits the rect. ([#28](https://github.com/DamirPorobic/kImageAnnotator/issues/28)) * Changed: Enter finishes text input and shift-enter adds new line in Text Tool. ([#30](https://github.com/DamirPorobic/kImageAnnotator/issues/30)) * Changed: Text item draws border around the text when in text edit mode. ([#34](https://github.com/DamirPorobic/kImageAnnotator/issues/34)) * Fixed: Double-click on annotation area causes SIGSEGV crash. ([#29](https://github.com/DamirPorobic/kImageAnnotator/issues/29)) * Fixed: CAPS LOCK doesnt work on image editor. ([#27](https://github.com/DamirPorobic/kImageAnnotator/issues/27)) * Fixed: Unable to select text item when clicking on text. ([#32](https://github.com/DamirPorobic/kImageAnnotator/issues/32)) * Fixed: Some blurs get removed when losing focus. ([#35](https://github.com/DamirPorobic/kImageAnnotator/issues/35)) * Fixed: Items cannot be resized when drawn from bottom right to top left. ([#38](https://github.com/DamirPorobic/kImageAnnotator/issues/38)) * Fixed: Right click on annotation items selects item but doesn't switch tool. ([#40](https://github.com/DamirPorobic/kImageAnnotator/issues/40)) * Fixed: Copy number annotation item doesn't increment number. ([#41](https://github.com/DamirPorobic/kImageAnnotator/issues/41)) * Fixed: Crash on startup after adding Blur Radius Picker. ([#43](https://github.com/DamirPorobic/kImageAnnotator/issues/43)) * Fixed: Unable to select number annotation when clicking on the number without background. ([#46](https://github.com/DamirPorobic/kImageAnnotator/issues/46)) ## Release 0.0.2 * New: Added blur annotation tool. ([#20](https://github.com/DamirPorobic/kImageAnnotator/issues/20)) * New: Keep number tool sequence consecutive after deleting item. ([#7](https://github.com/DamirPorobic/kImageAnnotator/issues/7)) * New: Added control for setting first number for numbering tool. ([#7](https://github.com/DamirPorobic/kImageAnnotator/issues/7)) * New: Text and Number tool have now noBorderAndNoFill type. ([#22](https://github.com/DamirPorobic/kImageAnnotator/issues/22)) ## Release 0.0.1 -* New: Initial release \ No newline at end of file +* New: Initial release diff --git a/CMakeLists.txt b/CMakeLists.txt index d9f7b08..d1e5943 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,114 +1,124 @@ cmake_minimum_required(VERSION 3.5) project(kImageAnnotator LANGUAGES CXX VERSION 0.1.0) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) option(BUILD_TESTS "Build Unit Tests" OFF) option(BUILD_EXAMPLE "Build Example Application" ON) set(QT_MIN_VERSION "5.6.1") find_package(Qt5 ${QT_MIN_VERSION} REQUIRED Widgets Test) if (UNIX) find_package(X11 REQUIRED) endif () include(GNUInstallDirs) include(FeatureSummary) set(KCOLORPICKER_MIN_VERSION "0.0.1") find_package(kColorPicker ${KCOLORPICKER_MIN_VERSION} REQUIRED) set(BASEPATH "${CMAKE_CURRENT_SOURCE_DIR}") include_directories("${BASEPATH}") add_subdirectory(src) if (BUILD_EXAMPLE) add_subdirectory(example) endif (BUILD_EXAMPLE) if (BUILD_TESTS) enable_testing() add_subdirectory(tests) endif (BUILD_TESTS) include(CMakePackageConfigHelpers) add_library(kImageAnnotator ${KIMAGEANNOTATOR_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/include/kImageAnnotator/KImageAnnotator.h ${CMAKE_CURRENT_SOURCE_DIR}/icons/kImageAnnotator_icons.qrc ) add_library(kImageAnnotator::kImageAnnotator ALIAS kImageAnnotator) target_include_directories(kImageAnnotator PUBLIC $ $ $ ) if (UNIX) target_link_libraries(kImageAnnotator PUBLIC Qt5::Widgets kColorPicker X11) else () target_link_libraries(kImageAnnotator PUBLIC Qt5::Widgets kColorPicker) endif () target_compile_definitions(kImageAnnotator PRIVATE KIMAGEANNOTATOR_LIB) set_target_properties(kImageAnnotator PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin SOVERSION ${PROJECT_VERSION} ) install(TARGETS kImageAnnotator EXPORT kImageAnnotator-targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/kImageAnnotator DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) configure_package_config_file( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/kImageAnnotatorConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/cmake/kImageAnnotatorConfig.cmake INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/kImageAnnotator ) write_basic_package_version_file( ${CMAKE_CURRENT_BINARY_DIR}/cmake/kImageAnnotatorConfig-version.cmake VERSION ${PROJECT_VERSION} COMPATIBILITY AnyNewerVersion ) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cmake/kImageAnnotatorConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/cmake/kImageAnnotatorConfig-version.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/kImageAnnotator ) export( EXPORT kImageAnnotator-targets FILE ${CMAKE_CURRENT_BINARY_DIR}/cmake/kImageAnnotator-targets.cmake NAMESPACE kImageAnnotator:: ) install( EXPORT kImageAnnotator-targets FILE kImageAnnotator-targets.cmake NAMESPACE kImageAnnotator:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/kImageAnnotator ) + +# uninstall target +if(NOT TARGET uninstall) + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" + IMMEDIATE @ONLY) + + add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) +endif() diff --git a/cmake/cmake_uninstall.cmake.in b/cmake/cmake_uninstall.cmake.in new file mode 100644 index 0000000..2b0d97c --- /dev/null +++ b/cmake/cmake_uninstall.cmake.in @@ -0,0 +1,22 @@ +if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") + message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt") +endif(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") + +file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files) +string(REGEX REPLACE "\n" ";" files "${files}") +foreach(file ${files}) + message(STATUS "Uninstalling $ENV{DESTDIR}${file}") + if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + exec_program( + "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" + OUTPUT_VARIABLE rm_out + RETURN_VALUE rm_retval + ) + if(NOT "${rm_retval}" STREQUAL 0) + message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") + endif(NOT "${rm_retval}" STREQUAL 0) + else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + message(STATUS "File $ENV{DESTDIR}${file} does not exist.") + endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") +endforeach(file) +