46 if (NOT MSVC) |
56 if (NOT MSVC) |
47 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -W -Wall") |
57 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -W -Wall") |
48 endif() |
58 endif() |
49 |
59 |
50 include_directories ("${PROJECT_BINARY_DIR}") |
60 include_directories ("${PROJECT_BINARY_DIR}") |
|
61 include_directories ("${PROJECT_SOURCE_DIR}/src") |
51 include_directories ("${PROJECT_BINARY_DIR}/src") |
62 include_directories ("${PROJECT_BINARY_DIR}/src") |
|
63 include_directories ("${PROJECT_SOURCE_DIR}/src-common") |
|
64 include_directories ("${PROJECT_BINARY_DIR}/src-common") |
|
65 include_directories ("${PROJECT_SOURCE_DIR}/src-config") |
|
66 include_directories ("${PROJECT_BINARY_DIR}/src-config") |
52 |
67 |
53 if (USE_QT5) |
68 if (USE_QT5) |
54 qt5_generate_moc (ZCINEMA_MOC ${ZCINEMA_HEADERS}) |
69 qt5_generate_moc (ZCINEMA_MOC ${ZCINEMA_HEADERS}) |
55 qt5_add_resources (ZCINEMA_QRC ${ZCINEMA_RESOURCES}) |
70 qt5_add_resources (ZCINEMA_QRC ${ZCINEMA_RESOURCES}) |
56 qt5_wrap_ui (ZCINEMA_FORMS_HEADERS ${ZCINEMA_FORMS}) |
71 qt5_wrap_ui (ZCINEMA_FORMS_HEADERS ${ZCINEMA_FORMS}) |
57 add_executable (${PROJECT_NAME} WIN32 ${ZCINEMA_SOURCES} ${ZCINEMA_HEADERS} ${ZCINEMA_MOC} |
72 |
58 ${ZCINEMA_QRC} ${ZCINEMA_FORMS_HEADERS}) |
73 add_library (${PROJECT_NAME}-common STATIC |
|
74 ${ZCINEMA_COMMON_SOURCES} |
|
75 ${ZCINEMA_MOC} |
|
76 ${ZCINEMA_QRC} |
|
77 ${ZCINEMA_FORMS_HEADERS}) |
59 else() |
78 else() |
60 qt4_wrap_cpp (ZCINEMA_MOC ${ZCINEMA_HEADERS}) |
79 qt4_wrap_cpp (ZCINEMA_MOC ${ZCINEMA_HEADERS}) |
61 qt4_wrap_ui (ZCINEMA_FORMS_HEADERS ${ZCINEMA_FORMS}) |
80 qt4_wrap_ui (ZCINEMA_FORMS_HEADERS ${ZCINEMA_FORMS}) |
62 qt4_add_resources (ZCINEMA_RCC ${ZCINEMA_RESOURCES}) |
81 qt4_add_resources (ZCINEMA_RCC ${ZCINEMA_RESOURCES}) |
63 add_executable (${PROJECT_NAME} WIN32 ${ZCINEMA_SOURCES} ${ZCINEMA_HEADERS} ${ZCINEMA_RCC} |
82 |
64 ${ZCINEMA_FORMS_HEADERS} ${ZCINEMA_MOC}) |
83 add_library (${PROJECT_NAME}-common STATIC |
|
84 ${ZCINEMA_COMMON_SOURCES} |
|
85 ${ZCINEMA_MOC} |
|
86 ${ZCINEMA_RCC} |
|
87 ${ZCINEMA_FORMS_HEADERS}) |
65 endif() |
88 endif() |
66 |
89 |
|
90 add_executable (${PROJECT_NAME} WIN32 ${ZCINEMA_SOURCES}) |
|
91 add_executable (${PROJECT_NAME}-config WIN32 ${ZCINEMA_CONFIG_SOURCES}) |
|
92 |
67 if (USE_QT5) |
93 if (USE_QT5) |
68 target_link_libraries (${PROJECT_NAME} Qt5::Widgets Qt5::Network Qt5::OpenGL ${OPENGL_LIBRARIES}) |
94 target_link_libraries (${PROJECT_NAME}-common Qt5::Widgets) |
69 else() |
95 else() |
70 target_link_libraries (${PROJECT_NAME} |
96 target_link_libraries (${PROJECT_NAME}-common ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY}) |
71 ${QT_QTCORE_LIBRARY} |
|
72 ${QT_QTGUI_LIBRARY} |
|
73 ${QT_QTNETWORK_LIBRARY} |
|
74 ${QT_QTOPENGL_LIBRARY} |
|
75 ${OPENGL_LIBRARIES} |
|
76 ) |
|
77 endif() |
97 endif() |
|
98 |
|
99 target_link_libraries (${PROJECT_NAME} ${PROJECT_NAME}-common) |
|
100 target_link_libraries (${PROJECT_NAME}-config ${PROJECT_NAME}-common) |
78 |
101 |
79 add_custom_target (make_hginfo |
102 add_custom_target (make_hginfo |
80 COMMAND python |
103 COMMAND python |
81 "${CMAKE_SOURCE_DIR}/updaterevision.py" |
104 "${CMAKE_SOURCE_DIR}/updaterevision.py" |
82 "${CMAKE_CURRENT_BINARY_DIR}/hginfo.h" |
105 "${CMAKE_CURRENT_BINARY_DIR}/hginfo.h" |
83 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
106 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
84 |
107 |
85 add_dependencies (${PROJECT_NAME} make_hginfo) |
108 add_dependencies (${PROJECT_NAME}-common make_hginfo) |
86 |
109 |
87 # With clang, we need to set -Wno-deprecated since Qt headers seem to use the register keyword |
110 # 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. |
111 # which clang doesn't seem to like. |
89 if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") |
112 if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") |
90 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") |
113 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated") |