Fixed: Build tile_edit_qt on Mac OS X

This commit is contained in:
rti 2010-12-11 20:36:37 +01:00
parent 7ceb3dd196
commit f91733c9f2
2 changed files with 9 additions and 2 deletions

View file

@ -1,6 +1,9 @@
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/pic) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/pic)
INCLUDE( ${QT_USE_FILE} ) INCLUDE( ${QT_USE_FILE} )
FIND_PACKAGE(JPEG)
INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR})
FILE(GLOB TILE_EDIT_SRC *.cpp *.h) FILE(GLOB TILE_EDIT_SRC *.cpp *.h)
FILE(GLOB PIC_SRC pic/*.c pic/*.cpp) FILE(GLOB PIC_SRC pic/*.c pic/*.cpp)
SET(TILE_EDIT_HDR items_edit_dlg.h tile_browser_dlg.h tile_edit_dlg.h tile_rotation_dlg.h tiles_model.h tile_widget.h) SET(TILE_EDIT_HDR items_edit_dlg.h tile_browser_dlg.h tile_edit_dlg.h tile_rotation_dlg.h tiles_model.h tile_widget.h)
@ -18,7 +21,7 @@ SOURCE_GROUP(PICLibrary FILES ${PIC_SRC})
ADD_EXECUTABLE(tile_edit_qt ${TILE_EDIT_SRC} ${PIC_SRC} ${TILE_EDIT_MOC_SRCS} ${TILE_EDIT_RC_SRCS} ${TILE_EDIT_UI_HDRS}) ADD_EXECUTABLE(tile_edit_qt ${TILE_EDIT_SRC} ${PIC_SRC} ${TILE_EDIT_MOC_SRCS} ${TILE_EDIT_RC_SRCS} ${TILE_EDIT_UI_HDRS})
TARGET_LINK_LIBRARIES(tile_edit_qt ${QT_LIBRARIES} nelmisc nel3d) TARGET_LINK_LIBRARIES(tile_edit_qt ${QT_LIBRARIES} ${JPEG_LIBRARY} nelmisc nel3d)
NL_DEFAULT_PROPS(tile_edit_qt "NeL, Tools, 3D: Qt Tile Editor") NL_DEFAULT_PROPS(tile_edit_qt "NeL, Tools, 3D: Qt Tile Editor")
NL_ADD_RUNTIME_FLAGS(tile_edit_qt) NL_ADD_RUNTIME_FLAGS(tile_edit_qt)

View file

@ -1,6 +1,8 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#if !defined(__APPLE__)
#include <malloc.h> #include <malloc.h>
#endif
#include <string.h> #include <string.h>
#include <stdarg.h> #include <stdarg.h>
@ -9,7 +11,9 @@
static unsigned long PIC_Sys_MEM_Allocated; static unsigned long PIC_Sys_MEM_Allocated;
static unsigned long PIC_Sys_MEM_NbAllocs; static unsigned long PIC_Sys_MEM_NbAllocs;
#ifdef __GNUC__ #if defined(__APPLE__)
#define _msize malloc_size
#elif defined(__GNUC__)
#define _msize malloc_usable_size #define _msize malloc_usable_size
#endif /* __GNUC__ */ #endif /* __GNUC__ */