mborgerding / kissfft

a Fast Fourier Transform (FFT) library that tries to Keep it Simple, Stupid
Other
1.39k stars 278 forks source link

`make install` attempts to install to system-root (`/kissfft`) #65

Open JayFoxRox opened 3 years ago

JayFoxRox commented 3 years ago

I'm cross-compiling and getting the following:

$ make install
[...]
[100%] Linking C static library libkissfft-float.a
[100%] Built target kissfft
Install the project...
-- Install configuration: ""
-- Installing: /my-custom-toolchain-path/usr/local/lib/libkissfft-float.a
CMake Error at cmake_install.cmake:53 (file):
  file cannot create directory: /kissfft.  Maybe need administrative
  privileges.

This has to do with:

https://github.com/mborgerding/kissfft/blob/8f47a67f595a6641c566087bf5277034be64f24d/CMakeLists.txt#L104-L110

I'm compiling for a "Generic" system (which will probably change as the CMake support in our toolchain improves), and I'm cross-compiling. So GNUInstallDirs is not included.

This breaks the next few lines break, because CMAKE_INSTALL_INCLUDEDIR was never set:

https://github.com/mborgerding/kissfft/blob/8f47a67f595a6641c566087bf5277034be64f24d/CMakeLists.txt#L112-L117

I think it's best to include GNUInstallDirs unconditionally. Although I'm not sure how deployment on Windows works.

It's worth noting that our toolchain is using a GNU toolchain layout with /usr/local/include (but it's also using clang in MSVC compatibility mode to compile for Windows - similar to cygwin/mingw, except it's neither of those).