CMakeLists.txt

changeset 252
da4876bfd822
parent 250
2837b549e616
child 253
8b994c917f69
equal deleted inserted replaced
251:94b0a30a1886 252:da4876bfd822
18 find_package(OpenGL REQUIRED) 18 find_package(OpenGL REQUIRED)
19 include_directories(${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR}) 19 include_directories(${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR})
20 include_directories(${GLM_INCLUDE_DIR}) 20 include_directories(${GLM_INCLUDE_DIR})
21 add_definitions(-DQT_NO_KEYWORDS) 21 add_definitions(-DQT_NO_KEYWORDS)
22 source_group("LDForge" REGULAR_EXPRESSION "src/.+\\.(cpp|h|ui)") 22 source_group("LDForge" REGULAR_EXPRESSION "src/.+\\.(cpp|h|ui)")
23
24 qt5_wrap_ui(LDFORGEWIDGETS_FORMS
25 widgets/vec3editor.ui
26 widgets/multiplyfactordialog.ui
27 widgets/matrixeditor.ui
28 )
29 add_library(ldforgewidgets STATIC
30 widgets/matrixeditor.cpp
31 widgets/matrixeditor.h
32 widgets/vec3editor.cpp
33 widgets/vec3editor.h
34 widgets/multiplyfactordialog.cpp
35 widgets/multiplyfactordialog.h
36 ${LDFORGEWIDGETS_FORMS}
37 )
38 target_link_libraries(ldforgewidgets Qt5::Widgets)
23 39
24 set (LDFORGE_SOURCES 40 set (LDFORGE_SOURCES
25 src/colors.cpp 41 src/colors.cpp
26 src/document.cpp 42 src/document.cpp
27 src/documentmanager.cpp 43 src/documentmanager.cpp
47 src/settingseditor/keyboardshortcutseditor.cpp 63 src/settingseditor/keyboardshortcutseditor.cpp
48 src/settingseditor/librarieseditor.cpp 64 src/settingseditor/librarieseditor.cpp
49 src/settingseditor/settingseditor.cpp 65 src/settingseditor/settingseditor.cpp
50 src/types/boundingbox.cpp 66 src/types/boundingbox.cpp
51 src/ui/circletooloptionswidget.cpp 67 src/ui/circletooloptionswidget.cpp
52 src/ui/multiplyfactordialog.cpp
53 src/ui/objecteditor.cpp 68 src/ui/objecteditor.cpp
54 src/widgets/colorbutton.cpp 69 src/widgets/colorbutton.cpp
55 src/widgets/colorindexinput.cpp 70 src/widgets/colorindexinput.cpp
56 src/widgets/colorselectdialog.cpp 71 src/widgets/colorselectdialog.cpp
57 src/widgets/doublespinbox.cpp 72 src/widgets/doublespinbox.cpp
58 src/widgets/matrixeditor.cpp
59 src/widgets/vec3editor.cpp
60 ) 73 )
61 set (LDFORGE_HEADERS 74 set (LDFORGE_HEADERS
62 src/basics.h 75 src/basics.h
63 src/circularprimitive.h 76 src/circularprimitive.h
64 src/colors.h 77 src/colors.h
91 src/settingseditor/keyboardshortcutseditor.h 104 src/settingseditor/keyboardshortcutseditor.h
92 src/settingseditor/librarieseditor.h 105 src/settingseditor/librarieseditor.h
93 src/settingseditor/settingseditor.h 106 src/settingseditor/settingseditor.h
94 src/types/boundingbox.h 107 src/types/boundingbox.h
95 src/ui/circletooloptionswidget.h 108 src/ui/circletooloptionswidget.h
96 src/ui/multiplyfactordialog.h
97 src/ui/objecteditor.h 109 src/ui/objecteditor.h
98 src/widgets/colorbutton.h 110 src/widgets/colorbutton.h
99 src/widgets/colorindexinput.h 111 src/widgets/colorindexinput.h
100 src/widgets/colorselectdialog.h 112 src/widgets/colorselectdialog.h
101 src/widgets/doublespinbox.h 113 src/widgets/doublespinbox.h
102 src/widgets/matrixeditor.h
103 src/widgets/vec3editor.h
104 ) 114 )
105 set (LDFORGE_FORMS 115 set (LDFORGE_FORMS
106 src/mainwindow.ui 116 src/mainwindow.ui
107 src/settingseditor/librarieseditor.ui 117 src/settingseditor/librarieseditor.ui
108 src/settingseditor/settingseditor.ui 118 src/settingseditor/settingseditor.ui
109 src/ui/circletool.ui 119 src/ui/circletool.ui
110 src/ui/multiplyfactordialog.ui
111 src/ui/objecteditor.ui 120 src/ui/objecteditor.ui
112 src/widgets/colorselectdialog.ui 121 src/widgets/colorselectdialog.ui
113 src/widgets/colorindexinput.ui 122 src/widgets/colorindexinput.ui
114 src/widgets/matrixeditor.ui
115 src/widgets/vec3editor.ui
116 ) 123 )
117 124
118 set(LDFORGE_LOCALES 125 set(LDFORGE_LOCALES
119 locale/fi.ts 126 locale/fi.ts
120 locale/sv.ts 127 locale/sv.ts
128 set(CMAKE_CXX_STANDARD 20) 135 set(CMAKE_CXX_STANDARD 20)
129 set(CMAKE_CXX_STANDARD_REQUIRED ON) 136 set(CMAKE_CXX_STANDARD_REQUIRED ON)
130 set(CMAKE_CXX_EXTENSIONS OFF) 137 set(CMAKE_CXX_EXTENSIONS OFF)
131 include_directories("${PROJECT_BINARY_DIR}") 138 include_directories("${PROJECT_BINARY_DIR}")
132 include_directories("${PROJECT_BINARY_DIR}/src") 139 include_directories("${PROJECT_BINARY_DIR}/src")
140 include_directories("${PROJECT_SOURCE_DIR}")
133 include_directories("${PROJECT_SOURCE_DIR}/src") 141 include_directories("${PROJECT_SOURCE_DIR}/src")
134 142
135 # Translations 143 # Translations
136 #qt5_create_translation(QM_FILES ${LDFORGE_SOURCES} ${LDFORGE_HEADERS} ${LDFORGE_FORMS} ${LDFORGE_LOCALES}) 144 #qt5_create_translation(QM_FILES ${LDFORGE_SOURCES} ${LDFORGE_HEADERS} ${LDFORGE_FORMS} ${LDFORGE_LOCALES})
137 #add_custom_target(translations ALL DEPENDS ${QM_FILES}) 145 #add_custom_target(translations ALL DEPENDS ${QM_FILES})
182 set_source_files_properties(${LDFORGE_HEADERS} PROPERTIES HEADER_FILE_ONLY TRUE) 190 set_source_files_properties(${LDFORGE_HEADERS} PROPERTIES HEADER_FILE_ONLY TRUE)
183 set_source_files_properties(${LDFORGE_RESOURCES} PROPERTIES HEADER_FILE_ONLY TRUE) 191 set_source_files_properties(${LDFORGE_RESOURCES} PROPERTIES HEADER_FILE_ONLY TRUE)
184 set_source_files_properties(${LDFORGE_OTHER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) 192 set_source_files_properties(${LDFORGE_OTHER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE)
185 set_target_properties(ldforge PROPERTIES AUTOMOC 1) 193 set_target_properties(ldforge PROPERTIES AUTOMOC 1)
186 target_link_libraries(ldforge Qt5::Widgets Qt5::Network Qt5::OpenGL ${OPENGL_LIBRARIES}) 194 target_link_libraries(ldforge Qt5::Widgets Qt5::Network Qt5::OpenGL ${OPENGL_LIBRARIES})
195 target_link_libraries(ldforge ldforgewidgets)
187 add_dependencies(ldforge resources) 196 add_dependencies(ldforge resources)
188 #cotire(ldforge) 197 #cotire(ldforge)
189 198
190 add_custom_target(linelength ALL 199 add_custom_target(linelength ALL
191 COMMAND python3 200 COMMAND python3

mercurial