set(CMAKE_INCLUDE_CURRENT_DIR ON)

add_executable(
	nostalgia-studio MACOSX_BUNDLE
		aboutpopup.cpp
		builtinmodules.cpp
        clawviewer.cpp
		filedialogmanager.cpp
		main.cpp
		newmenu.cpp
		projectexplorer.cpp
		projecttreemodel.cpp
		studioapp.cpp
)

target_link_libraries(
	nostalgia-studio
		OxClArgs
		OxLogConn
		NostalgiaAppModules
		NostalgiaStudio
		NostalgiaCore-Studio
		NostalgiaScene-Studio
)

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
)

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

add_subdirectory(lib)
