Skip to content

Commit

Permalink
MingW build support (does not work yet). Some work on the texture tool.
Browse files Browse the repository at this point in the history
Signed-off-by: Kristian Duske <[email protected]>
  • Loading branch information
kduske committed Feb 9, 2014
1 parent ab28003 commit 29e81cb
Show file tree
Hide file tree
Showing 33 changed files with 839 additions and 51 deletions.
2 changes: 1 addition & 1 deletion Build.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- wxMSW-<version>_vc100_ReleasePDB.7z

- Unpack all files into c:\wxWidgets-<version> so that "include" and "lib" directories are at the same level after unpacking.
- In this directory, copy lib/vc100_dll to lib/vc_dll
- In this directory, rename lib/vc100_dll to lib/vc_dll
- The directory layout should look like this:
wxWidgets-3.0.0
\include
Expand Down
16 changes: 13 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,12 @@ IF(APPLE)

SET_SOURCE_FILES_PROPERTIES(${MACOSX_SHADER_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION Resources/shader)
SET(SOURCE ${SOURCE} ${MACOSX_SHADER_FILES})
ELSEIF(WIN32)
SET(SOURCE ${SOURCE} "${SOURCE_DIR}/TrenchBroom.rc")
ELSEIF(MSVC)
SET(SOURCE ${SOURCE} "${SOURCE_DIR}/TrenchBroom.rc")
ELSEIF(MINGW)
SET(CMAKE_RC_COMPILER_INIT windres)
ENABLE_LANGUAGE(RC)
SET(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> -i <SOURCE> -o <OBJECT>")
ENDIF()

ADD_EXECUTABLE(TrenchBroom WIN32 MACOSX_BUNDLE ${SOURCE})
Expand Down Expand Up @@ -153,7 +157,13 @@ ENDIF()
# TrenchBroom-Test executable
ADD_EXECUTABLE(TrenchBroom-Test ${SOURCE} ${TEST_SOURCE})
TARGET_LINK_LIBRARIES(TrenchBroom-Test ${wxWidgets_LIBRARIES} gtest gmock ${FREETYPE_LIBRARIES} ${FREEIMAGE_LIBRARIES})
SET_TARGET_PROPERTIES(TrenchBroom-Test PROPERTIES COMPILE_DEFINITIONS "TESTING")
SET_TARGET_PROPERTIES(TrenchBroom-Test PROPERTIES COMPILE_DEFINITIONS TESTING=1)

# Disable some GCC warnings when compiling the tests
IF(CMAKE_COMPILER_IS_GNUCXX)
SET_TARGET_PROPERTIES(TrenchBroom-Test PROPERTIES COMPILE_FLAGS -Wno-unused-local-typedefs)
ENDIF()


IF(APPLE)
# Set Debug information format
Expand Down
5 changes: 4 additions & 1 deletion cmake/FreeImage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ IF(APPLE)
/opt/local/include
DOC "The directory where FreeImage.h resides")
SET(FREEIMAGE_LIBRARY "${LIB_BIN_DIR}/osx/libfreeimage.a")
ELSEIF (WIN32)
ELSEIF(MSVC)
FIND_PATH(FREEIMAGE_INCLUDE_PATH FreeImage.h "${LIB_INCLUDE_DIR}" DOC "Freeimage includes")
SET(FREEIMAGE_LIBRARY "${LIB_BIN_DIR}/win32/FreeImage.lib")
ELSEIF(MINGW)
FIND_PATH(FREEIMAGE_INCLUDE_PATH FreeImage.h "${LIB_INCLUDE_DIR}" DOC "Freeimage includes")
SET(FREEIMAGE_LIBRARY "${LIB_BIN_DIR}/win32/libfreeimage.a")
ELSE()
FIND_PATH( FREEIMAGE_INCLUDE_PATH FreeImage.h
/usr/include
Expand Down
50 changes: 38 additions & 12 deletions cmake/FreeType.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,46 @@ IF(APPLE)

FIND_PATH(FREETYPE_INCLUDE_PATH ft2build.h "${LIB_INCLUDE_DIR}" DOC "Freetype includes")
SET(FREETYPE_LIBRARY "${LIB_BIN_DIR}/osx/libfreetype.a")

SET(FREETYPE_LIBRARIES
${FREETYPE_LIBRARY}
"${LIB_BIN_DIR}/osx/libbz2.a"
"${LIB_BIN_DIR}/osx/libz.a")
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FREETYPE DEFAULT_MSG FREETYPE_LIBRARY FREETYPE_INCLUDE_PATH)
MARK_AS_ADVANCED(
FREETYPE_FOUND
FREETYPE_LIBRARY
FREETYPE_LIBRARIES
FREETYPE_INCLUDE_PATH)
${FREETYPE_LIBRARY}
"${LIB_BIN_DIR}/osx/libbz2.a"
"${LIB_BIN_DIR}/osx/libz.a")
ELSEIF(MSVC)
FIND_PATH(FREETYPE_INCLUDE_PATH ft2build.h "${LIB_INCLUDE_DIR}" DOC "Freetype includes")
FIND_LIBRARY(FREETYPE_LIBRARIES NAMES freetype6.dll freetype.lib PATHS "${LIB_BIN_DIR}/win32" DOC "Freetype library")
SET(FREETYPE_LIBRARY "${LIB_BIN_DIR}/win32/freetype.lib")

SET(FREETYPE_LIBRARIES
${FREETYPE_LIBRARY})
ELSEIF(MINGW)
FIND_PATH(FREETYPE_INCLUDE_PATH ft2build.h "${LIB_INCLUDE_DIR}" DOC "Freetype includes")
SET(FREETYPE_LIBRARY "${LIB_BIN_DIR}/win32/libfreetype.a")

SET(FREETYPE_LIBRARIES
${FREETYPE_LIBRARY}
"${LIB_BIN_DIR}/win32/libz.a")
ELSE()
INCLUDE(FindFreetype)
FIND_PATH( FREETYPE_INCLUDE_PATH ft2build.h
/usr/include
/usr/local/include
/sw/include
/opt/local/include
DOC "The directory where ft2build.h resides")
FIND_LIBRARY( FREETYPE_LIBRARY
NAMES FreeType freetype
PATHS
/usr/lib64
/usr/lib
/usr/local/lib64
/usr/local/lib
/sw/lib
/opt/local/lib
DOC "The FreeType library")
ENDIF()

FIND_PACKAGE_HANDLE_STANDARD_ARGS(FREETYPE DEFAULT_MSG FREETYPE_LIBRARY FREETYPE_INCLUDE_PATH)
MARK_AS_ADVANCED(
FREETYPE_FOUND
FREETYPE_LIBRARY
FREETYPE_LIBRARIES
FREETYPE_INCLUDE_PATH)
Binary file added lib/bin/win32/libfreeimage.a
Binary file not shown.
239 changes: 239 additions & 0 deletions lib/bin/win32/libfreeimage.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,239 @@
LIBRARY FreeImage.dll
EXPORTS
FreeImage_OutputMessageProc
FreeImage_AcquireMemory@12
FreeImage_AdjustBrightness@12
FreeImage_AdjustColors@32
FreeImage_AdjustContrast@12
FreeImage_AdjustCurve@12
FreeImage_AdjustGamma@12
FreeImage_Allocate@24
FreeImage_AllocateEx@36
FreeImage_AllocateExT@40
FreeImage_AllocateHeader@28
FreeImage_AllocateHeaderT@32
FreeImage_AllocateT@28
FreeImage_AppendPage@8
FreeImage_ApplyColorMapping@24
FreeImage_ApplyPaletteIndexMapping@20
FreeImage_Clone@4
FreeImage_CloneMetadata@8
FreeImage_CloneTag@4
FreeImage_CloseMemory@4
FreeImage_CloseMultiBitmap@8
FreeImage_ColorQuantize@8
FreeImage_ColorQuantizeEx@20
FreeImage_Composite@16
FreeImage_ConvertFromRawBits@36
FreeImage_ConvertLine16To24_555@12
FreeImage_ConvertLine16To24_565@12
FreeImage_ConvertLine16To32_555@12
FreeImage_ConvertLine16To32_565@12
FreeImage_ConvertLine16To4_555@12
FreeImage_ConvertLine16To4_565@12
FreeImage_ConvertLine16To8_555@12
FreeImage_ConvertLine16To8_565@12
FreeImage_ConvertLine16_555_To16_565@12
FreeImage_ConvertLine16_565_To16_555@12
FreeImage_ConvertLine1To16_555@16
FreeImage_ConvertLine1To16_565@16
FreeImage_ConvertLine1To24@16
FreeImage_ConvertLine1To32@16
FreeImage_ConvertLine1To4@12
FreeImage_ConvertLine1To8@12
FreeImage_ConvertLine24To16_555@12
FreeImage_ConvertLine24To16_565@12
FreeImage_ConvertLine24To32@12
FreeImage_ConvertLine24To4@12
FreeImage_ConvertLine24To8@12
FreeImage_ConvertLine32To16_555@12
FreeImage_ConvertLine32To16_565@12
FreeImage_ConvertLine32To24@12
FreeImage_ConvertLine32To4@12
FreeImage_ConvertLine32To8@12
FreeImage_ConvertLine4To16_555@16
FreeImage_ConvertLine4To16_565@16
FreeImage_ConvertLine4To24@16
FreeImage_ConvertLine4To32@16
FreeImage_ConvertLine4To8@12
FreeImage_ConvertLine8To16_555@16
FreeImage_ConvertLine8To16_565@16
FreeImage_ConvertLine8To24@16
FreeImage_ConvertLine8To32@16
FreeImage_ConvertLine8To4@16
FreeImage_ConvertTo16Bits555@4
FreeImage_ConvertTo16Bits565@4
FreeImage_ConvertTo24Bits@4
FreeImage_ConvertTo32Bits@4
FreeImage_ConvertTo4Bits@4
FreeImage_ConvertTo8Bits@4
FreeImage_ConvertToFloat@4
FreeImage_ConvertToGreyscale@4
FreeImage_ConvertToRGB16@4
FreeImage_ConvertToRGBF@4
FreeImage_ConvertToRawBits@32
FreeImage_ConvertToStandardType@8
FreeImage_ConvertToType@12
FreeImage_ConvertToUINT16@4
FreeImage_Copy@20
FreeImage_CreateICCProfile@12
FreeImage_CreateTag@0
FreeImage_DeInitialise@0
FreeImage_DeletePage@8
FreeImage_DeleteTag@4
FreeImage_DestroyICCProfile@4
FreeImage_Dither@8
FreeImage_EnlargeCanvas@28
FreeImage_FIFSupportsExportBPP@8
FreeImage_FIFSupportsExportType@8
FreeImage_FIFSupportsICCProfiles@4
FreeImage_FIFSupportsNoPixels@4
FreeImage_FIFSupportsReading@4
FreeImage_FIFSupportsWriting@4
FreeImage_FillBackground@12
FreeImage_FindCloseMetadata@4
FreeImage_FindFirstMetadata@12
FreeImage_FindNextMetadata@8
FreeImage_FlipHorizontal@4
FreeImage_FlipVertical@4
FreeImage_GetAdjustColorsLookupTable@32
FreeImage_GetBPP@4
FreeImage_GetBackgroundColor@8
FreeImage_GetBits@4
FreeImage_GetBlueMask@4
FreeImage_GetChannel@8
FreeImage_GetColorType@4
FreeImage_GetColorsUsed@4
FreeImage_GetComplexChannel@8
FreeImage_GetCopyrightMessage@0
FreeImage_GetDIBSize@4
FreeImage_GetDotsPerMeterX@4
FreeImage_GetDotsPerMeterY@4
FreeImage_GetFIFCount@0
FreeImage_GetFIFDescription@4
FreeImage_GetFIFExtensionList@4
FreeImage_GetFIFFromFilename@4
FreeImage_GetFIFFromFilenameU@4
FreeImage_GetFIFFromFormat@4
FreeImage_GetFIFFromMime@4
FreeImage_GetFIFMimeType@4
FreeImage_GetFIFRegExpr@4
FreeImage_GetFileType@8
FreeImage_GetFileTypeFromHandle@12
FreeImage_GetFileTypeFromMemory@8
FreeImage_GetFileTypeU@8
FreeImage_GetFormatFromFIF@4
FreeImage_GetGreenMask@4
FreeImage_GetHeight@4
FreeImage_GetHistogram@12
FreeImage_GetICCProfile@4
FreeImage_GetImageType@4
FreeImage_GetInfo@4
FreeImage_GetInfoHeader@4
FreeImage_GetLine@4
FreeImage_GetLockedPageNumbers@12
FreeImage_GetMetadata@16
FreeImage_GetMetadataCount@8
FreeImage_GetPageCount@4
FreeImage_GetPalette@4
FreeImage_GetPitch@4
FreeImage_GetPixelColor@16
FreeImage_GetPixelIndex@16
FreeImage_GetRedMask@4
FreeImage_GetScanLine@8
FreeImage_GetTagCount@4
FreeImage_GetTagDescription@4
FreeImage_GetTagID@4
FreeImage_GetTagKey@4
FreeImage_GetTagLength@4
FreeImage_GetTagType@4
FreeImage_GetTagValue@4
FreeImage_GetThumbnail@4
FreeImage_GetTransparencyCount@4
FreeImage_GetTransparencyTable@4
FreeImage_GetTransparentIndex@4
FreeImage_GetVersion@0
FreeImage_GetWidth@4
FreeImage_HasBackgroundColor@4
FreeImage_HasPixels@4
FreeImage_HasRGBMasks@4
FreeImage_Initialise@4
FreeImage_InsertPage@12
FreeImage_Invert@4
FreeImage_IsLittleEndian@0
FreeImage_IsPluginEnabled@4
FreeImage_IsTransparent@4
FreeImage_JPEGCrop@24
FreeImage_JPEGCropU@24
FreeImage_JPEGTransform@16
FreeImage_JPEGTransformU@16
FreeImage_Load@12
FreeImage_LoadFromHandle@16
FreeImage_LoadFromMemory@12
FreeImage_LoadMultiBitmapFromMemory@12
FreeImage_LoadU@12
FreeImage_LockPage@8
FreeImage_LookupSVGColor@16
FreeImage_LookupX11Color@16
FreeImage_MakeThumbnail@12
FreeImage_MovePage@12
FreeImage_MultigridPoissonSolver@8
FreeImage_OpenMemory@8
FreeImage_OpenMultiBitmap@24
FreeImage_OpenMultiBitmapFromHandle@16
FreeImage_Paste@20
FreeImage_PreMultiplyWithAlpha@4
FreeImage_ReadMemory@16
FreeImage_RegisterExternalPlugin@20
FreeImage_RegisterLocalPlugin@20
FreeImage_Rescale@16
FreeImage_Rotate@16
FreeImage_RotateClassic@12
FreeImage_RotateEx@48
FreeImage_Save@16
FreeImage_SaveMultiBitmapToHandle@20
FreeImage_SaveMultiBitmapToMemory@16
FreeImage_SaveToHandle@20
FreeImage_SaveToMemory@16
FreeImage_SaveU@16
FreeImage_SeekMemory@12
FreeImage_SetBackgroundColor@8
FreeImage_SetChannel@12
FreeImage_SetComplexChannel@12
FreeImage_SetDotsPerMeterX@8
FreeImage_SetDotsPerMeterY@8
FreeImage_SetMetadata@16
FreeImage_SetOutputMessage@4
FreeImage_SetOutputMessageStdCall@4
FreeImage_SetPixelColor@16
FreeImage_SetPixelIndex@16
FreeImage_SetPluginEnabled@8
FreeImage_SetTagCount@8
FreeImage_SetTagDescription@8
FreeImage_SetTagID@8
FreeImage_SetTagKey@8
FreeImage_SetTagLength@8
FreeImage_SetTagType@8
FreeImage_SetTagValue@8
FreeImage_SetThumbnail@8
FreeImage_SetTransparencyTable@12
FreeImage_SetTransparent@8
FreeImage_SetTransparentIndex@8
FreeImage_SwapColors@16
FreeImage_SwapPaletteIndices@12
FreeImage_TagToString@12
FreeImage_TellMemory@4
FreeImage_Threshold@8
FreeImage_TmoDrago03@20
FreeImage_TmoFattal02@20
FreeImage_TmoReinhard05@20
FreeImage_TmoReinhard05Ex@36
FreeImage_ToneMapping@24
FreeImage_Unload@4
FreeImage_UnlockPage@12
FreeImage_WriteMemory@16
FreeImage_ZLibCRC32@12
FreeImage_ZLibCompress@16
FreeImage_ZLibGUnzip@16
FreeImage_ZLibGZip@16
FreeImage_ZLibUncompress@16
Binary file added lib/bin/win32/libfreetype.a
Binary file not shown.
Loading

0 comments on commit 29e81cb

Please sign in to comment.