view CMakeLists.txt @ 11:fc1bf97c528b

*: use C++11 standard I've been meaning to do this for a while, but I didn't want to reimplement the filesystem code. Now we are on C++11 and most compilers from the past 5 centuries should support this now
author Paper <mrpapersonic@gmail.com>
date Sun, 17 Sep 2023 06:14:30 -0400
parents 4b198a111713
children cf6a73a5ba1c
line wrap: on
line source

cmake_minimum_required(VERSION 3.16)
project(minori LANGUAGES CXX OBJCXX)

add_subdirectory(dep/anitomy)

set(SRC_FILES
	# Main entrypoint
	src/main.cpp

	# Core files and datatype declarations...
	src/core/anime.cpp
	src/core/anime_db.cpp
	src/core/config.cpp
	src/core/date.cpp
	src/core/filesystem.cpp
	src/core/json.cpp
	src/core/strings.cpp
	src/core/time.cpp

	# GUI stuff
	src/gui/window.cpp
	src/gui/sidebar.cpp
	src/gui/ui_utils.cpp

	# Dialogs
	src/gui/dialog/information.cpp
	src/gui/dialog/settings.cpp
	src/gui/dialog/settings/application.cpp
	src/gui/dialog/settings/services.cpp

	# Main window pages
	src/gui/pages/anime_list.cpp
	src/gui/pages/now_playing.cpp
	src/gui/pages/statistics.cpp

	# Translate
	src/gui/translate/anime.cpp

	# Services (only AniList for now)
	src/services/services.cpp
	src/services/anilist.cpp

	# Qt resources
	rc/icons.qrc
	dep/darkstyle/darkstyle.qrc
)

if(APPLE) # Mac OS X (or OS X (or macOS))
	list(APPEND SRC_FILES
		src/sys/osx/dark_theme.mm
		src/sys/osx/filesystem.mm
	)
elseif(WIN32) # Windows
	list(APPEND SRC_FILES src/sys/win32/dark_theme.cpp)
endif()

add_executable(minori ${SRC_FILES})
set_property(TARGET minori PROPERTY CXX_STANDARD 11)
set_property(TARGET minori PROPERTY AUTOMOC ON)
set_property(TARGET minori PROPERTY AUTORCC ON)

find_package(Qt5 COMPONENTS Widgets Test REQUIRED)
find_package(CURL REQUIRED)

set(LIBRARIES
	${Qt5Widgets_LIBRARIES}
	${Qt5Test_LIBRARIES}
	${CURL_LIBRARIES}
	anitomy
)

if(APPLE)
	find_library(COCOA_LIBRARY Cocoa)
	list(APPEND LIBRARIES ${COCOA_LIBRARY})
endif()

target_include_directories(minori PUBLIC ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Test_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS} PRIVATE include)
target_compile_options(minori PRIVATE -Wall -Wextra -Wsuggest-override)
if(APPLE)
	target_compile_definitions(minori PUBLIC MACOSX)
elseif(WIN32)
	target_compile_definitions(minori PUBLIC WIN32)
endif()
target_link_libraries(minori ${LIBRARIES})