Re: [hatari-devel] How to include EmuTOS in Hatari.app when building it yourself on macOS?

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hello Thomas,

> On 29. Jun 2025, at 13:57, Thomas Huth <th.huth@xxxxxxxxx> wrote:
> 
> Hi Frank,
> 
> since tos.img is optional, I think we'd rather need something like this:

Ah, OK. I know next to nothing about CMake  and did not know that it would fail if the tos.img wasn’t in the source folder with the way I changed the CMakeLists.txt. Thanks for taking a look at this and updating the patch to make it work.

> diff a/src/CMakeLists.txt b/src/CMakeLists.txt
> --- a/src/CMakeLists.txt
> +++ b/src/CMakeLists.txt
> @@ -18,6 +18,8 @@ endif()
> # Disk image code is shared with the hmsa tool, so we put it into a library:
> add_library(Floppy createBlankImage.c dim.c msa.c st.c zip.c utils.c)
> 
> +file(GLOB TOS_IMG_FILE tos.img LIST_DIRECTORIES false)
> +
> # When building for macOS, define specific sources for gui and resources
> if(ENABLE_OSX_BUNDLE)
> 	set(GUIOSX_SOURCES
> @@ -25,7 +27,8 @@ if(ENABLE_OSX_BUNDLE)
> 	    gui-osx/CreateFloppyController.m gui-osx/SDLMain.m gui-osx/paths.m)
> 	set_source_files_properties(${GUIOSX_SOURCES} PROPERTIES LANGUAGE C)
> 	set(GUIOSX_RSRCS
> -	    Hatari.icns gui-osx/stdisk.png gui-osx/en.lproj gui-osx/fr.lproj)
> +	    Hatari.icns gui-osx/stdisk.png gui-osx/en.lproj gui-osx/fr.lproj
> +	    ${TOS_IMG_FILE})
> 	set(GUIOSX_DOCS
> 	    ${CMAKE_SOURCE_DIR}/doc/manual.html ${CMAKE_SOURCE_DIR}/doc/images
> 	    ${CMAKE_SOURCE_DIR}/doc/compatibility.html ${CMAKE_SOURCE_DIR}/doc/toc.js )
> @@ -271,8 +274,7 @@ if(ENABLE_OSX_BUNDLE)
> else()
> 	install(TARGETS ${APP_NAME} RUNTIME DESTINATION ${BINDIR})
> 	install(FILES hatari-icon.bmp DESTINATION ${DATADIR})
> -	file(GLOB TOS_IMG_FILE tos.img)
> 	if(TOS_IMG_FILE)
> -		install(FILES tos.img DESTINATION ${DATADIR})
> +		install(FILES ${TOS_IMG_FILE} DESTINATION ${DATADIR})
> 	endif(TOS_IMG_FILE)
> endif(ENABLE_OSX_BUNDLE)
> 
> Could you please check whether that works on macOS, too?

Yes, it works. 

With your patch it is possible to build Hatari on macOS using CMake with or without having the tos.img in the src directory. 

And if the tos.img is in the src directory it is included in the built Hatari.app.

Thanks again for taking a look at this.

Regards,
Frank






Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/