[neon/backports-noble/kcolorpicker-noble/Neon/unstable] /: New upstream version 0.3.1

Boyuan Yang null at kde.org
Wed Jul 3 15:10:16 BST 2024


Git commit 4db7e8c2cddfd2e1a6574bbbdd0037bb25a8f766 by Boyuan Yang.
Committed on 19/03/2024 at 22:22.
Pushed by jriddell into branch 'Neon/unstable'.

New upstream version 0.3.1

M  +24   -29   CMakeLists.txt
M  +3    -6    README.md
D  +0    -9    cmake/kColorPicker-Qt5Config.cmake.in
D  +0    -9    cmake/kColorPicker-Qt6Config.cmake.in
A  +9    -0    cmake/kColorPickerConfig.cmake.in
M  +1    -1    example/CMakeLists.txt
M  +1    -1    tests/CMakeLists.txt

https://invent.kde.org/neon/backports-noble/kcolorpicker-noble/-/commit/4db7e8c2cddfd2e1a6574bbbdd0037bb25a8f766

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6ba8f15..1d15048 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,9 +1,9 @@
 cmake_minimum_required(VERSION 3.5)
-project(kColorPicker LANGUAGES CXX VERSION 0.3.0)
+project(kColorPicker LANGUAGES CXX VERSION 0.3.1)
 
-set(QT_MIN_VERSION "5.9.4")
+set(QT_MIN_VERSION 5.15.2)
 
-set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD 17)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 set(CMAKE_CXX_EXTENSIONS OFF)
 
@@ -15,12 +15,9 @@ option(BUILD_EXAMPLE "Build Example Application" ON)
 
 option(BUILD_WITH_QT6 "Build with Qt6" OFF)
 if(BUILD_WITH_QT6)
-    set(CMAKE_CXX_STANDARD 17)
     set(QT_MAJOR_VERSION 6)
-    set(kColorPicker_LIB_NAME "kColorPicker-Qt6")
 else()
     set(QT_MAJOR_VERSION 5)
-    set(kColorPicker_LIB_NAME "kColorPicker-Qt5")
 endif()
 
 find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED Widgets)
@@ -44,26 +41,24 @@ endif (BUILD_TESTS)
 
 include(CMakePackageConfigHelpers)
 
-add_library(${kColorPicker_LIB_NAME}
+add_library(kColorPicker
 			${KCOLORPICKER_SRCS}
 			${CMAKE_CURRENT_SOURCE_DIR}/include/kColorPicker/KColorPicker.h
 			${CMAKE_CURRENT_SOURCE_DIR}/icons/kColorPicker_icons.qrc
 			)
 
-#add_library(kColorPicker::kColorPicker ALIAS kColorPicker)
-
-target_include_directories(${kColorPicker_LIB_NAME}
+target_include_directories(kColorPicker
 						   PUBLIC
 						   $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
 						   $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
-						   $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>/${kColorPicker_LIB_NAME}
+						   $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/kColorPicker-Qt${QT_MAJOR_VERSION}>
 						   )
 
-target_link_libraries(${kColorPicker_LIB_NAME} PUBLIC Qt${QT_MAJOR_VERSION}::Widgets)
+target_link_libraries(kColorPicker PUBLIC Qt${QT_MAJOR_VERSION}::Widgets)
 
-target_compile_definitions(${kColorPicker_LIB_NAME} PRIVATE KIMAGEANNOTATOR_LIB)
+target_compile_definitions(kColorPicker PRIVATE KIMAGEANNOTATOR_LIB)
 
-set_target_properties(${kColorPicker_LIB_NAME}
+set_target_properties(kColorPicker
 					  PROPERTIES
 					  ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib
 					  LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib
@@ -72,43 +67,43 @@ set_target_properties(${kColorPicker_LIB_NAME}
 					  SOVERSION 0
 					  )
 
-install(TARGETS ${kColorPicker_LIB_NAME}
-		EXPORT ${kColorPicker_LIB_NAME}-targets
+install(TARGETS kColorPicker
+		EXPORT kColorPicker-targets
 		ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
 		LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
 		RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
 		)
 
 install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/kColorPicker
-		DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${kColorPicker_LIB_NAME}
+		DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/kColorPicker-Qt${QT_MAJOR_VERSION}
 		)
 
-configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/${kColorPicker_LIB_NAME}Config.cmake.in
-                              ${CMAKE_CURRENT_BINARY_DIR}/cmake/${kColorPicker_LIB_NAME}Config.cmake
-                              INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${kColorPicker_LIB_NAME}
+configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/kColorPickerConfig.cmake.in
+                              ${CMAKE_CURRENT_BINARY_DIR}/cmake/kColorPicker-Qt${QT_MAJOR_VERSION}Config.cmake
+                              INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/kColorPicker-Qt${QT_MAJOR_VERSION}
                               )
 
-write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/cmake/${kColorPicker_LIB_NAME}Config-version.cmake
+write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/cmake/kColorPicker-Qt${QT_MAJOR_VERSION}Config-version.cmake
                                  VERSION ${PROJECT_VERSION}
                                  COMPATIBILITY AnyNewerVersion
                                  )
 
 install(FILES
-        ${CMAKE_CURRENT_BINARY_DIR}/cmake/${kColorPicker_LIB_NAME}Config.cmake
-        ${CMAKE_CURRENT_BINARY_DIR}/cmake/${kColorPicker_LIB_NAME}Config-version.cmake
-        DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${kColorPicker_LIB_NAME}
+        ${CMAKE_CURRENT_BINARY_DIR}/cmake/kColorPicker-Qt${QT_MAJOR_VERSION}Config.cmake
+        ${CMAKE_CURRENT_BINARY_DIR}/cmake/kColorPicker-Qt${QT_MAJOR_VERSION}Config-version.cmake
+        DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/kColorPicker-Qt${QT_MAJOR_VERSION}
         )
 
 
-export(EXPORT ${kColorPicker_LIB_NAME}-targets
-       FILE ${CMAKE_CURRENT_BINARY_DIR}/cmake/${kColorPicker_LIB_NAME}-targets.cmake
+export(EXPORT kColorPicker-targets
+       FILE ${CMAKE_CURRENT_BINARY_DIR}/cmake/kColorPicker-Qt${QT_MAJOR_VERSION}-targets.cmake
        NAMESPACE kColorPicker::
        )
 
-install(EXPORT ${kColorPicker_LIB_NAME}-targets
-        FILE ${kColorPicker_LIB_NAME}-targets.cmake
+install(EXPORT kColorPicker-targets
+        FILE kColorPicker-targets.cmake
         NAMESPACE kColorPicker::
-        DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${kColorPicker_LIB_NAME}
+        DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/kColorPicker-Qt${QT_MAJOR_VERSION}
         )
         
 # uninstall target
diff --git a/README.md b/README.md
index 292494a..0056703 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
 # kColorPicker [![Build Status][github-badge]][github-url]
 QToolButton with color popup menu with lets you select a color. The popup features a color dialog button which can be used to add custom colors to the popup menu.
 
-Version 0.3.0
+Version 0.3.1
 
 ![kColorPicker](https://i.imgur.com/VkhUvFa.png "kColorPicker")
 
@@ -36,11 +36,8 @@ only build as static library.
     to build with Qt6:  
     `find_package(kColorPicker-Qt6 ${KCOLORPICKER_MIN_VERSION} REQUIRED)`  
 
-2. Link the library with your application  
-    if you built with Qt5:  
-    `target_link_libraries(myApp kColorPicker-Qt5)`  
-    if you built with Qt6:  
-    `target_link_libraries(myApp kColorPicker-Qt6)`  
+2. Link the library with your application 
+    `target_link_libraries(myApp kColorPicker)`  
 
 
 [github-badge]:        https://github.com/ksnip/kColorPicker/actions/workflows/build.yml/badge.svg
diff --git a/cmake/kColorPicker-Qt5Config.cmake.in b/cmake/kColorPicker-Qt5Config.cmake.in
deleted file mode 100644
index 6d3cac1..0000000
--- a/cmake/kColorPicker-Qt5Config.cmake.in
+++ /dev/null
@@ -1,9 +0,0 @@
-include(CMakeFindDependencyMacro)
-
- at PACKAGE_INIT@
-
-find_dependency(Qt5 @QT_MIN_VERSION@ COMPONENTS Widgets)
-
-if(NOT TARGET kColorPicker::kColorPicker-Qt5)
-  include("${CMAKE_CURRENT_LIST_DIR}/kColorPicker-Qt5-targets.cmake")
-endif()
diff --git a/cmake/kColorPicker-Qt6Config.cmake.in b/cmake/kColorPicker-Qt6Config.cmake.in
deleted file mode 100644
index d3e2d3c..0000000
--- a/cmake/kColorPicker-Qt6Config.cmake.in
+++ /dev/null
@@ -1,9 +0,0 @@
-include(CMakeFindDependencyMacro)
-
- at PACKAGE_INIT@
-
-find_dependency(Qt6 @QT_MIN_VERSION@ COMPONENTS Widgets)
-
-if(NOT TARGET kColorPicker::kColorPicker-Qt6)
-  include("${CMAKE_CURRENT_LIST_DIR}/kColorPicker-Qt6-targets.cmake")
-endif()
diff --git a/cmake/kColorPickerConfig.cmake.in b/cmake/kColorPickerConfig.cmake.in
new file mode 100644
index 0000000..004c645
--- /dev/null
+++ b/cmake/kColorPickerConfig.cmake.in
@@ -0,0 +1,9 @@
+include(CMakeFindDependencyMacro)
+
+ at PACKAGE_INIT@
+
+find_dependency(Qt at QT_MAJOR_VERSION@ @QT_MIN_VERSION@ COMPONENTS Widgets)
+
+if(NOT TARGET kColorPicker::kColorPicker)
+  include("${CMAKE_CURRENT_LIST_DIR}/kColorPicker-targets.cmake")
+endif()
diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt
index 34a8cbb..782b150 100644
--- a/example/CMakeLists.txt
+++ b/example/CMakeLists.txt
@@ -1,3 +1,3 @@
 add_executable(kColorPicker-example main.cpp)
 
-target_link_libraries(kColorPicker-example ${kColorPicker_LIB_NAME})
+target_link_libraries(kColorPicker-example kColorPicker)
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 7aa0df1..bf1ed42 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -4,7 +4,7 @@ set(UNITTEST_SRC
 
 add_library(KCOLORPICKER_STATIC STATIC ${KCOLORPICKER_SRCS})
 
-target_link_libraries(KCOLORPICKER_STATIC Qt${QT_MAJOR_VERSION}::Widgets ${kColorPicker_LIB_NAME})
+target_link_libraries(KCOLORPICKER_STATIC Qt${QT_MAJOR_VERSION}::Widgets kColorPicker)
 
 foreach (UnitTest ${UNITTEST_SRC})
     get_filename_component(UnitTestName ${UnitTest} NAME_WE)



More information about the Neon-commits mailing list