1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-28 23:03:03 +04:00

Merge pull request #15059 from hugolm84:improved-support-for-wince

* Improve support for Windows Embedded Compact

* Remove redundant set(WINCE true) and format CMake
This commit is contained in:
Hugo Lindström
2019-07-24 22:12:09 +02:00
committed by Alexander Alekhin
parent ad092bf1ce
commit 2ee00e7f7d
10 changed files with 174 additions and 45 deletions
+19 -5
View File
@@ -378,7 +378,7 @@ struct HWFeatures
void initialize(void)
{
#ifndef WINRT
#ifndef NO_GETENV
if (getenv("OPENCV_DUMP_CONFIG"))
{
fprintf(stderr, "\nOpenCV build configuration is:\n%s\n",
@@ -614,10 +614,10 @@ struct HWFeatures
{
bool dump = true;
const char* disabled_features =
#ifndef WINRT
getenv("OPENCV_CPU_DISABLE");
#else
#ifdef NO_GETENV
NULL;
#else
getenv("OPENCV_CPU_DISABLE");
#endif
if (disabled_features && disabled_features[0] != 0)
{
@@ -892,7 +892,7 @@ String format( const char* fmt, ... )
String tempfile( const char* suffix )
{
String fname;
#ifndef WINRT
#ifndef NO_GETENV
const char *temp_dir = getenv("OPENCV_TEMP_PATH");
#endif
@@ -913,6 +913,20 @@ String tempfile( const char* suffix )
CV_Assert((copied != MAX_PATH) && (copied != (size_t)-1));
fname = String(aname);
RoUninitialize();
#elif defined(_WIN32_WCE)
const auto kMaxPathSize = MAX_PATH+1;
wchar_t temp_dir[kMaxPathSize] = {0};
wchar_t temp_file[kMaxPathSize] = {0};
::GetTempPathW(kMaxPathSize, temp_dir);
if(0 != ::GetTempFileNameW(temp_dir, L"ocv", 0, temp_file)) {
DeleteFileW(temp_file);
char aname[MAX_PATH];
size_t copied = wcstombs(aname, temp_file, MAX_PATH);
CV_Assert((copied != MAX_PATH) && (copied != (size_t)-1));
fname = String(aname);
}
#else
char temp_dir2[MAX_PATH] = { 0 };
char temp_file[MAX_PATH] = { 0 };