On 13/8/22 10:01, Albrecht Schlosser wrote:
> On 8/13/22 13:23 Gonzalo Garramuno wrote:
>> When running the compilation of fltk thru ExternalProject_Add() cmake
>> will try to install fluid into the /Applications/ directory and it
>> will fail due to lack of permissions unless run as root user.
>>
>> -- Up-to-date: /Applications/
fluid.app
>> CMake Error at fluid/cmake_install.cmake:49 (file):
>> file INSTALL cannot set permissions on "/Applications/
fluid.app":
>> Operation
>> not permitted.
>> Call Stack (most recent call first):
>> cmake_install.cmake:105 (include)
>
> OK, I understand the words, but I believe we need more context. What
> exactly are the steps you do when this happens? Could you please
> provide a full CMakeLists.txt with a demo (hello world) file that uses
> this technique and describe the commands you use so we (I) can test?
CMakeLists.txt
---------------------
cmake_minimum_required(VERSION 3.10)
# Use extraction timestamps
if( NOT CMAKE_VERSION LESS 3.24.0 )
cmake_policy( SET CMP0135 NEW )
endif()
#
# Run this file by calling runme.sh - NOT cmake
#
project( Dependencies )
# use, i.e. don't skip the full RPATH for the build tree
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
# when building, don't use the install RPATH already
# (but later on when installing)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
# the RPATH to be used when installing
SET(CMAKE_INSTALL_RPATH "")
set( CMAKE_MAKEFILE_VERBOSE 1 )
# Many Build Libraries here, then we get to:
include( BuildFLTK.cmake )
BuildFLTK.cmake
------------------------
Include( ExternalProject )
ExternalProject_Add(
FLTK
GIT_REPOSITORY "
https://github.com/fltk/fltk.git"
GIT_PROGRESS 1
CMAKE_ARGS
-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
# this is done, in case fltk looks for libraries like libcairo which was
compiled previously and installed in
# INSTALL_PREFIX.
-DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-DFLTK_BUILD_EXAMPLES=OFF
-DFLTK_BUILD_TEST=OFF
-DOPTION_BUILD_SHARED_LIBS=0
-DOPTION_USE_SYSTEM_ZLIB=0
-DOPTION_USE_SYSTEM_LIBJPEG=0
-DOPTION_USE_SYSTEM_LIBPNG=0)
I call cmake, with:
cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/install
The problem is that while it works fine on Windows and Linux on macOS
the INSTALL_PREFIX is not respected and fluid is dumped into
Applications directly, instead of in $PWD/install/bin.
--
Gonzalo Garramuño
ggar...@gmail.com