fastlib / fCWT

The fast Continuous Wavelet Transform (fCWT) is a library for fast calculation of CWT.
Apache License 2.0
263 stars 53 forks source link

CMake function find_package() does not find fCWT-config.cmake configuration files #57

Open VladislavMasl opened 8 months ago

VladislavMasl commented 8 months ago

Thanks to the authors for the opportunity to use this library!

I have a little problem: i installed the fCWT library following the instructions from this official repository, And in the Ubuntu default path /usr/local/share/fcwt/cmake the configuration files fCWT-config.cmake and fCWT-config-release.cmake are present. However, when using the find_package(fCWT REQUIRED)` function in a QT Creator build together with CMakeLists.txt, CMake gives an error:

CMakeLists.txt:14: error: By not providing "FindfCWT.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "fCWT", but CMake did not find one. Could not find a package configuration file provided by "fCWT" with any of the following names:

fCWTConfig.cmake fcwt-config.cmake

Add the installation prefix of "fCWT" to CMAKE_PREFIX_PATH or set "fCWT_DIR" to a directory containing one of the above files. If "fCWT" provides a separate development package or SDK, be sure it has been installed.

I've tried specifying the path to the configuration files using CMake commands but they don't bring success:

set (CMAKE_MODULE_PATH fCWT-config.cmake REQUIRED)
set (CMAKE_PREFIX_PATH /usr/local/share/fcwt/cmake/fCWT-config.cmake REQUIRED)
set (fCWT-config.cmake_DIR = /usr/local/share/fcwt/cmake/ REQUIRED)
list(APPEND CMAKE_SYSTEM_PREFIX_PATH /usr/local/share/fcwt/cmake)

listing them before find_package(fCWT REQUIRED)

This seems strange to me because it finds the other library (GSL) I use in my small project. My CMakeLists.txt looks like this:

cmake_minimum_required(VERSION 3.22)

project(fft LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(GSL REQUIRED)
find_package(fCWT REQUIRED)

include_directories(${GSL_INCLUDE_DIR})
include_directories(${fCWT_INCLUDE_DIR})
include_directories(/lib/include)
include_directories(/usr/local/include)

add_executable(fft main.cpp)
target_link_libraries(fft PRIVATE ${GSL_LIBRARY})
target_link_libraries(fft PRIVATE ${fCWT_LIBRARY})

Thank you for paying attention to my question. I will be glad to receive any advice on how to fix this error.

myprojcts commented 8 months ago

The issue was resolved by renaming the configuration file "fCWT-config.cmake" to "fCWTConfig.cmake".