[CMake] MSYS Makefiles generator problem with install/strip
Hendrik Sattler
post at hendrik-sattler.de
Thu Jun 2 14:32:16 EDT 2016
Hi,
Am 2. Juni 2016 19:23:26 MESZ, schrieb Robert Bielik <Robert.Bielik at dirac.com>:
>Hi Hendrik,
>
>
>
>I think I do, yes. Would this not be a normal use case, specifically on
>Linux, where the bin library would be /usr/bin? How would that work
>with relative paths?
Installation is always relative to CMAKE_INSTALL_PREFIX. On Linux, this defaults to /usr/local. Using the variables from GNUInstallDirs module saves you lots of trouble like library locations on Debian or Rehat.
It's actually pretty simple and only very special cases differ from this.
>I think it would be a bug if install cannot handle arbitrary paths.
The problem is the drive letter of the absolute path that can hardly be concatenated with a staging folder that you can define with DESTDIR like
make install DESTDIR=mystagedir
and the files go to their relative locations in
<DESTDIR>/<CMAKE_INSTALL_PREFIX>/
You gain a lot more flexibility by adopting this than hard encoding path in the install() commands.
>I'll try though to see if I can work around this... behavior...
Regards,
HS
>------ Ursprungligt meddelande------
>
>Från: Hendrik Sattler
>
>Datum: tors, 2 jun 2016 19:16
>
>Till: Robert Bielik;cmake at cmake.org;
>
>Ämne:Re: [CMake] MSYS Makefiles generator problem with install/strip
>
>
>
>Hi,
>
>Are you using absolute paths in your install() commands? You better
>don't.
>
>HS
>
>
>Am 2. Juni 2016 16:25:33 MESZ, schrieb Robert Bielik
><Robert.Bielik at dirac.com>:
>>Hi,
>>
>>I have a problem with the install/strip target not working when using
>>the MSYS Makefiles generator. I get the following result in
>>cmake_install.cmake:
>>
>>file(INSTALL DESTINATION
>>"c:/Dev/appAndroid/idrclib/src/main/jniLibs/armeabi-v7a" TYPE
>>SHARED_LIBRARY FILES "C:/Dev/jniAndroid/libapi_native.so")
>>if(EXISTS
>>"$ENV{DESTDIR}/c:/Dev/appAndroid/idrclib/src/main/jniLibs/armeabi-v7a/libapi_native.so
>>" AND
>>NOT IS_SYMLINK
>>"$ENV{DESTDIR}/c:/Dev/appAndroid/idrclib/src/main/jniLibs/armeabi-v7a/libapi_native.so")
>> if(CMAKE_INSTALL_DO_STRIP)
>>execute_process(COMMAND
>>"C:/android/android-ndk-r11c/standalone/arm/bin/arm-linux-androideabi-strip.exe"
>>"$ENV{DESTDIR}/c:/Dev/appAndroid/idrclib/src/main/jniLibs/armeabi-v7a/libapi_native.so")
>> endif()
>> endif()
>>endif()
>>
>>The above should instead look like:
>>
>>file(INSTALL DESTINATION
>>"c:/Dev/appAndroid/idrclib/src/main/jniLibs/armeabi-v7a" TYPE
>>SHARED_LIBRARY FILES "C:/Dev/jniAndroid/libapi_native.so")
>>if(EXISTS
>>"c:/Dev/appAndroid/idrclib/src/main/jniLibs/armeabi-v7a/libapi_native.so"
>>AND
>>NOT IS_SYMLINK
>>"c:/Dev/appAndroid/idrclib/src/main/jniLibs/armeabi-v7a/libapi_native.so")
>> if(CMAKE_INSTALL_DO_STRIP)
>>execute_process(COMMAND
>>"C:/android/android-ndk-r11c/standalone/arm/bin/arm-linux-androideabi-strip.exe"
>>"c:/Dev/appAndroid/idrclib/src/main/jniLibs/armeabi-v7a/libapi_native.so")
>> endif()
>> endif()
>>endif()
>>
>>Then the install/strip target works.
>>
>>Regards
>>/Robert
>
>--
>Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail
>gesendet.
>
>
>------------------------------------------------------------------------
--
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
More information about the CMake
mailing list