Using the same FreeImage for meta project.
Posted: Sat May 03, 2014 14:24
Hi ! I do a meta cmake project that include the build of any dependencies. My problem is that on win32, I cant use the same FreeImage cmake for ogre and cegui. In fact, if I use cegui_add_library(FreeImage SOURCES NONE), cegui compile out of the box but I get a mscv link2019 error(a lot of undefined symbols) for Ogre. If I change that for add_library(FreeImage STATIC ${SOURCES}), then Ogre compile out of the box but Cegui complain about the lik2019 error (undefined symbol). Anybody know how to fix that ?
there's my freeimage cmake;
there's my freeimage cmake;
Code: Select all
set(DEPNAME FreeImage)
set(SOURCES
Source/LibMNG/libmng_callback_xs.c
Source/LibMNG/libmng_chunk_descr.c
Source/LibMNG/libmng_chunk_io.c
Source/LibMNG/libmng_chunk_prc.c
Source/LibMNG/libmng_chunk_xs.c
Source/LibMNG/libmng_cms.c
Source/LibMNG/libmng_display.c
Source/LibMNG/libmng_dither.c
Source/LibMNG/libmng_error.c
Source/LibMNG/libmng_filter.c
Source/LibMNG/libmng_hlapi.c
Source/LibMNG/libmng_jpeg.c
Source/LibMNG/libmng_object_prc.c
Source/LibMNG/libmng_pixels.c
Source/LibMNG/libmng_prop_xs.c
Source/LibMNG/libmng_read.c
Source/LibMNG/libmng_trace.c
Source/LibMNG/libmng_write.c
Source/LibMNG/libmng_zlib.c
Source/OpenEXR/IlmImf/ImfAttribute.cpp
Source/OpenEXR/IlmImf/ImfB44Compressor.cpp
Source/OpenEXR/IlmImf/ImfBoxAttribute.cpp
Source/OpenEXR/IlmImf/ImfChannelList.cpp
Source/OpenEXR/IlmImf/ImfChannelListAttribute.cpp
Source/OpenEXR/IlmImf/ImfChromaticities.cpp
Source/OpenEXR/IlmImf/ImfChromaticitiesAttribute.cpp
Source/OpenEXR/IlmImf/ImfCompressionAttribute.cpp
Source/OpenEXR/IlmImf/ImfCompressor.cpp
Source/OpenEXR/IlmImf/ImfConvert.cpp
Source/OpenEXR/IlmImf/ImfCRgbaFile.cpp
Source/OpenEXR/IlmImf/ImfDoubleAttribute.cpp
Source/OpenEXR/IlmImf/ImfEnvmap.cpp
Source/OpenEXR/IlmImf/ImfEnvmapAttribute.cpp
Source/OpenEXR/IlmImf/ImfFloatAttribute.cpp
Source/OpenEXR/IlmImf/ImfFrameBuffer.cpp
Source/OpenEXR/IlmImf/ImfFramesPerSecond.cpp
Source/OpenEXR/IlmImf/ImfHeader.cpp
Source/OpenEXR/IlmImf/ImfHuf.cpp
Source/OpenEXR/IlmImf/ImfInputFile.cpp
Source/OpenEXR/IlmImf/ImfIntAttribute.cpp
Source/OpenEXR/IlmImf/ImfIO.cpp
Source/OpenEXR/IlmImf/ImfKeyCode.cpp
Source/OpenEXR/IlmImf/ImfKeyCodeAttribute.cpp
Source/OpenEXR/IlmImf/ImfLineOrderAttribute.cpp
Source/OpenEXR/IlmImf/ImfLut.cpp
Source/OpenEXR/IlmImf/ImfMatrixAttribute.cpp
Source/OpenEXR/IlmImf/ImfMisc.cpp
Source/OpenEXR/IlmImf/ImfOpaqueAttribute.cpp
Source/OpenEXR/IlmImf/ImfOutputFile.cpp
Source/OpenEXR/IlmImf/ImfPizCompressor.cpp
Source/OpenEXR/IlmImf/ImfPreviewImage.cpp
Source/OpenEXR/IlmImf/ImfPreviewImageAttribute.cpp
Source/OpenEXR/IlmImf/ImfPxr24Compressor.cpp
Source/OpenEXR/IlmImf/ImfRational.cpp
Source/OpenEXR/IlmImf/ImfRationalAttribute.cpp
Source/OpenEXR/IlmImf/ImfRgbaFile.cpp
Source/OpenEXR/IlmImf/ImfRgbaYca.cpp
Source/OpenEXR/IlmImf/ImfRleCompressor.cpp
Source/OpenEXR/IlmImf/ImfScanLineInputFile.cpp
Source/OpenEXR/IlmImf/ImfStandardAttributes.cpp
Source/OpenEXR/IlmImf/ImfStdIO.cpp
Source/OpenEXR/IlmImf/ImfStringAttribute.cpp
Source/OpenEXR/IlmImf/ImfStringVectorAttribute.cpp
Source/OpenEXR/IlmImf/ImfTestFile.cpp
Source/OpenEXR/IlmImf/ImfThreading.cpp
Source/OpenEXR/IlmImf/ImfTileDescriptionAttribute.cpp
Source/OpenEXR/IlmImf/ImfTiledInputFile.cpp
Source/OpenEXR/IlmImf/ImfTiledMisc.cpp
Source/OpenEXR/IlmImf/ImfTiledOutputFile.cpp
Source/OpenEXR/IlmImf/ImfTiledRgbaFile.cpp
Source/OpenEXR/IlmImf/ImfTileOffsets.cpp
Source/OpenEXR/IlmImf/ImfTimeCode.cpp
Source/OpenEXR/IlmImf/ImfTimeCodeAttribute.cpp
Source/OpenEXR/IlmImf/ImfVecAttribute.cpp
Source/OpenEXR/IlmImf/ImfVersion.cpp
Source/OpenEXR/IlmImf/ImfWav.cpp
Source/OpenEXR/IlmImf/ImfZipCompressor.cpp
Source/OpenEXR/Imath/ImathBox.cpp
Source/OpenEXR/Imath/ImathColorAlgo.cpp
Source/OpenEXR/Imath/ImathFun.cpp
Source/OpenEXR/Imath/ImathMatrixAlgo.cpp
Source/OpenEXR/Imath/ImathRandom.cpp
Source/OpenEXR/Imath/ImathShear.cpp
Source/OpenEXR/Imath/ImathVec.cpp
Source/OpenEXR/Iex/IexBaseExc.cpp
Source/OpenEXR/Iex/IexThrowErrnoExc.cpp
Source/OpenEXR/Half/half.cpp
Source/OpenEXR/IlmThread/IlmThread.cpp
Source/OpenEXR/IlmThread/IlmThreadMutex.cpp
Source/OpenEXR/IlmThread/IlmThreadPool.cpp
Source/OpenEXR/IlmThread/IlmThreadSemaphore.cpp
Source/LibTIFF/tif_aux.c
Source/LibTIFF/tif_close.c
Source/LibTIFF/tif_codec.c
Source/LibTIFF/tif_color.c
Source/LibTIFF/tif_compress.c
Source/LibTIFF/tif_dir.c
Source/LibTIFF/tif_dirinfo.c
Source/LibTIFF/tif_dirread.c
Source/LibTIFF/tif_dirwrite.c
Source/LibTIFF/tif_dumpmode.c
Source/LibTIFF/tif_error.c
Source/LibTIFF/tif_extension.c
Source/LibTIFF/tif_fax3.c
Source/LibTIFF/tif_fax3sm.c
Source/LibTIFF/tif_flush.c
Source/LibTIFF/tif_getimage.c
Source/LibTIFF/tif_jpeg.c
Source/LibTIFF/tif_luv.c
Source/LibTIFF/tif_lzw.c
Source/LibTIFF/tif_next.c
Source/LibTIFF/tif_ojpeg.c
Source/LibTIFF/tif_open.c
Source/LibTIFF/tif_packbits.c
Source/LibTIFF/tif_pixarlog.c
Source/LibTIFF/tif_predict.c
Source/LibTIFF/tif_print.c
Source/LibTIFF/tif_read.c
Source/LibTIFF/tif_strip.c
Source/LibTIFF/tif_swab.c
Source/LibTIFF/tif_thunder.c
Source/LibTIFF/tif_tile.c
Source/LibTIFF/tif_version.c
Source/LibTIFF/tif_warning.c
Source/LibTIFF/tif_write.c
Source/LibTIFF/tif_zip.c
Source/LibOpenJPEG/bio.c
Source/LibOpenJPEG/cio.c
Source/LibOpenJPEG/dwt.c
Source/LibOpenJPEG/event.c
Source/LibOpenJPEG/image.c
Source/LibOpenJPEG/j2k.c
Source/LibOpenJPEG/j2k_lib.c
Source/LibOpenJPEG/jp2.c
Source/LibOpenJPEG/jpt.c
Source/LibOpenJPEG/mct.c
Source/LibOpenJPEG/mqc.c
Source/LibOpenJPEG/openjpeg.c
Source/LibOpenJPEG/pi.c
Source/LibOpenJPEG/raw.c
Source/LibOpenJPEG/t1.c
Source/LibOpenJPEG/t2.c
Source/LibOpenJPEG/tcd.c
Source/LibOpenJPEG/tgt.c
Source/LibPNG/png.c
Source/LibPNG/pngerror.c
Source/LibPNG/pngget.c
Source/LibPNG/pngmem.c
Source/LibPNG/pngpread.c
Source/LibPNG/pngread.c
Source/LibPNG/pngrio.c
Source/LibPNG/pngrtran.c
Source/LibPNG/pngrutil.c
Source/LibPNG/pngset.c
Source/LibPNG/pngtrans.c
Source/LibPNG/pngwio.c
Source/LibPNG/pngwrite.c
Source/LibPNG/pngwtran.c
Source/LibPNG/pngwutil.c
Source/FreeImage/BitmapAccess.cpp
Source/FreeImage/ColorLookup.cpp
Source/FreeImage/FreeImage.cpp
Source/FreeImage/FreeImageIO.cpp
Source/FreeImage/GetType.cpp
Source/FreeImage/MemoryIO.cpp
Source/FreeImage/PixelAccess.cpp
Source/FreeImage/NNQuantizer.cpp
Source/FreeImage/WuQuantizer.cpp
Source/FreeImage/Conversion.cpp
Source/FreeImage/Conversion16_555.cpp
Source/FreeImage/Conversion16_565.cpp
Source/FreeImage/Conversion24.cpp
Source/FreeImage/Conversion32.cpp
Source/FreeImage/Conversion4.cpp
Source/FreeImage/Conversion8.cpp
Source/FreeImage/ConversionFloat.cpp
Source/FreeImage/ConversionRGBF.cpp
Source/FreeImage/ConversionType.cpp
Source/FreeImage/ConversionUINT16.cpp
Source/FreeImage/Halftoning.cpp
Source/FreeImage/tmoColorConvert.cpp
Source/FreeImage/tmoDrago03.cpp
Source/FreeImage/tmoFattal02.cpp
Source/FreeImage/tmoReinhard05.cpp
Source/FreeImage/ToneMapping.cpp
Source/FreeImage/J2KHelper.cpp
Source/FreeImage/Plugin.cpp
Source/FreeImage/PluginBMP.cpp
Source/FreeImage/PluginCUT.cpp
Source/FreeImage/PluginDDS.cpp
Source/FreeImage/PluginEXR.cpp
Source/FreeImage/PluginG3.cpp
Source/FreeImage/PluginGIF.cpp
Source/FreeImage/PluginHDR.cpp
Source/FreeImage/PluginICO.cpp
Source/FreeImage/PluginIFF.cpp
Source/FreeImage/PluginJ2K.cpp
Source/FreeImage/PluginJP2.cpp
Source/FreeImage/PluginJPEG.cpp
Source/FreeImage/PluginKOALA.cpp
Source/FreeImage/PluginMNG.cpp
Source/FreeImage/PluginPCD.cpp
Source/FreeImage/PluginPCX.cpp
Source/FreeImage/PluginPFM.cpp
Source/FreeImage/PluginPICT.cpp
Source/FreeImage/PluginPNG.cpp
Source/FreeImage/PluginPNM.cpp
Source/FreeImage/PluginPSD.cpp
Source/FreeImage/PluginRAS.cpp
Source/FreeImage/PluginRAW.cpp
Source/FreeImage/PluginSGI.cpp
Source/FreeImage/PluginTARGA.cpp
Source/FreeImage/PluginTIFF.cpp
Source/FreeImage/PluginWBMP.cpp
Source/FreeImage/PluginXBM.cpp
Source/FreeImage/PluginXPM.cpp
Source/FreeImage/PSDParser.cpp
Source/FreeImage/TIFFLogLuv.cpp
Source/DeprecationManager/Deprecated.cpp
Source/DeprecationManager/DeprecationMgr.cpp
Source/FreeImage/CacheFile.cpp
Source/FreeImage/MultiPage.cpp
Source/FreeImage/ZLibInterface.cpp
Source/Metadata/Exif.cpp
Source/Metadata/FIRational.cpp
Source/Metadata/FreeImageTag.cpp
Source/Metadata/IPTC.cpp
Source/Metadata/TagConversion.cpp
Source/Metadata/TagLib.cpp
Source/Metadata/XTIFF.cpp
Source/FreeImageToolkit/Background.cpp
Source/FreeImageToolkit/BSplineRotate.cpp
Source/FreeImageToolkit/Channels.cpp
Source/FreeImageToolkit/ClassicRotate.cpp
Source/FreeImageToolkit/Colors.cpp
Source/FreeImageToolkit/CopyPaste.cpp
Source/FreeImageToolkit/Display.cpp
Source/FreeImageToolkit/Flip.cpp
Source/FreeImageToolkit/JPEGTransform.cpp
Source/FreeImageToolkit/MultigridPoissonSolver.cpp
Source/FreeImageToolkit/Rescale.cpp
Source/FreeImageToolkit/Resize.cpp
Source/ZLib/adler32.c
Source/ZLib/compress.c
Source/ZLib/crc32.c
Source/ZLib/deflate.c
Source/ZLib/infback.c
Source/ZLib/inffast.c
Source/ZLib/inflate.c
Source/ZLib/inftrees.c
Source/ZLib/trees.c
Source/ZLib/uncompr.c
Source/ZLib/zutil.c
Source/LibJPEG/jaricom.c
Source/LibJPEG/jcapimin.c
Source/LibJPEG/jcapistd.c
Source/LibJPEG/jcarith.c
Source/LibJPEG/jccoefct.c
Source/LibJPEG/jccolor.c
Source/LibJPEG/jcdctmgr.c
Source/LibJPEG/jchuff.c
Source/LibJPEG/jcinit.c
Source/LibJPEG/jcmainct.c
Source/LibJPEG/jcmarker.c
Source/LibJPEG/jcmaster.c
Source/LibJPEG/jcomapi.c
Source/LibJPEG/jcparam.c
Source/LibJPEG/jcprepct.c
Source/LibJPEG/jcsample.c
Source/LibJPEG/jctrans.c
Source/LibJPEG/jdapimin.c
Source/LibJPEG/jdapistd.c
Source/LibJPEG/jdarith.c
Source/LibJPEG/jdatadst.c
Source/LibJPEG/jdatasrc.c
Source/LibJPEG/jdcoefct.c
Source/LibJPEG/jdcolor.c
Source/LibJPEG/jddctmgr.c
Source/LibJPEG/jdhuff.c
Source/LibJPEG/jdinput.c
Source/LibJPEG/jdmainct.c
Source/LibJPEG/jdmarker.c
Source/LibJPEG/jdmaster.c
Source/LibJPEG/jdmerge.c
Source/LibJPEG/jdpostct.c
Source/LibJPEG/jdsample.c
Source/LibJPEG/jdtrans.c
Source/LibJPEG/jerror.c
Source/LibJPEG/jfdctflt.c
Source/LibJPEG/jfdctfst.c
Source/LibJPEG/jfdctint.c
Source/LibJPEG/jidctflt.c
Source/LibJPEG/jidctfst.c
Source/LibJPEG/jidctint.c
Source/LibJPEG/jmemmgr.c
Source/LibJPEG/jmemnobs.c
Source/LibJPEG/jquant1.c
Source/LibJPEG/jquant2.c
Source/LibJPEG/jutils.c
Source/LibJPEG/transupp.c
Source/LibRawLite/internal/dcraw_common.cpp
Source/LibRawLite/internal/dcraw_fileio.cpp
Source/LibRawLite/internal/demosaic_packs.cpp
Source/LibRawLite/src/libraw_c_api.cpp
Source/LibRawLite/src/libraw_cxx.cpp)
set(HEADERS FreeImage.h)
include_directories(
Source
Source/LibTIFF
Source/LibRawLite
Source/ZLib
Source/DeprecationManager
Source/OpenEXR
Source/OpenEXR/Half
Source/OpenEXR/Iex
Source/OpenEXR/IlmImf
Source/OpenEXR/Imath
Source/OpenEXR/IlmThread)
add_definitions(-DOPJ_STATIC -DLIBRAW_NODLL -DLIBRAW_LIBRARY_BUILD -DNO_LCMS -DMNG_BUILD_SO)
#Cegui compile with that but not Ogre
cegui_add_library(${DEPNAME} SOURCES NONE)
#Ogre compile with that but not Cegui
#add_library(${DEPNAME} STATIC ${SOURCES})
if (MINGW)
target_link_libraries(${DEPNAME} ws2_32)
endif()
foreach(_H_FILE ${HEADERS})
add_custom_command(TARGET ${DEPNAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source/${_H_FILE}"
"${CMAKE_BINARY_DIR}/dependencies/include/${_H_FILE}")
endforeach()