build np2kai w/ sdl2 on mac 2022-03-16
$ brew install cmake ninja sdl2 sdl2_mixer sdl2_ttf libusb # ninja is needed ???
$ git clone https://github.com/AZO234/NP2kai.git
$ cd NP2kai
$ mkdir build
$ vi ../CMakeLists.txt
$ cmake .. -D BUILD_SDL=ON # fails, but try again
:
$ cmake .. -D BUILD_SDL=ON
:
$ ls -l Makefile # finally, makefile will be created
$ make -j
index 68f2009..84bd786 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -365,6 +365,8 @@ if(USE_ASYNCCPU)
list(APPEND NP2kai_AsyncCPU_definitions "SUPPORT_ASYNC_CPU")
endif()
+ #set(SDL_INCLUDE_DIR "/usr/local/include/SDL")
+
if(NOT CMAKE_CROSSCOMPILING)
# math
@@ -385,6 +387,7 @@ if(NOT CMAKE_CROSSCOMPILING)
message(FATAL_ERROR "-- Not found SDL")
endif()
endif()
+ set(SDL2_INCLUDE_DIR "/usr/local/include/SDL2")
find_path(SDL2_CMAKE "FindSDL2.cmake" "cmake/sdl2-cmake-scripts")
if(NOT SDL2_CMAKE)
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive ${NP2kai_SOURCE_DIR}/cmake/sdl2-cmake-modules)
@@ -427,6 +430,8 @@ if(NOT CMAKE_CROSSCOMPILING)
message(FATAL_ERROR "-- Not found SDL_mixer")
endif()
endif()
+ set(SDL2_INCLUDE_DIR "/usr/local/include/SDL2")
+ find_path(SDL2_CMAKE "FindSDL2.cmake" "cmake/sdl2-cmake-scripts")
find_package(SDL2_mixer)
if(USE_SDL_MIXER AND (USE_SDL_VERSION EQUAL 2))
if(NOT SDL2_mixer_FOUND)
screen size, volume menu grayed out