Sat, 06 Jun 2015 23:12:59 +0300
Renamed the src* directories into commonlib/, config/ and launcher/
| 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 | ||
| 
46
 
07578e081ae8
Renamed the src* directories into commonlib/, config/ and launcher/
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
44 
diff
changeset
 | 
16 | set (ZCINEMA_LAUNCHER_SOURCES | 
| 
 
07578e081ae8
Renamed the src* directories into commonlib/, config/ and launcher/
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
44 
diff
changeset
 | 
17 | launcher/demo.cpp | 
| 
 
07578e081ae8
Renamed the src* directories into commonlib/, config/ and launcher/
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
44 
diff
changeset
 | 
18 | launcher/main.cpp | 
| 
 
07578e081ae8
Renamed the src* directories into commonlib/, config/ and launcher/
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
44 
diff
changeset
 | 
19 | launcher/prompts.cpp | 
| 36 | 20 | ) | 
| 21 | ||
| 
44
 
d0bf58f3560f
Split the project into two executables (the launcher and the configurator)
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
43 
diff
changeset
 | 
22 | set (ZCINEMA_COMMON_SOURCES | 
| 
46
 
07578e081ae8
Renamed the src* directories into commonlib/, config/ and launcher/
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
44 
diff
changeset
 | 
23 | commonlib/config.cpp | 
| 
 
07578e081ae8
Renamed the src* directories into commonlib/, config/ and launcher/
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
44 
diff
changeset
 | 
24 | commonlib/misc.cpp | 
| 
 
07578e081ae8
Renamed the src* directories into commonlib/, config/ and launcher/
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
44 
diff
changeset
 | 
25 | commonlib/version.cpp | 
| 
44
 
d0bf58f3560f
Split the project into two executables (the launcher and the configurator)
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
43 
diff
changeset
 | 
26 | ) | 
| 
 
d0bf58f3560f
Split the project into two executables (the launcher and the configurator)
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
43 
diff
changeset
 | 
27 | |
| 
 
d0bf58f3560f
Split the project into two executables (the launcher and the configurator)
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
43 
diff
changeset
 | 
28 | set (ZCINEMA_CONFIG_SOURCES | 
| 
46
 
07578e081ae8
Renamed the src* directories into commonlib/, config/ and launcher/
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
44 
diff
changeset
 | 
29 | config/configwindow.cpp | 
| 
 
07578e081ae8
Renamed the src* directories into commonlib/, config/ and launcher/
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
44 
diff
changeset
 | 
30 | config/addversionprompt.cpp | 
| 
 
07578e081ae8
Renamed the src* directories into commonlib/, config/ and launcher/
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
44 
diff
changeset
 | 
31 | config/main.cpp | 
| 
44
 
d0bf58f3560f
Split the project into two executables (the launcher and the configurator)
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
43 
diff
changeset
 | 
32 | ) | 
| 
 
d0bf58f3560f
Split the project into two executables (the launcher and the configurator)
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
43 
diff
changeset
 | 
33 | |
| 36 | 34 | set (ZCINEMA_HEADERS | 
| 
46
 
07578e081ae8
Renamed the src* directories into commonlib/, config/ and launcher/
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
44 
diff
changeset
 | 
35 | commonlib/config.h | 
| 
 
07578e081ae8
Renamed the src* directories into commonlib/, config/ and launcher/
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
44 
diff
changeset
 | 
36 | commonlib/misc.h | 
| 
 
07578e081ae8
Renamed the src* directories into commonlib/, config/ and launcher/
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
44 
diff
changeset
 | 
37 | commonlib/types.h | 
| 
 
07578e081ae8
Renamed the src* directories into commonlib/, config/ and launcher/
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
44 
diff
changeset
 | 
38 | commonlib/version.h | 
| 
 
07578e081ae8
Renamed the src* directories into commonlib/, config/ and launcher/
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
44 
diff
changeset
 | 
39 | config/addversionprompt.h | 
| 
 
07578e081ae8
Renamed the src* directories into commonlib/, config/ and launcher/
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
44 
diff
changeset
 | 
40 | config/configwindow.h | 
| 
 
07578e081ae8
Renamed the src* directories into commonlib/, config/ and launcher/
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
44 
diff
changeset
 | 
41 | launcher/demo.h | 
| 
 
07578e081ae8
Renamed the src* directories into commonlib/, config/ and launcher/
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
44 
diff
changeset
 | 
42 | launcher/prompts.h | 
| 36 | 43 | ) | 
| 44 | ||
| 45 | set (ZCINEMA_FORMS | |
| 46 | ui/findfile.ui | |
| 47 | ui/demoprompt.ui | |
| 48 | ui/unknownversion.ui | |
| 49 | ui/configbox.ui | |
| 50 | ui/addversion.ui | |
| 51 | ) | |
| 52 | ||
| 53 | set (ZCINEMA_RESOURCES zcinema.qrc) | |
| 54 | ||
| 55 | if (NOT MSVC) | |
| 56 | set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -W -Wall") | |
| 57 | endif() | |
| 58 | ||
| 59 | include_directories ("${PROJECT_BINARY_DIR}") | |
| 
46
 
07578e081ae8
Renamed the src* directories into commonlib/, config/ and launcher/
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
44 
diff
changeset
 | 
60 | include_directories ("${PROJECT_SOURCE_DIR}") | 
| 36 | 61 | |
| 62 | if (USE_QT5) | |
| 63 | qt5_generate_moc (ZCINEMA_MOC ${ZCINEMA_HEADERS}) | |
| 64 | qt5_add_resources (ZCINEMA_QRC ${ZCINEMA_RESOURCES}) | |
| 65 | qt5_wrap_ui (ZCINEMA_FORMS_HEADERS ${ZCINEMA_FORMS}) | |
| 
44
 
d0bf58f3560f
Split the project into two executables (the launcher and the configurator)
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
43 
diff
changeset
 | 
66 | |
| 
 
d0bf58f3560f
Split the project into two executables (the launcher and the configurator)
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
43 
diff
changeset
 | 
67 | add_library (${PROJECT_NAME}-common STATIC | 
| 
 
d0bf58f3560f
Split the project into two executables (the launcher and the configurator)
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
43 
diff
changeset
 | 
68 | ${ZCINEMA_COMMON_SOURCES} | 
| 
 
d0bf58f3560f
Split the project into two executables (the launcher and the configurator)
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
43 
diff
changeset
 | 
69 | ${ZCINEMA_MOC} | 
| 
 
d0bf58f3560f
Split the project into two executables (the launcher and the configurator)
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
43 
diff
changeset
 | 
70 | ${ZCINEMA_QRC} | 
| 
 
d0bf58f3560f
Split the project into two executables (the launcher and the configurator)
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
43 
diff
changeset
 | 
71 | ${ZCINEMA_FORMS_HEADERS}) | 
| 36 | 72 | else() | 
| 73 | qt4_wrap_cpp (ZCINEMA_MOC ${ZCINEMA_HEADERS}) | |
| 74 | qt4_wrap_ui (ZCINEMA_FORMS_HEADERS ${ZCINEMA_FORMS}) | |
| 75 | qt4_add_resources (ZCINEMA_RCC ${ZCINEMA_RESOURCES}) | |
| 
44
 
d0bf58f3560f
Split the project into two executables (the launcher and the configurator)
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
43 
diff
changeset
 | 
76 | |
| 
 
d0bf58f3560f
Split the project into two executables (the launcher and the configurator)
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
43 
diff
changeset
 | 
77 | add_library (${PROJECT_NAME}-common STATIC | 
| 
 
d0bf58f3560f
Split the project into two executables (the launcher and the configurator)
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
43 
diff
changeset
 | 
78 | ${ZCINEMA_COMMON_SOURCES} | 
| 
 
d0bf58f3560f
Split the project into two executables (the launcher and the configurator)
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
43 
diff
changeset
 | 
79 | ${ZCINEMA_MOC} | 
| 
 
d0bf58f3560f
Split the project into two executables (the launcher and the configurator)
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
43 
diff
changeset
 | 
80 | ${ZCINEMA_RCC} | 
| 
 
d0bf58f3560f
Split the project into two executables (the launcher and the configurator)
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
43 
diff
changeset
 | 
81 | ${ZCINEMA_FORMS_HEADERS}) | 
| 36 | 82 | endif() | 
| 83 | ||
| 
46
 
07578e081ae8
Renamed the src* directories into commonlib/, config/ and launcher/
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
44 
diff
changeset
 | 
84 | add_executable (${PROJECT_NAME} WIN32 ${ZCINEMA_LAUNCHER_SOURCES}) | 
| 
44
 
d0bf58f3560f
Split the project into two executables (the launcher and the configurator)
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
43 
diff
changeset
 | 
85 | add_executable (${PROJECT_NAME}-config WIN32 ${ZCINEMA_CONFIG_SOURCES}) | 
| 
 
d0bf58f3560f
Split the project into two executables (the launcher and the configurator)
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
43 
diff
changeset
 | 
86 | |
| 36 | 87 | if (USE_QT5) | 
| 
44
 
d0bf58f3560f
Split the project into two executables (the launcher and the configurator)
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
43 
diff
changeset
 | 
88 | target_link_libraries (${PROJECT_NAME}-common Qt5::Widgets) | 
| 36 | 89 | else() | 
| 
44
 
d0bf58f3560f
Split the project into two executables (the launcher and the configurator)
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
43 
diff
changeset
 | 
90 | target_link_libraries (${PROJECT_NAME}-common ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}) | 
| 36 | 91 | endif() | 
| 92 | ||
| 
44
 
d0bf58f3560f
Split the project into two executables (the launcher and the configurator)
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
43 
diff
changeset
 | 
93 | target_link_libraries (${PROJECT_NAME} ${PROJECT_NAME}-common) | 
| 
 
d0bf58f3560f
Split the project into two executables (the launcher and the configurator)
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
43 
diff
changeset
 | 
94 | target_link_libraries (${PROJECT_NAME}-config ${PROJECT_NAME}-common) | 
| 
 
d0bf58f3560f
Split the project into two executables (the launcher and the configurator)
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
43 
diff
changeset
 | 
95 | |
| 
40
 
809a75a7113b
Added updaterevision.py, use it for hg info
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
37 
diff
changeset
 | 
96 | add_custom_target (make_hginfo | 
| 
 
809a75a7113b
Added updaterevision.py, use it for hg info
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
37 
diff
changeset
 | 
97 | COMMAND python | 
| 
 
809a75a7113b
Added updaterevision.py, use it for hg info
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
37 
diff
changeset
 | 
98 | "${CMAKE_SOURCE_DIR}/updaterevision.py" | 
| 
 
809a75a7113b
Added updaterevision.py, use it for hg info
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
37 
diff
changeset
 | 
99 | "${CMAKE_CURRENT_BINARY_DIR}/hginfo.h" | 
| 
 
809a75a7113b
Added updaterevision.py, use it for hg info
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
37 
diff
changeset
 | 
100 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) | 
| 
 
809a75a7113b
Added updaterevision.py, use it for hg info
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
37 
diff
changeset
 | 
101 | |
| 
44
 
d0bf58f3560f
Split the project into two executables (the launcher and the configurator)
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
43 
diff
changeset
 | 
102 | add_dependencies (${PROJECT_NAME}-common make_hginfo) | 
| 
40
 
809a75a7113b
Added updaterevision.py, use it for hg info
 
Teemu Piippo <crimsondusk64@gmail.com> 
parents: 
37 
diff
changeset
 | 
103 | |
| 36 | 104 | # With clang, we need to set -Wno-deprecated since Qt headers seem to use the register keyword | 
| 105 | # which clang doesn't seem to like. | |
| 106 | if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") | |
| 107 | set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") | |
| 108 | endif() | |
| 109 | ||
| 110 | install (TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin) |