-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
139 lines (103 loc) · 5.68 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
cmake_minimum_required(VERSION 3.5)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/Hatchit/cmake")
project(HatchitEditor)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
# Compiler flag
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#Version Info
set(HatchitEditor_VERSION_MAJOR 0)
set(HatchitEditor_VERSION_MINOR 0)
set(HatchitEditor_VERSION_BUILD 1)
set(HatchitEditor_TITLE "HatchitEditor")
configure_file(
"${CMAKE_SOURCE_DIR}/include/editor/ht_editor_version.h.in"
"${CMAKE_SOURCE_DIR}/include/editor/ht_editor_version.h"
)
if(WIN32)
add_subdirectory(Hatchit/)
set (CMAKE_PREFIX_PATH "C:\\Qt\\5.9\\msvc2015_64")
find_package(Qt5 COMPONENTS Core Gui Widgets WebEngine WebEngineWidgets REQUIRED)
include_directories("include"
"include/tools/HStringHasher"
"Hatchit/HatchitCore/include"
"Hatchit/HatchitCore/include/windows"
"Hatchit/HatchitCore/source/inline"
"Hatchit/HatchitGraphics/include"
"Hatchit/HatchitGraphics/include/vulkan"
"Hatchit/HatchitGame/include"
SYSTEM
"Hatchit/ThirdParty/inih/"
"Hatchit/ThirdParty/cppformat/cppformat"
"Hatchit/ThirdParty/json/src/"
"Hatchit/ThirdParty/stb")
link_directories("Hatchit/ThirdParty/lib/glfw/lib/$(Configuration)")
file(GLOB HT_EDITOR_INC include/*.h)
file(GLOB HT_EDITOR_SRC source/*.cpp)
file(GLOB HT_EDITOR_QRC source/HatchitEditor.qrc)
file(GLOB HT_STRINGHASHER_INC include/tools/HStringHasher/*.h)
file(GLOB HT_STRINGHASHER_SRC source/tools/HStringHasher/*.cpp)
add_executable(HEditor WIN32 ${HT_EDITOR_INC} ${HT_EDITOR_SRC} ${HT_EDITOR_QRC})
add_executable(HStringHasher WIN32 ${HT_STRINGHASHER_INC} ${HT_STRINGHASHER_SRC})
add_custom_command(TARGET HEditor POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${PROJECT_SOURCE_DIR}/stylesheets/HatchitEditor.qss $<TARGET_FILE_DIR:HEditor>)
add_custom_command(TARGET HEditor POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${PROJECT_SOURCE_DIR}/LICENSE.GPLv3 $<TARGET_FILE_DIR:HEditor>)
target_link_libraries(HStringHasher Qt5::Core Qt5::WinMain Qt5::Widgets Qt5::Gui Qt5::WebEngine Qt5::WebEngineWidgets HatchitCore)
target_link_libraries(HEditor Qt5::Core Qt5::WinMain Qt5::Widgets Qt5::Gui Qt5::WebEngine Qt5::WebEngineWidgets HatchitCore HatchitGraphics HatchitGame)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
set_target_properties(HEditor HStringHasher
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
set_target_properties(HStringHasher PROPERTIES FOLDER Tools)
elseif(UNIX)
add_subdirectory(Hatchit/)
set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH} ~/Qt/5.8/gcc_64/")
find_package(Qt5 COMPONENTS Core Gui Widgets WebEngine WebEngineWidgets REQUIRED)
find_package(PythonLibs REQUIRED)
include_directories("include"
"include/editor"
"include/python"
"include/tools/HStringHasher"
"Hatchit/HatchitCore/include"
"Hatchit/HatchitCore/include/linux"
"Hatchit/HatchitCore/source/inline"
"Hatchit/HatchitGraphics/include"
"Hatchit/HatchitGraphics/include/vulkan"
"Hatchit/HatchitGame/include"
SYSTEM
"Hatchit/ThirdParty/inih/"
"Hatchit/ThirdParty/cppformat/cppformat"
"Hatchit/ThirdParty/json/src/"
"Hatchit/ThirdParty/stb"
"Hatchit/ThirdParty/pybind11/include"
${PYTHON_INCLUDE_DIR})
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
add_subdirectory("${CMAKE_SOURCE_DIR}/Hatchit/ThirdParty/pybind11")
add_subdirectory("${CMAKE_SOURCE_DIR}/cmake/python")
file(GLOB HT_EDITOR_INC include/*.h include/editor/*.h)
file(GLOB HT_EDITOR_SRC source/*.cpp source/editor/*.cpp)
file(GLOB HT_EDITOR_QRC source/editor/HatchitEditor.qrc)
file(GLOB HT_STRINGHASHER_INC include/tools/HStringHasher/*.h)
file(GLOB HT_STRINGHASHER_SRC source/tools/HStringHasher/*.cpp)
add_executable(HEditor ${HT_EDITOR_INC} ${HT_EDITOR_SRC} ${HT_EDITOR_QRC})
add_executable(HStringHasher ${HT_STRINGHASHER_INC} ${HT_STRINGHASHER_SRC})
add_custom_command(TARGET HEditor HStringHasher POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${PROJECT_SOURCE_DIR}/stylesheets/HatchitEditor.qss $<TARGET_FILE_DIR:HEditor>)
add_custom_command(TARGET HEditor HStringHasher POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${PROJECT_SOURCE_DIR}/LICENSE.GPLv3 $<TARGET_FILE_DIR:HEditor>)
target_link_libraries(HEditor ${PYTHON_LIBRARY} hpy Qt5::Core Qt5::Widgets Qt5::Gui Qt5::WebEngine Qt5::WebEngineWidgets HatchitCore HatchitGraphics HatchitGame)
target_link_libraries(HStringHasher Qt5::Core Qt5::Widgets Qt5::Gui Qt5::WebEngine Qt5::WebEngineWidgets HatchitCore pthread)
set_target_properties(HEditor HStringHasher
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
install (TARGETS HEditor HStringHasher DESTINATION bin)
install (DIRECTORY ${CMAKE_SOURCE_DIR}/icons DESTINATION bin)
install (FILES ${CMAKE_SOURCE_DIR}/stylesheets/HatchitEditor.qss DESTINATION bin)
endif()