1 project (zcinema) |
1 project (zcinema) |
2 cmake_minimum_required (VERSION 2.6) |
2 cmake_minimum_required (VERSION 2.6) |
3 cmake_policy (SET CMP0020 NEW) |
3 cmake_policy (SET CMP0020 NEW) |
4 find_package (Qt5Widgets REQUIRED) |
4 find_package (Qt5Widgets REQUIRED) |
5 find_package (Qt5Core REQUIRED) |
5 find_package (Qt5Core REQUIRED) |
6 |
6 find_package (Python COMPONENTS Interpreter) |
7 include_directories (${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR}) |
7 include_directories (${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR}) |
8 |
8 |
9 set (ZCINEMA_LAUNCHER_SOURCES |
9 set (ZCINEMA_LAUNCHER_SOURCES |
10 launcher/demo.cpp |
10 launcher/demo.cpp |
11 launcher/main.cpp |
11 launcher/main.cpp |
75 target_link_libraries (${PROJECT_NAME}-common Qt5::Widgets) |
75 target_link_libraries (${PROJECT_NAME}-common Qt5::Widgets) |
76 target_link_libraries (${PROJECT_NAME} ${PROJECT_NAME}-common) |
76 target_link_libraries (${PROJECT_NAME} ${PROJECT_NAME}-common) |
77 target_link_libraries (${PROJECT_NAME}-config ${PROJECT_NAME}-common) |
77 target_link_libraries (${PROJECT_NAME}-config ${PROJECT_NAME}-common) |
78 |
78 |
79 add_custom_target (make_hginfo |
79 add_custom_target (make_hginfo |
80 COMMAND python |
80 COMMAND ${Python_EXECUTABLE} |
81 "${CMAKE_SOURCE_DIR}/updaterevision.py" |
81 "${CMAKE_SOURCE_DIR}/updaterevision.py" |
82 "${CMAKE_CURRENT_BINARY_DIR}/hginfo.h" |
82 "${CMAKE_CURRENT_BINARY_DIR}/hginfo.h" |
83 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
83 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
84 |
84 |
85 add_dependencies (${PROJECT_NAME}-common make_hginfo) |
85 add_dependencies (${PROJECT_NAME}-common make_hginfo) |
86 set_target_properties (${PROJECT_NAME} PROPERTIES AUTOMOC 1) |
86 set_target_properties (${PROJECT_NAME} PROPERTIES AUTOMOC 1) |
87 set_target_properties (${PROJECT_NAME}-config PROPERTIES AUTOMOC 1) |
87 set_target_properties (${PROJECT_NAME}-config PROPERTIES AUTOMOC 1) |
88 |
88 |
89 # With clang, we need to set -Wno-deprecated since Qt headers seem to use the register keyword |
89 # With clang, we need to set -Wno-deprecated since Qt headers seem to use the register keyword |
90 # which clang doesn't seem to like. |
90 # which clang doesn't seem to like. |
91 if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") |
91 if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") |
92 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") |
92 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") |
93 endif() |
93 endif() |
94 |
94 |
95 install (TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin) |
95 install (TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin) |