On Linux the following instructions work to build avogadro as a non-root user:
git clone --recursive git://github.com/cryos/avogadro-squared.git
mkdir build
cd build
cmake ../avogadro-squared
make
but on OSX 'make' fails because it wants to write files to /Applications:
-- Installing: /Applications/Avogadro.app/Contents/Resources/AvogadroConfig.cmake
CMake Error at cmake_install.cmake:31 (FILE):
file INSTALL cannot copy file
"/Users/andy/build/avogadro/build/avogadro/AvogadroConfig.cmake" to
"/Applications/Avogadro.app/Contents/Resources/AvogadroConfig.cmake".
it appears the file 'avogadro/AvogadroConfig.cmake' is responsible since it contains lines such as:
set(Avogadro_INSTALL_PREFIX "/Applications/Avogadro.app/Contents")
whereas when building on Linux it contains:
set(Avogadro_INSTALL_PREFIX "/home/andy/build/prefix")
Shouldn't the behaviour be the same on OSX as Linux, i.e. install the files under the build directory? It's not normal to require root permissions until 'make install' step. Or is there a way to change the Avogadro_INSTALL_PREFIX via the command line? Using either or both of these made no difference:
cmake ../avogadro-squared -DCMAKE_INSTALL_PREFIX=/some/path
make CMAKE_INSTALL_PREFIX=/some/path
The behavior is that "make install" installs into an appropriate system directory by default. On Mac, this is /Applications - that doesn't require root access, but does require that you're an administrative user.