comparison CMakeLists.txt @ 62:4c6dd5999b39

*: update 1. updated animia 2. use widestrings for filesystem on Windows
author Paper <mrpapersonic@gmail.com>
date Sun, 01 Oct 2023 06:16:06 -0400
parents 3c802806b74a
children 3d2decf093bb
comparison
equal deleted inserted replaced
61:327568ad9be9 62:4c6dd5999b39
6 if(APPLE) 6 if(APPLE)
7 enable_language(OBJCXX) 7 enable_language(OBJCXX)
8 endif() 8 endif()
9 9
10 add_subdirectory(dep/anitomy) 10 add_subdirectory(dep/anitomy)
11 add_subdirectory(dep/animia) 11 # add_subdirectory(dep/animia)
12 add_subdirectory(dep/pugixml) 12 add_subdirectory(dep/pugixml)
13 13
14 # Fix for mingw64 14 # Fix for mingw64
15 list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".a") 15 list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".a")
16 16
17 find_package(Qt5 COMPONENTS Widgets REQUIRED) 17 if(USE_QT6)
18 find_package(Qt6 COMPONENTS Widgets REQUIRED)
19 else()
20 find_package(Qt5 COMPONENTS Widgets REQUIRED)
21 endif()
18 find_package(CURL REQUIRED) 22 find_package(CURL REQUIRED)
19 23
20 set(LIBRARIES 24 set(LIBRARIES
21 ${Qt5Widgets_LIBRARIES}
22 ${CURL_LIBRARIES} 25 ${CURL_LIBRARIES}
23 anitomy 26 anitomy
24 animia
25 ) 27 )
28
29 if(USE_QT6)
30 list(APPEND LIBRARIES ${Qt6Widgets_LIBRARIES})
31 else()
32 list(APPEND LIBRARIES ${Qt5Widgets_LIBRARIES})
33 endif()
26 34
27 # We need Cocoa for some OS X stuff 35 # We need Cocoa for some OS X stuff
28 if(APPLE) 36 if(APPLE)
29 find_library(COCOA_LIBRARY Cocoa) 37 find_library(COCOA_LIBRARY Cocoa)
30 list(APPEND LIBRARIES ${COCOA_LIBRARY}) 38 list(APPEND LIBRARIES ${COCOA_LIBRARY})
96 # There's a bug in JFMC++ that keeps me from setting this to C++11. 104 # There's a bug in JFMC++ that keeps me from setting this to C++11.
97 set_property(TARGET minori PROPERTY CXX_STANDARD 17) 105 set_property(TARGET minori PROPERTY CXX_STANDARD 17)
98 set_property(TARGET minori PROPERTY AUTOMOC ON) 106 set_property(TARGET minori PROPERTY AUTOMOC ON)
99 set_property(TARGET minori PROPERTY AUTORCC ON) 107 set_property(TARGET minori PROPERTY AUTORCC ON)
100 108
101 target_include_directories(minori PUBLIC ${Qt5Widgets_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS} PRIVATE include dep/pugixml/src) 109 target_include_directories(minori PUBLIC ${CURL_INCLUDE_DIRS} PRIVATE include dep/pugixml/src dep/animia/include)
110 if(USE_QT6)
111 target_include_directories(minori PUBLIC ${Qt6Widgets_INCLUDE_DIRS})
112 else()
113 target_include_directories(minori PUBLIC ${Qt5Widgets_INCLUDE_DIRS})
114 endif()
102 target_compile_options(minori PRIVATE -Wall -Wextra -Wsuggest-override) 115 target_compile_options(minori PRIVATE -Wall -Wextra -Wsuggest-override)
103 if(APPLE) 116 if(APPLE)
104 target_compile_definitions(minori PUBLIC MACOSX) 117 target_compile_definitions(minori PUBLIC MACOSX)
105 elseif(WIN32) 118 elseif(WIN32)
106 target_compile_definitions(minori PUBLIC WIN32) 119 target_compile_definitions(minori PUBLIC WIN32)