Commit 214bc1f2 authored by Jan Möbius's avatar Jan Möbius

MinGW support

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@471 fdac6126-5c0c-442c-9429-916003d36597
parent a95789f4
......@@ -28,7 +28,7 @@ if ( NOT DEFINED BUILD_APPS )
endif()
if (WIN32)
if ( BUILD_APPS )
if ( NOT "${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles" AND BUILD_APPS )
add_custom_target (fixbundle ALL
COMMAND ${CMAKE_COMMAND} -P "${CMAKE_BINARY_DIR}/fixbundle.win.cmake" )
endif()
......@@ -59,8 +59,10 @@ if (WIN32 AND BUILD_APPS )
configure_file ("${CMAKE_SOURCE_DIR}/cmake/fixbundle.cmake.win.in"
"${CMAKE_BINARY_DIR}/fixbundle.win.cmake" @ONLY IMMEDIATE)
# let bundle generation depend on all targets
add_dependencies (fixbundle QtViewer DecimaterGui)
if ( NOT "${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles" )
# let bundle generation depend on all targets
add_dependencies (fixbundle QtViewer DecimaterGui)
endif()
endif()
......
......@@ -468,11 +468,16 @@ function (acg_add_library _target _libtype)
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR}/${fullname}.dll)
endif ()
if (${_type} STREQUAL SHARED OR ${_type} STREQUAL STATIC)
if("${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles")
SET(OUTPUTNAME "lib${fullname}.a")
else()
SET(OUTPUTNAME "${fullname}.lib")
endif()
add_custom_command (TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy_if_different
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${fullname}.lib
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/${fullname}.lib)
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${OUTPUTNAME}
${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/${OUTPUTNAME})
endif ()
elseif (APPLE AND NOT ACG_PROJECT_MACOS_BUNDLE)
if (${_type} STREQUAL SHARED)
......
......@@ -16,7 +16,15 @@ add_subdirectory (VDProgMesh/mkbalancedpm)
add_subdirectory (VDProgMesh/Analyzer)
# Add non ui apps as dependency before fixbundle
if ( WIN32 OR APPLE)
if ( WIN32 )
if ( NOT "${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles" )
# let bundle generation depend on all targets
add_dependencies (fixbundle commandlineDecimater Dualizer mconvert Smoothing commandlineAdaptiveSubdivider commandlineSubdivider mkbalancedpm Analyzer )
endif()
endif()
# Add non ui apps as dependency before fixbundle
if ( APPLE)
# let bundle generation depend on all targets
add_dependencies (fixbundle commandlineDecimater Dualizer mconvert Smoothing commandlineAdaptiveSubdivider commandlineSubdivider mkbalancedpm Analyzer )
endif()
......
......@@ -42,13 +42,14 @@ endif ()
# Add core as dependency before fixbundle
if ( ${PROJECT_NAME} MATCHES "OpenMesh")
# Add core as dependency before fixbundle
if ( WIN32 AND BUILD_APPS )
# let bundle generation depend on targets
add_dependencies (fixbundle OpenMeshCore)
if ( WIN32 AND BUILD_APPS)
if ( NOT "${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles" )
add_dependencies (fixbundle OpenMeshCore)
endif()
endif()
# Add core as dependency before fixbundle
if ( APPLE)
# let bundle generation depend on targets
add_dependencies (fixbundle OpenMeshCore)
......
......@@ -49,9 +49,11 @@ ENDIF(NOT WIN32)
if ( ${PROJECT_NAME} MATCHES "OpenMesh")
if ( WIN32 AND BUILD_APPS )
# let bundle generation depend on target
add_dependencies (fixbundle OpenMeshTools)
if ( WIN32 AND BUILD_APPS)
if ( NOT "${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles" )
# let bundle generation depend on target
add_dependencies (fixbundle OpenMeshTools)
endif()
endif()
......@@ -59,12 +61,9 @@ if ( ${PROJECT_NAME} MATCHES "OpenMesh")
if (APPLE)
# let bundle generation depend on target
add_dependencies (fixbundle OpenMeshTools)
endif()
if ( APPLE)
# let bundle generation depend on target
add_dependencies (fixbundle OpenMeshToolsStatic)
endif()
endif()
......
......@@ -45,8 +45,13 @@
#endif
#ifndef WIN32
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
#else
#ifdef __MINGW32__
#include <stdlib.h>
#include <string.h>
#endif
#endif
using namespace std;
......
......@@ -181,7 +181,7 @@ protected:
};
// ----------------------------------------------------------- gettimeofday ----
#elif defined(__GNUC__) || (defined(__INTEL_COMPILER) && !defined(WIN32))
#elif (defined(__GNUC__) || (defined(__INTEL_COMPILER) && !defined(WIN32))) && !defined(__MINGW32__)
# include <sys/time.h>
# include <sys/resource.h>
......@@ -268,7 +268,7 @@ Timer::Timer(void)
# else
impl_ = new TimerImplPosix<CLOCK_REALTIME>;
# endif
#elif defined(__GNUC__) || (defined(__INTEL_COMPILER) && !defined(WIN32))
#elif (defined(__GNUC__) || (defined(__INTEL_COMPILER) && !defined(WIN32)) ) && !defined(__MINGW32__)
impl_ = new TimerImplGToD;
#else
impl_ = new TimerImplStd;
......
......@@ -53,6 +53,11 @@
#ifndef WIN32
#include <string.h>
#include <cstdlib>
#else
#if defined(__MINGW32__)
#include <stdlib.h>
#include <string.h>
#endif
#endif
//== NAMESPACES ===============================================================
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment