pure-data / pd.cmake

A CMake based build system for Pure Data libraries.
GNU General Public License v3.0
1 stars 4 forks source link

'PD_INSTALL_LIBS' acts way too early #16

Closed umlaeute closed 5 months ago

umlaeute commented 5 months ago

if i add -DPD_INSTALL_LIBS=True, i expect that when I run make install (often as superuser) that the libraries are installed. (to be honest, i would expect a make install target to be present and do something similar, even if that flag was not set or False). Obviously for other generators it would be similar (but probably not the same).

Instead, what I get is, that cmake now tries to create directories during configuration stage, which i think is plain wrong.

steps to repdroduce:

mkdir _build
cd _build
cmake .. -DPD_INSTALL_LIBS=True

and it gives me a lot of errors:

-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Pd Install Libs Path: /usr/local/lib/pd-externals
CMake Error at pd.cmake:141 (file):
  file failed to create directory:

    /usr/local/lib/pd-externals

  because: Permission denied
Call Stack (most recent call first):
  pd.cmake:280:EVAL:1 (pd_install_libs)
  Examples/CMakeLists.txt:DEFERRED

CMake Error at pd.cmake:141 (file):
  file failed to create directory:

    /usr/local/lib/pd-externals

  because: Permission denied
Call Stack (most recent call first):
  pd.cmake:280:EVAL:1 (pd_install_libs)
  Examples/CMakeLists.txt:DEFERRED

CMake Error at pd.cmake:141 (file):
  file failed to create directory:

    /usr/local/lib/pd-externals

  because: Permission denied
Call Stack (most recent call first):
  pd.cmake:280:EVAL:1 (pd_install_libs)
  Examples/CMakeLists.txt:DEFERRED

-- Configuring incomplete, errors occurred!
umlaeute commented 5 months ago

also i note that the PD_INSTALL_LIBS is not cached (probably because it acts at configuration time, rather than build/install time) and therefore does not show up in cmake-gui