summaryrefslogtreecommitdiff
blob: 3b5280cdc47e4d6ed88aa7261fdc006a5232c0fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
From 7e01a11dde25af75b21090fdaa2ca574ef703e53 Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <andreas.sturmlechner@gmail.com>
Date: Sun, 8 Apr 2018 01:48:27 +0200
Subject: [PATCH 1/2] Drop bogus jsoncpp.cpp include from spectra.cpp

---
 avogadro/qtplugins/spectra/spectra.cpp | 2 --
 1 file changed, 2 deletions(-)

diff --git a/avogadro/qtplugins/spectra/spectra.cpp b/avogadro/qtplugins/spectra/spectra.cpp
index 043b52e..aa9c641 100644
--- a/avogadro/qtplugins/spectra/spectra.cpp
+++ b/avogadro/qtplugins/spectra/spectra.cpp
@@ -26,8 +26,6 @@
 #include <QtWidgets/QFileDialog>
 #include <avogadro/qtgui/molecule.h>
 
-#include <jsoncpp.cpp>
-
 namespace Avogadro {
 namespace QtPlugins {
 
-- 
2.17.0


From 52cd35662aa2094db77ab4002b7c44f3dab2802d Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <andreas.sturmlechner@gmail.com>
Date: Sun, 8 Apr 2018 02:00:30 +0200
Subject: [PATCH 2/2] Use pkgconfig to find system-jsoncpp

---
 CMakeLists.txt                                     | 5 ++++-
 avogadro/io/CMakeLists.txt                         | 4 ++--
 avogadro/qtplugins/importpqr/CMakeLists.txt        | 4 ++--
 avogadro/qtplugins/plugindownloader/CMakeLists.txt | 4 ++--
 avogadro/qtplugins/spectra/CMakeLists.txt          | 2 +-
 avogadro/quantumio/CMakeLists.txt                  | 4 ++--
 6 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7574fa0..7ce80b0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,8 +52,11 @@ option(USE_PROTOCALL "Enable libraries that use ProtoCall" OFF)
 option(USE_MOLEQUEUE "Enable the MoleQueue dependent functionality" ON)
 option(USE_PYTHON "Use Python to wrap some of our API" OFF)
 
+find_package(PkgConfig REQUIRED)
+pkg_check_modules(JSONCPP jsoncpp)
+
 add_subdirectory(utilities)
-add_subdirectory(thirdparty)
+# add_subdirectory(thirdparty)
 add_subdirectory(avogadro)
 
 if(ENABLE_TESTING)
diff --git a/avogadro/io/CMakeLists.txt b/avogadro/io/CMakeLists.txt
index 1dd7967..10ddbb6 100644
--- a/avogadro/io/CMakeLists.txt
+++ b/avogadro/io/CMakeLists.txt
@@ -15,7 +15,7 @@ endif()
 # compilers that support that notion.
 include_directories(SYSTEM "${EIGEN3_INCLUDE_DIR}"
   "${AvogadroLibs_SOURCE_DIR}/thirdparty/pugixml"
-  "${AvogadroLibs_SOURCE_DIR}/thirdparty/jsoncpp")
+  "${JSONCPP_INCLUDE_DIRS}")
 
 if(DEFINED AvogadroLibs_MEMORY_INCLUDE_DIRS)
   # The smart pointer classes just require headers.
@@ -51,7 +51,7 @@ endif()
 
 avogadro_add_library(AvogadroIO ${HEADERS} ${SOURCES})
 
-target_link_libraries(AvogadroIO LINK_PUBLIC AvogadroCore LINK_PRIVATE jsoncpp)
+target_link_libraries(AvogadroIO LINK_PUBLIC AvogadroCore LINK_PRIVATE ${JSONCPP_LIBRARIES})
 if(USE_HDF5)
   target_link_libraries(AvogadroIO LINK_PRIVATE ${HDF5_LIBRARIES})
 endif()
diff --git a/avogadro/qtplugins/importpqr/CMakeLists.txt b/avogadro/qtplugins/importpqr/CMakeLists.txt
index ee27da9..365c51a 100644
--- a/avogadro/qtplugins/importpqr/CMakeLists.txt
+++ b/avogadro/qtplugins/importpqr/CMakeLists.txt
@@ -1,4 +1,4 @@
-include_directories(SYSTEM "${AvogadroLibs_SOURCE_DIR}/thirdparty/jsoncpp")
+include_directories(SYSTEM ${JSONCPP_INCLUDE_DIRS})
 
 # Extension
 set(importpqr_srcs
@@ -17,4 +17,4 @@ avogadro_plugin(ImportPQR
   ""
 )
 
-target_link_libraries(ImportPQR LINK_PRIVATE ${Qt5Network_LIBRARIES} jsoncpp)
+target_link_libraries(ImportPQR LINK_PRIVATE ${Qt5Network_LIBRARIES} ${JSONCPP_LIBRARIES})
diff --git a/avogadro/qtplugins/plugindownloader/CMakeLists.txt b/avogadro/qtplugins/plugindownloader/CMakeLists.txt
index 4b07a53..ab4c661 100644
--- a/avogadro/qtplugins/plugindownloader/CMakeLists.txt
+++ b/avogadro/qtplugins/plugindownloader/CMakeLists.txt
@@ -1,4 +1,4 @@
-include_directories(SYSTEM "${AvogadroLibs_SOURCE_DIR}/thirdparty/jsoncpp")
+include_directories(SYSTEM ${JSONCPP_INCLUDE_DIRS})
 
 find_package(LibArchive REQUIRED)
 include_directories(SYSTEM ${LIBARCHIVE_INCLUDE_DIRS})
@@ -20,4 +20,4 @@ avogadro_plugin(PluginDownloader
 )
 
 target_link_libraries(PluginDownloader LINK_PRIVATE ${Qt5Network_LIBRARIES}
-  ${LIBARCHIVE_LIBRARIES} jsoncpp)
+  ${LIBARCHIVE_LIBRARIES} ${JSONCPP_LIBRARIES})
diff --git a/avogadro/qtplugins/spectra/CMakeLists.txt b/avogadro/qtplugins/spectra/CMakeLists.txt
index a2216b8..09d8fc9 100644
--- a/avogadro/qtplugins/spectra/CMakeLists.txt
+++ b/avogadro/qtplugins/spectra/CMakeLists.txt
@@ -1,4 +1,4 @@
-include_directories(SYSTEM "${AvogadroLibs_SOURCE_DIR}/thirdparty/jsoncpp")
+include_directories(SYSTEM ${JSONCPP_INCLUDE_DIRS})
 
 set(plugin_srcs
   vibrationdialog.cpp
diff --git a/avogadro/quantumio/CMakeLists.txt b/avogadro/quantumio/CMakeLists.txt
index 15073e8..35fc766 100644
--- a/avogadro/quantumio/CMakeLists.txt
+++ b/avogadro/quantumio/CMakeLists.txt
@@ -2,7 +2,7 @@ find_package(Eigen3 REQUIRED)
 # Add as "system headers" to avoid warnings generated by them with
 # compilers that support that notion.
 include_directories(SYSTEM "${EIGEN3_INCLUDE_DIR}"
-  "${AvogadroLibs_SOURCE_DIR}/thirdparty/jsoncpp")
+  ${JSONCPP_INCLUDE_DIRS})
 
 include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
@@ -30,4 +30,4 @@ set(SOURCES
 )
 
 avogadro_add_library(AvogadroQuantumIO ${HEADERS} ${SOURCES})
-target_link_libraries(AvogadroQuantumIO LINK_PUBLIC AvogadroIO LINK_PRIVATE jsoncpp)
+target_link_libraries(AvogadroQuantumIO LINK_PUBLIC AvogadroIO LINK_PRIVATE ${JSONCPP_LIBRARIES})
-- 
2.17.0