···11+# kissfft-config.ccmake accept the following components:
22+#
33+# SHARED/STATIC:
44+# This components allows one to choose a shared/static kissfft library.
55+# The default is selected by BUILD_SHARED_LIBS.
66+# They are to be used exclusively. Using them together is an error.
77+#
88+# example:
99+# find_package(kissfft CONFIG REQUIRED COMPONENTS STATIC)
1010+#
1111+# simd/int16/int32/float/double:
1212+# This components allows one to choose the datatype.
1313+# When using this component, the target kissfft::kissfft becomes available.
1414+# When not using this component, you will have to choose the correct kissfft target.
1515+#
1616+# example:
1717+# find_package(kissfft CONFIG REQUIRED)
1818+# # - kissfft::kissfft-float, kissfft::kissfft-int32_t/ ... are available (if they are installed)
1919+# # - kissfft::kissfft is not available,
2020+#
2121+# find_package(kissfft CONFIG REQUIRED COMPONENTS int32_t)
2222+# # - kissfft::kissfft-float, kissfft::kissfft-int32_t/ ... are available (if they are installed)
2323+# # - kissfft::kissfft is available (as an alias for kissfft::kissfft-int32_t),
2424+125@PACKAGE_INIT@
2262727+cmake_minimum_required(VERSION 3.3)
2828+2929+# Set include glob of config files using SHARED/static component, BUILD_SHARED_LIBS by default
3030+set(_kissfft_shared_detected OFF)
3131+set(_kissfft_shared ${BUILD_SHARED_LIBS})
3232+if("SHARED" IN_LIST kissfft_FIND_COMPONENTS)
3333+ set(_kissfft_shared_detected ON)
3434+ set(_kissfft_shared ON)
3535+endif()
3636+if("STATIC" IN_LIST kissfft_FIND_COMPONENTS)
3737+ if(_kissfft_shared_detected)
3838+ message(FATAL_ERROR "SHARED and STATIC components cannot be used together")
3939+ endif()
4040+ set(_kissfft_shared_detected ON)
4141+ set(_kissfft_shared OFF)
4242+endif()
4343+4444+if(_kissfft_shared)
4545+ set(_kissfft_config_glob "kissfft-*-shared-targets.cmake")
4646+else()
4747+ set(_kissfft_config_glob "kissfft-*-static-targets.cmake")
4848+endif()
4949+350# Load information for all configured kissfft
451get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
55-file(GLOB CONFIG_FILES "${_DIR}/kissfft-*-targets.cmake")
5252+file(GLOB CONFIG_FILES "${_DIR}/${_kissfft_config_glob}")
653foreach(f ${CONFIG_FILES})
754 include(${f})
855endforeach()
9565757+# If a datatype component is passed, create kissfft::kissfft
5858+set(_kissfft_datatype_detected)
5959+foreach(_kissfft_datatype simd int16 int32 float double)
6060+ if(_kissfft_datatype IN_LIST kissfft_FIND_COMPONENTS)
6161+ if(_kissfft_datatype_detected)
6262+ message(FATAL_ERROR "Cannot define datatype COMPONENT twice: ${_kissfft_datatype_detected} and ${_kissfft_datatype}")
6363+ endif()
6464+ set(_kissfft_datatype_detected ${_kissfft_datatype})
6565+ endif()
6666+endforeach()
6767+6868+if(_kissfft_datatype_detected)
6969+ if(NOT TARGET kissfft::kissfft-${_kissfft_datatype_detected})
7070+ message(FATAL_ERROR "kissfft with datatype=${_kissfft_datatype_detected} is not installed")
7171+ endif()
7272+ if(TARGET kissfft::kissfft)
7373+ message(SEND_ERROR "kissfft::kissfft already exists. You cannot use 2 find_package's with datatype that are visible to eachother.")
7474+ else()
7575+ add_library(kissfft::kissfft INTERFACE IMPORTED)
7676+ set_property(TARGET kissfft::kissfft PROPERTY INTERFACE_LINK_LIBRARIES kissfft::kissfft-${_kissfft_datatype_detected})
7777+ endif()
7878+endif()
7979+8080+set(kissfft_FOUND ON)
1081set(KISSFFT_VERSION @kissfft_VERSION@)
11821212-check_required_components(kissfft)
+1-1
tools/CMakeLists.txt
···1414 target_link_libraries(psdpng PRIVATE PkgConfig::libpng)
1515endif()
16161717-#dumphdr.c is not available
1717+#FIXME: dumphdr.c is not available
1818#add_kissfft_executable(dumphdr dumphdr.c)