← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] Don't reference CMAKE_INSTALL_PREFIX in installation paths

 

On 4/29/2018 6:09 AM, Marvin Schmidt wrote:
> On Sat, Apr 28, 2018 at 09:56:48PM +0200, Simon Richter wrote:
>>
>> This is substituted at configuration time, creating an absolute path, which
>> breaks overriding CMAKE_INSTALL_PREFIX at installation time, breaking the
>> workflow for installation using GNU stow.
>> ---
>>  CMakeLists.txt | 10 +++++-----
>>  1 file changed, 5 insertions(+), 5 deletions(-)
>>
> 
>> diff --git a/CMakeLists.txt b/CMakeLists.txt
>> index 1ef7c344d..d74ac52fd 100644
>> --- a/CMakeLists.txt
>> +++ b/CMakeLists.txt
>> @@ -431,7 +431,7 @@ if( NOT APPLE )
>>  else()
>>      # everything without leading / is relative to CMAKE_INSTALL_PREFIX.
>>      # CMAKE_INSTALL_PREFIX is root of .dmg image
>> -    set( KICAD_BIN ${CMAKE_INSTALL_PREFIX}
>> +    set( KICAD_BIN "."
>>          CACHE PATH "Location of KiCad binaries." FORCE )
>>  
>>      # some paths to single app bundle
>> @@ -861,25 +861,25 @@ if( UNIX AND NOT APPLE )
>>  
>>      # Install Mime directory
>>      install( DIRECTORY ${UNIX_ICON_FILES}
>> -        DESTINATION ${CMAKE_INSTALL_PREFIX}/share
>> +        DESTINATION share
>>          COMPONENT resources
>>          )
>>  
>>      # Install Icons
>>      install( DIRECTORY ${UNIX_MIME_FILES}
>> -        DESTINATION ${CMAKE_INSTALL_PREFIX}/share
>> +        DESTINATION share
>>          COMPONENT resources
>>          )
>>  
>>      # Install Applications directory (.desktop files)
>>      install( DIRECTORY ${UNIX_APPLICATIONS_FILES}
>> -        DESTINATION ${CMAKE_INSTALL_PREFIX}/share
>> +        DESTINATION share
>>          COMPONENT resources
>>          )
>>  
>>      # Install AppStream directory (app store entry)
>>      install( DIRECTORY ${UNIX_APPDATA_FILES}
>> -        DESTINATION ${CMAKE_INSTALL_PREFIX}/share
>> +        DESTINATION share
>>          COMPONENT resources
>>          )
>>  endif()
> 
> Could we use the appropriate GNUInstallDirs variables instead?
> Using relative paths like `share` doesn't play very nice in scenarios
> where `datarootdir` is not ${prefix}/share. On Exherbo for example
> we support targeting multiple architectures and for that
> architecture-dependent stuff is installed into /usr/${CHOST}/{bin,lib,include}
> and architecture-independent things into /usr/share.
> `DESTINATION share` and CMAKE_INSTALL_PREFIX=/usr/${CHOST} will result
> in data being installed into /usr/${CHOST}/share which we try to prevent
> 
> Best regards

I'm not sure GNUInstallDir wont break all other platform installs so I'm
a bit reluctant to use it this close to v5 release.  We certainly take a
look at it for v6.  Is there some way to force GNUInstallDirs at config
time on the cmake command line?

> 
>> _______________________________________________
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp
> 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 


Follow ups

References