Adds an regexpEdit toolbar
[qregexp-editor:qregexp-editor.git] / src / CMakeLists.txt
1 include_directories(
2    ${CMAKE_CURRENT_SOURCE_DIR}
3    ${CMAKE_CURRENT_BINARY_DIR}
4    "${CMAKE_CURRENT_BINARY_DIR}/preferences"
5 )
6
7
8 file(GLOB HEADER_FILES *.h *.hpp)
9 file(GLOB CPP_FILES *.cpp)
10 file(GLOB UI_FILES *.ui)
11 set(FILES_TO_TRANSLATE ${FILES_TO_TRANSLATE} ${CPP_FILES} ${UI_FILES} ${HEADER_FILES} PARENT_SCOPE)
12
13 list(APPEND preferences_SRCS
14    preferences/preferencesdialog.cpp
15    preferences/settingsinterface.cpp
16    preferences/settingsinterface.h
17    preferences/regexpoptions.cpp
18    preferences/regexpsettings.cpp
19 )
20
21 list(APPEND preferences_UIs
22    preferences/preferencesdialog.ui
23 )
24
25 list(APPEND preferences_MOC_HDRS
26    preferences/preferencesdialog.h
27    preferences/regexpsettings.h
28 )
29
30 list(APPEND qregexp-editor_SRCS
31    ${preferences_SRCS}
32    regexptextedit.cpp
33    regexptextedit_p.cpp
34    parentheseshighlighter.cpp
35    qregexp_editor-version.cpp
36    node.cpp
37    regexpmodel.cpp
38    treeitem.cpp
39    searchdata.cpp
40    searchsettings.cpp
41    mainwindow.cpp
42    escapedpatterndialog.cpp
43    aboutdialog.cpp
44    main.cpp
45 )
46
47 set(qregexp-editor_UIs
48    ${preferences_UIs}
49    ui/aboutdialog.ui
50    ui/escapedpatterndialog.ui
51    ui/mainwindow.ui
52 )
53
54 set(qregexp-editor_MOC_HDRS
55    ${preferences_MOC_HDRS}
56    parentheseshighlighter.h
57    aboutdialog.h
58    escapedpatterndialog.h
59    mainwindow.h
60    regexpmodel.h
61 )
62
63 set(qregexp-editor_RCCS
64    ../application.qrc
65 )
66
67 # generate rules for building source files from the resources
68 qt4_add_resources(qregexp-editor_RCC_SRCS ${qregexp-editor_RCCS})
69
70 qt4_wrap_ui(qregexp-editor_SRCS ${qregexp-editor_UIs})
71 qt4_wrap_cpp(qregexp-editor_SRCS ${qregexp-editor_MOC_HDRS})
72
73 qt4_generate_moc(
74    ${CMAKE_CURRENT_SOURCE_DIR}/regexptextedit.h
75    ${CMAKE_CURRENT_BINARY_DIR}/regexptextedit.moc
76 )
77 qt4_generate_moc(
78    ${CMAKE_CURRENT_SOURCE_DIR}/preferences/settingsinterface.h
79    ${CMAKE_CURRENT_BINARY_DIR}/preferences/settingsinterface.moc
80 )
81
82 list(APPEND manual_MOC_SRCS
83    "regexptextedit.moc"
84    "preferences/settingsinterface.moc"
85
86 )
87
88 if(APPLE)
89    set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${QREGEXP-EDITOR_VERSION})
90    set(MACOSX_BUNDLE_VERSION ${QREGEXP-EDITOR_VERSION})
91    set(MACOSX_BUNDLE_LONG_VERSION_STRING "Version ${QREGEXP-EDITOR_VERSION}")
92    set(CMAKE_OSX_ARCHITECTURES "i386")
93 endif(APPLE)
94
95 add_executable(
96    ${PROGRAM_NAME}
97    WIN32
98    MACOSX_BUNDLE
99    ${qregexp-editor_SRCS}
100    ${manual_MOC_SRCS}
101    ${qregexp-editor_RCC_SRCS}
102 )
103
104 target_link_libraries(${PROGRAM_NAME} ${QT_LIBRARIES})
105
106 install(TARGETS ${PROGRAM_NAME} DESTINATION bin)
107 add_dependencies(${PROGRAM_NAME} translations)