cmake: move boring setup of sysrepo/netopeer paths into an extra file

Specially requested by Vasek.

Change-Id: I4550a94e75bc520e1fbed44c881e154f5e4fad52
diff --git a/cmake/DiscoverNetconfExecutables.cmake b/cmake/DiscoverNetconfExecutables.cmake
new file mode 100644
index 0000000..711af07
--- /dev/null
+++ b/cmake/DiscoverNetconfExecutables.cmake
@@ -0,0 +1,24 @@
+macro(discover_netconf_executables)
+    if (NOT SYSREPOCTL_EXECUTABLE)
+        find_program(SYSREPOCTL_EXECUTABLE sysrepoctl)
+    endif()
+    if (NOT SYSREPOCTL_EXECUTABLE)
+        message(FATAL_ERROR "Unable to find sysrepoctl, set SYSREPOCTL_EXECUTABLE manually.")
+    endif()
+
+    if (NOT SYSREPOCFG_EXECUTABLE)
+        find_program(SYSREPOCFG_EXECUTABLE sysrepocfg)
+    endif()
+    if (NOT SYSREPOCFG_EXECUTABLE)
+        message(FATAL_ERROR "Unable to find sysrepocfg, set SYSREPOCFG_EXECUTABLE manually.")
+    endif()
+
+    if (NOT NETOPEER2_EXECUTABLE)
+        find_program(NETOPEER2_EXECUTABLE netopeer2-server)
+    endif()
+    if (NOT NETOPEER2_EXECUTABLE)
+        message(FATAL_ERROR "Unable to find netopeer2-server, set NETOPEER2_EXECUTABLE manually.")
+    endif()
+
+    pkg_get_variable(SYSREPO_SR_REPO_PATH sysrepo SR_REPO_PATH)
+endmacro()