jszczerbinsky / lwp

Multi-platform parallax wallpaper engine
MIT License
898 stars 12 forks source link

Add CMake and MSVC support #48

Closed mshockwave closed 1 year ago

mshockwave commented 1 year ago

This PR adds CMake support as an alternative building method for all supported platforms / toolchains. As a bonus, we can now build on Windows with MSVC 🎉 (I'd tested with VS2019).

Here are the limitations:

  1. On Windows, the path to SDL2 cmake config file has to be manually assigned through command line (i.e. -Dsdl2_DIR=...)
  2. Even if you're using MSVC (on Windows), it still depends on Mingw version of SDL2, since it has a different include folder hierarchy than the SDL2 for MSVC.
  3. On Mac OSX, due to the fact that user can change the install prefix (i.e. CMAKE_INSTALL_PREFIX) basically anytime, it's hard to materialize lwp.plist until installation time, and thus makes it difficult to model install-launchd as a build target like what Makefile does. As a workaround, if the user wants to install to launchd, they have to set LWP_INSTALL_LAUNCHD variable to ON (either during configuration time or installation time via, says cmake_install.cmake).
mshockwave commented 1 year ago

UPDATE: just updated the README to include CMake instructions.

jszczerbinsky commented 1 year ago

It looks useful, give me few days, I will test it when I have some time