gentoo-full-overlay/sci-libs/avogadrolibs/files/avogadrolibs-1.91.0_pre20180406-unbundle-jsoncpp.patch

143 lines
5.3 KiB
Diff

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