* Dmitry Marakasov (amdmi3@hades.panopticon) wrote:

> Anyway for now, I did some research and solved the problem of inplace
> vs. systemwide compilation in a way that I find acceptable.
> 
> I check for CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT to basically
> know whether a user has explicitly specified CMAKE_INSTALL_PREFIX.
> If user specified install prefix, I prepare for systemwide install,
> otherwise I prepare for inplace run.
> 
> https://github.com/AMDmi3/hoverboard-sdl/blob/0.4.0/CMakeLists.txt
> 
> This doesn't support inplace and systemwide /at the same time/, but
> still supports either of them cleanly, doesn't require extra actions
> from user and behaves sensibly by default.

Wanted to add that this doesn't really work well. When cmake is run
second time, it always switches to systemwide installation because of
cache. I think I'll go with adding explicit SYSTEMWIDE and STANDALONE
options, former builds for systemwide installation with global paths,
and latter for installation into self-contained directory with local
paths (e.g. for windows/macos), and if neither is specified the
project runs from the build directory.

I don't see any better solution right now.

-- 
Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
amd...@amdmi3.ru  ..:  jabber: amd...@jabber.ru      http://amdmi3.ru
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to