-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
91 lines (77 loc) · 3.28 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
cmake_minimum_required(VERSION 3.16)
project(StdFuncs)
if(MSVC)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS _WINSOCK_DEPRECATED_NO_WARNINGS)
add_compile_options(/EHsc /W4)
else()
add_compile_options(-fno-asynchronous-unwind-tables -Wall -Wextra)
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_definitions(_DEBUG MUNGWALL_NO_LINE_TRACKING)
endif()
set(SourceFiles "Args.cpp")
set(SourceFiles ${SourceFiles} "Dir.cpp")
set(SourceFiles ${SourceFiles} "File.cpp")
set(SourceFiles ${SourceFiles} "FileUtils.cpp")
set(SourceFiles ${SourceFiles} "Lex.cpp")
set(SourceFiles ${SourceFiles} "MungWall.cpp")
set(SourceFiles ${SourceFiles} "StdConfigFile.cpp")
set(SourceFiles ${SourceFiles} "StdCRC.cpp")
set(SourceFiles ${SourceFiles} "StdPool.cpp")
set(SourceFiles ${SourceFiles} "StdRendezvous.cpp")
set(SourceFiles ${SourceFiles} "StdSocket.cpp")
set(SourceFiles ${SourceFiles} "StdStringList.cpp")
set(SourceFiles ${SourceFiles} "StdTextFile.cpp")
set(SourceFiles ${SourceFiles} "StdTime.cpp")
set(SourceFiles ${SourceFiles} "StdWildcard.cpp")
set(SourceFiles ${SourceFiles} "Test.cpp")
set(SourceFiles ${SourceFiles} "Utils.cpp")
set(SourceFiles ${SourceFiles} "Yggdrasil/Handler.cpp")
find_package(Qt6 COMPONENTS Core Core5Compat Gui)
if(${Qt6_FOUND} EQUAL 1)
message(STATUS "Configuring using Qt6 directory ${Qt6_DIR}")
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(SourceFiles ${SourceFiles} "StdApplication.cpp")
set(SourceFiles ${SourceFiles} "RemoteDir.cpp")
set(SourceFiles ${SourceFiles} "RemoteFactory.cpp")
set(SourceFiles ${SourceFiles} "RemoteFile.cpp")
set(SourceFiles ${SourceFiles} "RemoteFileUtils.cpp")
set(SourceFiles ${SourceFiles} "StdCharConverter.cpp")
set(SourceFiles ${SourceFiles} "StdClipboard.cpp")
set(SourceFiles ${SourceFiles} "StdDialog.cpp")
set(SourceFiles ${SourceFiles} "StdFileRequester.cpp")
set(SourceFiles ${SourceFiles} "StdFont.cpp")
set(SourceFiles ${SourceFiles} "StdGadgetLayout.cpp")
set(SourceFiles ${SourceFiles} "StdGadgets.cpp")
set(SourceFiles ${SourceFiles} "StdGadgetSlider.cpp")
set(SourceFiles ${SourceFiles} "StdGadgetStatusBar.cpp")
set(SourceFiles ${SourceFiles} "StdGadgetTree.cpp")
set(SourceFiles ${SourceFiles} "StdImage.cpp")
set(SourceFiles ${SourceFiles} "StdWindow.cpp")
set(SourceFiles ${SourceFiles} "Qt/QtAction.cpp")
set(SourceFiles ${SourceFiles} "Qt/QtGadgetSlider.cpp")
set(SourceFiles ${SourceFiles} "Qt/QtGadgetTree.cpp")
set(SourceFiles ${SourceFiles} "Qt/QtLocalSocket.cpp")
set(SourceFiles ${SourceFiles} "Qt/QtWindow.cpp")
add_library(StdFuncs ${SourceFiles})
add_compile_definitions(QT_GUI_LIB)
target_link_libraries(StdFuncs Qt6::Core Qt6::Core5Compat Qt6::Gui)
else()
message(STATUS "Qt6 not found, configuring basic build")
add_library(StdFuncs ${SourceFiles})
endif()
target_include_directories(StdFuncs PUBLIC ".")
set_property(TARGET StdFuncs PROPERTY CXX_STANDARD 14)
set_property(TARGET StdFuncs PROPERTY CXX_STANDARD_REQUIRED ON)
if(USE_CLANG_TIDY)
find_program(ClangTidy NAMES "clang-tidy")
if(ClangTidy)
message(STATUS "Found clang-tidy as ${ClangTidy}")
set(RunClangTidy ${ClangTidy})
set_target_properties(StdFuncs PROPERTIES C_CLANG_TIDY "${RunClangTidy}" CXX_CLANG_TIDY "${RunClangTidy}")
else()
message(STATUS "clang-tidy not found, so will not be used")
endif()
endif()