Sat, 06 Jun 2015 22:28:34 +0300
Renamed cfg.cpp/h to config.cpp/h
36 | 1 | project (zcinema) |
2 | cmake_minimum_required (VERSION 2.6) | |
3 | ||
4 | if (USE_QT5) | |
5 | find_package (Qt5Widgets REQUIRED) | |
6 | find_package (Qt5Core REQUIRED) | |
7 | find_package (Qt5OpenGL REQUIRED) | |
8 | find_package (Qt5Network REQUIRED) | |
9 | set (CMAKE_AUTOMOC ON) | |
10 | else() | |
11 | find_package (Qt4 REQUIRED) | |
12 | endif() | |
13 | ||
14 | include_directories (${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR}) | |
15 | ||
16 | set (ZCINEMA_SOURCES | |
43
1394901b557a
Renamed cfg.cpp/h to config.cpp/h
Teemu Piippo <crimsondusk64@gmail.com>
parents:
42
diff
changeset
|
17 | src/config.cpp |
42
9528f8d06962
rename config.cpp/h to configwindow.cpp/h
Teemu Piippo <crimsondusk64@gmail.com>
parents:
40
diff
changeset
|
18 | src/configwindow.cpp |
36 | 19 | src/demo.cpp |
20 | src/main.cpp | |
21 | src/misc.cpp | |
22 | src/prompts.cpp | |
23 | ) | |
24 | ||
25 | set (ZCINEMA_HEADERS | |
43
1394901b557a
Renamed cfg.cpp/h to config.cpp/h
Teemu Piippo <crimsondusk64@gmail.com>
parents:
42
diff
changeset
|
26 | src/config.h |
42
9528f8d06962
rename config.cpp/h to configwindow.cpp/h
Teemu Piippo <crimsondusk64@gmail.com>
parents:
40
diff
changeset
|
27 | src/configwindow.h |
36 | 28 | src/demo.h |
29 | src/main.h | |
30 | src/misc.h | |
31 | src/prompts.h | |
32 | src/types.h | |
33 | ) | |
34 | ||
35 | set (ZCINEMA_FORMS | |
36 | ui/findfile.ui | |
37 | ui/demoprompt.ui | |
38 | ui/unknownversion.ui | |
39 | ui/versionEditor.ui | |
40 | ui/configbox.ui | |
41 | ui/addversion.ui | |
42 | ) | |
43 | ||
44 | set (ZCINEMA_RESOURCES zcinema.qrc) | |
45 | ||
46 | if (NOT MSVC) | |
47 | set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -W -Wall") | |
48 | endif() | |
49 | ||
50 | include_directories ("${PROJECT_BINARY_DIR}") | |
51 | include_directories ("${PROJECT_BINARY_DIR}/src") | |
52 | ||
53 | if (USE_QT5) | |
54 | qt5_generate_moc (ZCINEMA_MOC ${ZCINEMA_HEADERS}) | |
55 | qt5_add_resources (ZCINEMA_QRC ${ZCINEMA_RESOURCES}) | |
56 | qt5_wrap_ui (ZCINEMA_FORMS_HEADERS ${ZCINEMA_FORMS}) | |
42
9528f8d06962
rename config.cpp/h to configwindow.cpp/h
Teemu Piippo <crimsondusk64@gmail.com>
parents:
40
diff
changeset
|
57 | add_executable (${PROJECT_NAME} WIN32 ${ZCINEMA_SOURCES} ${ZCINEMA_HEADERS} ${ZCINEMA_MOC} |
36 | 58 | ${ZCINEMA_QRC} ${ZCINEMA_FORMS_HEADERS}) |
59 | else() | |
60 | qt4_wrap_cpp (ZCINEMA_MOC ${ZCINEMA_HEADERS}) | |
61 | qt4_wrap_ui (ZCINEMA_FORMS_HEADERS ${ZCINEMA_FORMS}) | |
62 | qt4_add_resources (ZCINEMA_RCC ${ZCINEMA_RESOURCES}) | |
42
9528f8d06962
rename config.cpp/h to configwindow.cpp/h
Teemu Piippo <crimsondusk64@gmail.com>
parents:
40
diff
changeset
|
63 | add_executable (${PROJECT_NAME} WIN32 ${ZCINEMA_SOURCES} ${ZCINEMA_HEADERS} ${ZCINEMA_RCC} |
36 | 64 | ${ZCINEMA_FORMS_HEADERS} ${ZCINEMA_MOC}) |
65 | endif() | |
66 | ||
67 | if (USE_QT5) | |
68 | target_link_libraries (${PROJECT_NAME} Qt5::Widgets Qt5::Network Qt5::OpenGL ${OPENGL_LIBRARIES}) | |
69 | else() | |
70 | target_link_libraries (${PROJECT_NAME} | |
71 | ${QT_QTCORE_LIBRARY} | |
72 | ${QT_QTGUI_LIBRARY} | |
73 | ${QT_QTNETWORK_LIBRARY} | |
74 | ${QT_QTOPENGL_LIBRARY} | |
75 | ${OPENGL_LIBRARIES} | |
76 | ) | |
77 | endif() | |
78 | ||
40
809a75a7113b
Added updaterevision.py, use it for hg info
Teemu Piippo <crimsondusk64@gmail.com>
parents:
37
diff
changeset
|
79 | add_custom_target (make_hginfo |
809a75a7113b
Added updaterevision.py, use it for hg info
Teemu Piippo <crimsondusk64@gmail.com>
parents:
37
diff
changeset
|
80 | COMMAND python |
809a75a7113b
Added updaterevision.py, use it for hg info
Teemu Piippo <crimsondusk64@gmail.com>
parents:
37
diff
changeset
|
81 | "${CMAKE_SOURCE_DIR}/updaterevision.py" |
809a75a7113b
Added updaterevision.py, use it for hg info
Teemu Piippo <crimsondusk64@gmail.com>
parents:
37
diff
changeset
|
82 | "${CMAKE_CURRENT_BINARY_DIR}/hginfo.h" |
809a75a7113b
Added updaterevision.py, use it for hg info
Teemu Piippo <crimsondusk64@gmail.com>
parents:
37
diff
changeset
|
83 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
809a75a7113b
Added updaterevision.py, use it for hg info
Teemu Piippo <crimsondusk64@gmail.com>
parents:
37
diff
changeset
|
84 | |
809a75a7113b
Added updaterevision.py, use it for hg info
Teemu Piippo <crimsondusk64@gmail.com>
parents:
37
diff
changeset
|
85 | add_dependencies (${PROJECT_NAME} make_hginfo) |
809a75a7113b
Added updaterevision.py, use it for hg info
Teemu Piippo <crimsondusk64@gmail.com>
parents:
37
diff
changeset
|
86 | |
36 | 87 | # With clang, we need to set -Wno-deprecated since Qt headers seem to use the register keyword |
88 | # which clang doesn't seem to like. | |
89 | if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") | |
90 | set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") | |
91 | endif() | |
92 | ||
93 | install (TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin) |