add_executable(nostalgia-studio WIN32 MACOSX_BUNDLE)

target_link_libraries(
	nostalgia-studio
		NostalgiaProfile
		NostalgiaStudioModules
		NostalgiaKeelModules
		StudioAppLib
		OlympicApplib
)

install(
	TARGETS
		nostalgia-studio
	RUNTIME DESTINATION
		${NOSTALGIA_DIST_BIN}
	BUNDLE DESTINATION .
)

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

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

install(
	FILES
		ns_logo128.png
	DESTINATION
		${NOSTALGIA_DIST_RESOURCES}/icons
)
