Try to fix openssl use on Windows.
authorCarl Hetherington <cth@carlh.net>
Wed, 9 Oct 2013 09:59:33 +0000 (10:59 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 9 Oct 2013 09:59:33 +0000 (10:59 +0100)
src/lib/cross.cc
src/lib/cross.h
src/lib/util.cc

index 61ec8de5e07f3fae30830ab77d3fdf6b6585f19f..47b97baecc0816b96db472ea26864e355a4c5780 100644 (file)
@@ -231,3 +231,22 @@ mount_info ()
 
        return m;
 }
+
+boost::filesystem::path
+openssl_path ()
+{
+#ifdef DCPOMATIC_WINDOWS
+
+       wchar_t dir[512];
+       GetModuleFileName (GetModuleHandle (0), dir, sizeof (dir));
+       PathRemoveFileSpec (dir);
+       
+       boost::filesystem::path path = dir;
+       path /= "openssl.exe";
+       return path
+#else  
+       /* We assume that it's on the path for Linux and OS X */
+       return "openssl";
+#endif
+
+}
index 58fa821c7276aba3a96fb0a8996b6f224ca3b2e2..c3bb20b47ba6fcb07f1425d1f2068d07ca2ceb2a 100644 (file)
@@ -29,3 +29,4 @@ void dcpomatic_sleep (int);
 extern std::string cpu_info ();
 extern void run_ffprobe (boost::filesystem::path, boost::filesystem::path, boost::shared_ptr<Log>);
 extern std::list<std::pair<std::string, std::string> > mount_info ();
+extern boost::filesystem::path openssl_path ();
index ae3de2d6b1e68b1ef5a31022bd62f17cc262420a..e0495f18b495e5e16eb0e828e8318f765d455aa9 100644 (file)
@@ -65,6 +65,7 @@ extern "C" {
 #include "config.h"
 #include "ratio.h"
 #include "job.h"
+#include "cross.h"
 #ifdef DCPOMATIC_WINDOWS
 #include "stack.hpp"
 #endif
@@ -824,7 +825,7 @@ make_signer ()
 {
        boost::filesystem::path const sd = Config::instance()->signer_chain_directory ();
        if (boost::filesystem::is_empty (sd)) {
-               libdcp::make_signer_chain (sd);
+               libdcp::make_signer_chain (sd, openssl_path ());
        }
 
        libdcp::CertificateChain chain;