-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from MathiasPaulin/master
Port to Qt >= 5.15 and install package config files
- Loading branch information
Showing
5 changed files
with
142 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
include(FindPackageHandleStandardArgs) | ||
set(${CMAKE_FIND_PACKAGE_NAME}_CONFIG ${CMAKE_CURRENT_LIST_FILE}) | ||
find_package_handle_standard_args(@PROJECT_NAME@ CONFIG_MODE) | ||
|
||
if(NOT TARGET @PROJECT_NAME@) | ||
macro(find_qt_dependency) | ||
set(options REQUIRED) | ||
set(oneValueArgs "") | ||
set(multiValueArgs COMPONENTS) | ||
|
||
cmake_parse_arguments(MY_OPTIONS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) | ||
|
||
if(NOT MY_OPTIONS_COMPONENTS) # User didn't enter any component | ||
set(MY_OPTIONS_COMPONENTS "") | ||
endif() | ||
|
||
find_package(Qt6 COMPONENTS ${MY_OPTIONS_COMPONENTS} QUIET) | ||
if(NOT Qt6_FOUND) | ||
if(${MY_OPTIONS_REQUIRED}) | ||
find_package(Qt5 5.15 COMPONENTS ${MY_OPTIONS_COMPONENTS} REQUIRED) | ||
else() | ||
find_package(Qt5 5.15 COMPONENTS ${MY_OPTIONS_COMPONENTS}) | ||
endif() | ||
endif() | ||
endmacro() | ||
|
||
find_qt_dependency(COMPONENTS Core Widgets REQUIRED) | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
cmake_minimum_required(VERSION 3.12) | ||
|
||
project(PowerSliderDemo) | ||
|
||
find_package(PowerSlider REQUIRED) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
|
||
set(demo_source | ||
main.cpp | ||
) | ||
|
||
add_executable(${PROJECT_NAME} ${demo_source}) | ||
target_link_libraries(${PROJECT_NAME} PowerSlider::PowerSlider ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters