#=======================================================================
MACRO(CREA_FIND_WXWIDGETS)
IF(WIN32)
- # Search WXWIDGETS
-
- # WXWINDOWS_LIBRARY = full path to the wxWindows library and linker flags on unix
- # CMAKE_WX_CXX_FLAGS = compiler flags for building wxWindows
- # WXWINDOWS_INCLUDE_PATH = include path of wxWindows
- SET(WXWINDOWS_USE_GL 1)
-
- #wxWidgets build related stuff
- # DO NOT FORCE DEBUG LIBS !!
- SET(WXW_USE_DEBUG OFF)
- SET(WXW_USE_UNICODE OFF)
- SET(WXW_USE_SHARED ON)
- SET(WXW_USE_UNIV OFF)
- SET(WXW_USE_MONO OFF)
- SET(WXW_FILE_VERSION "28")
- SET(WXW_VERSION "2.8")
-
- #CMake Options
- # Why forcing verbosity ?
- # SET(CMAKE_VERBOSE_MAKEFILE TRUE)
-
- INCLUDE (${CREA_CMAKE_DIR}/FindWxWidgetsWin32.cmake)
- #
+# # Search WXWIDGETS
+# # WXWINDOWS_LIBRARY = full path to the wxWindows library and linker flags on unix
+# # CMAKE_WX_CXX_FLAGS = compiler flags for building wxWindows
+# # WXWINDOWS_INCLUDE_PATH = include path of wxWindows
+# SET(WXWINDOWS_USE_GL 1)
+# #wxWidgets build related stuff
+# # DO NOT FORCE DEBUG LIBS !!
+# SET(WXW_USE_DEBUG OFF)
+# SET(WXW_USE_UNICODE OFF)
+# SET(WXW_USE_SHARED ON)
+# SET(WXW_USE_UNIV OFF)
+# SET(WXW_USE_MONO OFF)
+# SET(WXW_FILE_VERSION "28")
+# SET(WXW_VERSION "2.8")
+# #CMake Options
+# # Why forcing verbosity ?
+# # SET(CMAKE_VERBOSE_MAKEFILE TRUE)
+# INCLUDE (${CREA_CMAKE_DIR}/FindWxWidgetsWin32.cmake)
+# #
+
+ find_package(wxwidgets REQUIRED COMPONENTS core base)
+
ELSE(WIN32)
#
IF(WIN32)
- # Clean ?
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}${WXWIDGETS_CXX_FLAGS}")
- SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}${WXWIDGETS_EXE_LINKER_FLAGS}")
- #
- ADD_DEFINITIONS( ${WXWIDGETS_DEFINITIONS} )
- #
- INCLUDE_DIRECTORIES(${WXWIDGETS_INCLUDE_DIR})
- LINK_DIRECTORIES( ${WXWIDGETS_LINK_DIRECTORIES} )
- SET(WXWIDGETS_LIBRARIES
- ${WXWIDGETS_LIBRARIES}
-#DO NOT FORCE DEBUG LIBS !!
- debug wxmsw28d_aui
- optimized wxmsw28_aui
- debug msvcrtd
- debug msvcprtd
- optimized msvcrt
- optimized msvcprt
- )
+# # Clean ?
+# SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}${WXWIDGETS_CXX_FLAGS}")
+# SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}${WXWIDGETS_EXE_LINKER_FLAGS}")
+# #
+# ADD_DEFINITIONS( ${WXWIDGETS_DEFINITIONS} )
+# #
+# INCLUDE_DIRECTORIES(${WXWIDGETS_INCLUDE_DIR})
+# LINK_DIRECTORIES( ${WXWIDGETS_LINK_DIRECTORIES} )
+# SET(WXWIDGETS_LIBRARIES
+# ${WXWIDGETS_LIBRARIES}
+##DO NOT FORCE DEBUG LIBS !!
+# debug wxmsw28d_aui
+# optimized wxmsw28_aui
+# debug msvcrtd
+# debug msvcprtd
+# optimized msvcrt
+# optimized msvcprt
+# )
+
+ include(${wxWidgets_USE_FILE})
+
+
+
ELSE(WIN32)
## # GTK2
## INCLUDE_DIRECTORIES(${GTK2_INCLUDE_DIRS})
#endif /* LINUX */
#ifdef WIN32
- long result = GetModuleFileName(NULL, pname, pathsize);
+
+//2018-07-06 mingw64
+ wchar_t pname2[512];
+ mbstowcs(pname2,pname,strlen(pname)+1);
+ long result = GetModuleFileName(NULL, pname2, pathsize);
+// long result = GetModuleFileName(NULL, pname, pathsize);
+
if (result > 0)
{
/* fix up the dir slashes... */
std::string path = ".";
#ifdef WIN32
char currentPath[_MAX_PATH];
- HMODULE hand = GetModuleHandle(nomdll.c_str());
- GetModuleFileName(hand, currentPath, _MAX_PATH);
+
+//2018-07-06 mingw64
+ wchar_t nomdll2[512];
+ mbstowcs(nomdll2,nomdll.c_str(),strlen(nomdll.c_str())+1);
+ HMODULE hand = GetModuleHandle(nomdll2);
+// HMODULE hand = GetModuleHandle(nomdll.c_str());
+
+//2018-07-06 mingw64
+ wchar_t currentPath2[512];
+ mbstowcs(currentPath2,currentPath,strlen(currentPath)+1);
+ GetModuleFileName(hand, currentPath2, _MAX_PATH);
+// GetModuleFileName(hand, currentPath, _MAX_PATH);
path = currentPath;
std::string path = ".";
#ifdef WIN32
char currentPath[_MAX_PATH];
- HMODULE hand = GetModuleHandle(nomdll);
- GetModuleFileName(hand, currentPath, _MAX_PATH);
+
+//2018-07-06 mingw64
+ wchar_t nomdll2[512];
+ mbstowcs(nomdll2,nomdll,strlen(nomdll)+1);
+ HMODULE hand = GetModuleHandle(nomdll2);
+// HMODULE hand = GetModuleHandle(nomdll);
+
+//2018-07-06 mingw64
+ wchar_t currentPath2[512];
+ mbstowcs(currentPath2,currentPath,strlen(currentPath)+1);
+ GetModuleFileName(hand, currentPath2, _MAX_PATH);
+// GetModuleFileName(hand, currentPath, _MAX_PATH);
path = currentPath;
void System::createDirectory(const char* directorypath){
#ifdef WIN32
- if (CreateDirectory(directorypath, NULL) == ERROR_ALREADY_EXISTS)
+
+//2018-07-06 mingw64
+ wchar_t directorypath2[512];
+ mbstowcs(directorypath2,directorypath,strlen(directorypath)+1);
+ if (CreateDirectory(directorypath2, NULL) == ERROR_ALREADY_EXISTS)
+// if (CreateDirectory(directorypath, NULL) == ERROR_ALREADY_EXISTS)
{
std::cout<<"directory already exists "<<directorypath<<std::endl;
- }else if(CreateDirectory(directorypath, NULL) == ERROR_PATH_NOT_FOUND){
+ }else if(CreateDirectory(directorypath2, NULL) == ERROR_PATH_NOT_FOUND){
+// }else if(CreateDirectory(directorypath, NULL) == ERROR_PATH_NOT_FOUND){
std::string error = "Directory could not be created ";
error.append(directorypath);
throw error.c_str();