Mercurial > minori
comparison CMakeLists.txt @ 12:cf6a73a5ba1c
cmake: fix for mingw
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Mon, 18 Sep 2023 23:40:11 -0400 |
parents | fc1bf97c528b |
children | cde8f67a7c7d |
comparison
equal
deleted
inserted
replaced
11:fc1bf97c528b | 12:cf6a73a5ba1c |
---|---|
1 cmake_minimum_required(VERSION 3.16) | 1 cmake_minimum_required(VERSION 3.16) |
2 project(minori LANGUAGES CXX OBJCXX) | 2 project(minori LANGUAGES CXX OBJCXX) |
3 | 3 |
4 add_subdirectory(dep/anitomy) | 4 add_subdirectory(dep/anitomy) |
5 | |
6 # Fix for mingw64 | |
7 list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".a") | |
8 | |
9 find_package(Qt5 COMPONENTS Widgets REQUIRED) | |
10 find_package(CURL REQUIRED) | |
11 | |
12 set(LIBRARIES | |
13 ${Qt5Widgets_LIBRARIES} | |
14 ${CURL_LIBRARIES} | |
15 anitomy | |
16 ) | |
17 | |
18 # We need Cocoa for some OS X stuff | |
19 if(APPLE) | |
20 find_library(COCOA_LIBRARY Cocoa) | |
21 list(APPEND LIBRARIES ${COCOA_LIBRARY}) | |
22 endif() | |
5 | 23 |
6 set(SRC_FILES | 24 set(SRC_FILES |
7 # Main entrypoint | 25 # Main entrypoint |
8 src/main.cpp | 26 src/main.cpp |
9 | 27 |
53 elseif(WIN32) # Windows | 71 elseif(WIN32) # Windows |
54 list(APPEND SRC_FILES src/sys/win32/dark_theme.cpp) | 72 list(APPEND SRC_FILES src/sys/win32/dark_theme.cpp) |
55 endif() | 73 endif() |
56 | 74 |
57 add_executable(minori ${SRC_FILES}) | 75 add_executable(minori ${SRC_FILES}) |
58 set_property(TARGET minori PROPERTY CXX_STANDARD 11) | 76 set_property(TARGET minori PROPERTY CXX_STANDARD 20) |
59 set_property(TARGET minori PROPERTY AUTOMOC ON) | 77 set_property(TARGET minori PROPERTY AUTOMOC ON) |
60 set_property(TARGET minori PROPERTY AUTORCC ON) | 78 set_property(TARGET minori PROPERTY AUTORCC ON) |
61 | 79 |
62 find_package(Qt5 COMPONENTS Widgets Test REQUIRED) | 80 target_include_directories(minori PUBLIC ${Qt5Widgets_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS} PRIVATE include) |
63 find_package(CURL REQUIRED) | |
64 | |
65 set(LIBRARIES | |
66 ${Qt5Widgets_LIBRARIES} | |
67 ${Qt5Test_LIBRARIES} | |
68 ${CURL_LIBRARIES} | |
69 anitomy | |
70 ) | |
71 | |
72 if(APPLE) | |
73 find_library(COCOA_LIBRARY Cocoa) | |
74 list(APPEND LIBRARIES ${COCOA_LIBRARY}) | |
75 endif() | |
76 | |
77 target_include_directories(minori PUBLIC ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Test_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS} PRIVATE include) | |
78 target_compile_options(minori PRIVATE -Wall -Wextra -Wsuggest-override) | 81 target_compile_options(minori PRIVATE -Wall -Wextra -Wsuggest-override) |
79 if(APPLE) | 82 if(APPLE) |
80 target_compile_definitions(minori PUBLIC MACOSX) | 83 target_compile_definitions(minori PUBLIC MACOSX) |
81 elseif(WIN32) | 84 elseif(WIN32) |
82 target_compile_definitions(minori PUBLIC WIN32) | 85 target_compile_definitions(minori PUBLIC WIN32) |