add_executable(
	NostalgiaStudio WIN32 MACOSX_BUNDLE
		ns.rc
		icondata.cpp
)

target_link_libraries(
	NostalgiaStudio
		NostalgiaProfile
		NostalgiaStudioModules
		NostalgiaKeelModules
		StudioAppLib
		OlympicApplib
)

target_compile_definitions(
	NostalgiaStudio PUBLIC
		OLYMPIC_APP_VERSION="dev build"
)

install(
	TARGETS
		NostalgiaStudio
	RUNTIME DESTINATION
		${NOSTALGIA_DIST_BIN}
	BUNDLE DESTINATION .
)

if(CMAKE_BUILD_TYPE STREQUAL "Release" AND NOT WIN32)
	# enable LTO
	set_property(TARGET NostalgiaStudio PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()

if(APPLE)
	set_target_properties(NostalgiaStudio PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
endif()

install(
	FILES
		ns_logo.icns
	DESTINATION
		${NOSTALGIA_DIST_RESOURCES}/icons
)
