@@ -25,9 +25,12 @@ if(MSYS)
2525 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMSYS_PROCESS_USE_SH" )
2626endif ()
2727
28- INCLUDE (FindPkgConfig )
29-
3028find_package (LibClang REQUIRED )
29+ find_package (Boost 1.54 COMPONENTS thread log regex system filesystem REQUIRED )
30+ find_package (ASPELL REQUIRED )
31+ set (LIBCLANGMM_INCLUDE_DIR ../libclangmm/src)
32+ set (TINY_PROCESS_INCLUDE_DIR ../tiny-process-library)
33+
3134string (REPLACE libclang liblldb LIBLLDB_LIBRARIES "${LIBCLANG_LIBRARIES} " )
3235if (EXISTS "${LIBLLDB_LIBRARIES} " )
3336 set (LIBLLDB_FOUND TRUE )
@@ -41,129 +44,101 @@ else()
4144 set (LIBLLDB_LIBRARIES "" )
4245 message ("liblldb not found. Building juCi++ without debugging support" )
4346endif ()
44- #find_package(PythonLibs 2.7)
45-
46- #find_package(Boost 1.55 COMPONENTS python thread log system filesystem REQUIRED)
47- find_package (Boost 1.54 COMPONENTS thread log system filesystem regex REQUIRED )
48-
49- pkg_check_modules (GTKMM gtkmm-3.0 REQUIRED ) # The name GTKMM is set here for the variables abouve
5047
48+ include (FindPkgConfig )
49+ pkg_check_modules (GTKMM gtkmm-3.0 REQUIRED )
5150pkg_check_modules (GTKSVMM gtksourceviewmm-3.0 REQUIRED )
5251
53- find_package (ASPELL REQUIRED )
52+ set (global_includes
53+ ${Boost_INCLUDE_DIRS}
54+ ${GTKMM_INCLUDE_DIRS}
55+ ${GTKSVMM_INCLUDE_DIRS}
56+ ${LIBCLANG_INCLUDE_DIRS}
57+ ${LIBCLANGMM_INCLUDE_DIR}
58+ ${ASPELL_INCLUDE_DIR}
59+ ${TINY_PROCESS_INCLUDE_DIR}
60+ )
5461
55- set (source_files juci.h
56- juci.cc
57- menu.h
58- menu.cc
59- source.h
60- source.cc
61- source_clang.h
62- source_clang.cc
63- selectiondialog.h
64- selectiondialog.cc
65- config.h
62+ set (global_libraries
63+ ${LIBCLANG_LIBRARIES}
64+ ${GTKMM_LIBRARIES}
65+ ${GTKSVMM_LIBRARIES}
66+ ${Boost_LIBRARIES}
67+ ${ASPELL_LIBRARIES}
68+ ${LIBLLDB_LIBRARIES}
69+ )
70+
71+ set (project_files
72+ cmake.cc
73+ cmake.h
6674 config.cc
67- filesystem.h
68- filesystem.cc
69- window.cc
70- window.h
75+ config.h
76+ dialogs.cc
7177 dialogs.h
72- # api.h
73- # api.cc
78+ directories.cc
79+ directories.h
80+ dispatcher.cc
81+ dispatcher.h
82+ entrybox.cc
83+ entrybox.h
84+ files.h
85+ filesystem.cc
86+ filesystem.h
87+ juci.cc
88+ juci.h
89+ logging.h
90+ menu.cc
91+ menu.h
7492 notebook.cc
7593 notebook.h
76- entrybox.h
77- entrybox.cc
78- directories.h
79- directories.cc
80- terminal.h
81- terminal.cc
82- tooltips.h
83- tooltips.cc
84- cmake.h
85- cmake.cc
86- dialogs.cc
87- project.h
8894 project.cc
95+ project.h
8996 project_build.h
9097 project_build.cc
91- dispatcher.h
92- dispatcher.cc
93-
98+ selectiondialog.cc
99+ selectiondialog.h
100+ source.cc
101+ source.h
102+ source_clang.cc
103+ source_clang.h
104+ terminal.cc
105+ terminal.h
106+ tooltips.cc
107+ tooltips.h
108+ window.cc
109+ window.h
110+
94111 ../libclangmm/src/CodeCompleteResults.cc
95112 ../libclangmm/src/CompilationDatabase.cc
96113 ../libclangmm/src/CompileCommand.cc
97114 ../libclangmm/src/CompileCommands.cc
98115 ../libclangmm/src/CompletionString.cc
99116 ../libclangmm/src/Cursor.cc
117+ ../libclangmm/src/Diagnostic.cc
100118 ../libclangmm/src/Index.cc
101119 ../libclangmm/src/SourceLocation.cc
102120 ../libclangmm/src/SourceRange.cc
103121 ../libclangmm/src/Token.cc
104122 ../libclangmm/src/Tokens.cc
105123 ../libclangmm/src/TranslationUnit.cc
106- ../libclangmm/src/Diagnostic.cc
107124 ../libclangmm/src/Utility.cc
108-
125+
109126 ../tiny-process-library/process.cpp)
110127
111128if (LIBLLDB_FOUND)
112- list (APPEND source_files debug_clang.h debug_clang.cc)
129+ list (APPEND project_files debug_clang.h debug_clang.cc)
113130endif ()
114131
115132if (MSYS )
116- list (APPEND source_files dialogs_unix.cc) #dialogs_win.cc does not work any more because of missing SHCreateItemFromParsingName
117- list (APPEND source_files ../tiny-process-library/process_win.cpp)
133+ list (APPEND project_files dialogs_unix.cc ../tiny-process-library/process_win.cpp)
118134else ()
119- list (APPEND source_files dialogs_unix.cc)
120- list (APPEND source_files ../tiny-process-library/process_unix.cpp)
135+ list (APPEND project_files dialogs_unix.cc ../tiny-process-library/process_unix.cpp)
121136endif ()
122137
123- add_executable (${project_name} ${source_files} )
124-
125- # add_library(${module} SHARED
126- # api
127- # api_ext)
128-
129- include_directories (
130- ${Boost_INCLUDE_DIRS}
131- # ${PYTHON_INCLUDE_DIRS}
132- ${GTKMM_INCLUDE_DIRS}
133- ${GTKSVMM_INCLUDE_DIRS}
134- ${LIBCLANG_INCLUDE_DIRS}
135- ${ASPELL_INCLUDE_DIR}
136- ../libclangmm/src
137- ../tiny-process-library
138- )
139-
140- link_directories (
141- ${GTKMM_LIBRARY_DIRS}
142- ${GTKSVMM_LIBRARY_DIRS}
143- ${Boost_LIBRARY_DIRS}
144- # ${PYTHON_INCLUDE_DIRS}
145- ${LIBCLANG_LIBRARY_DIRS}
146- )
147-
148- # set_target_properties(${module}
149- # PROPERTIES PREFIX ""
150- # LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib/")
151-
152- # target_link_libraries(${module} ${PYTHON_LIBRARIES} ${Boost_LIBRARIES})
153- # target_link_libraries(${module} ${Boost_LIBRARIES})
154-
155- target_link_libraries (${project_name}
156- ${LIBCLANG_LIBRARIES}
157- ${GTKMM_LIBRARIES}
158- ${GTKSVMM_LIBRARIES}
159- ${Boost_LIBRARIES}
160- ${ASPELL_LIBRARIES}
161- ${LIBLLDB_LIBRARIES}
162- #${PYTHON_LIBRARIES}
163- )
138+ include_directories (${global_includes} )
139+ add_executable (${project_name} ${project_files} )
140+ target_link_libraries (${project_name} ${global_libraries} )
164141
165- # install(TARGETS ${project_name} ${module}
166142install (TARGETS ${project_name}
167143 RUNTIME DESTINATION bin
168- # LIBRARY DESTINATION ${lib_install_path}
169144)
0 commit comments