1 Star 0 Fork 0

qqq/emgucv

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CMakeLists.txt 166.04 KB
一键复制 编辑 原始数据 按行查看 历史
Canming Huang 提交于 2024-03-06 16:29 . Fix Ubuntu build
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398
# --------------------------------------------------------
# Copyright (C) 2004-2024 by EMGU Corporation. All rights reserved.
#
# Root CMake file for Emgu CV
#
# From the off-tree build directory, invoke:
# $ cmake <PATH_TO_EMGUCV_ROOT>
#
# --------------------------------------------------------
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
INCLUDE (CheckPlatform)
#IF( (WIN32 AND (NOT NETFX_CORE)) OR IS_UBUNTU OR (APPLE AND ("${IOS_ARCH}" STREQUAL "")) )
#IF( (WIN32 AND (NOT NETFX_CORE) AND (NOT IS_ARM64)) OR IS_UBUNTU )
# SET(EMGU_CV_WITH_DEPTHAI ON CACHE BOOL "Build support for OAK-1 and OAK-D")
#ELSE()
SET(EMGU_CV_WITH_DEPTHAI OFF CACHE BOOL "Build support for OAK-1 and OAK-D")
#ENDIF()
#IF(EMGU_CV_WITH_DEPTHAI)
# # Set defaults
# set(HUNTER_CONFIGURATION_TYPES "Release" CACHE STRING "Hunter dependencies list of build configurations")
#
# include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/HunterGate.cmake")
#
# HunterGate(
# URL "https://github.com/cpp-pm/hunter/archive/v0.24.0.tar.gz"
# SHA1 "a3d7f4372b1dcd52faa6ff4a3bd5358e1d0e5efd"
# FILEPATH ${CMAKE_CURRENT_LIST_DIR}/Emgu.CV.Extern/depthai-core/cmake/Hunter/config.cmake # Add depthai-core config (hunter limitation)
# )
#
# # Move binary dir if windows, to shorten the path
# if(WIN32)
# set(HUNTER_BINARY_DIR "${HUNTER_GATE_ROOT}/_bin" CACHE STRING "Hunter binary directory")
# endif()
# #MESSAGE(STATUS: "CMAKE_MODULE_PATH --- ${CMAKE_MODULE_PATH}")
#ENDIF()
IF(EMGU_CV_WITH_DEPTHAI)
# Always build depthai-core as a static library
SET(BUILD_SHARED_LIBS_CACHE ${BUILD_SHARED_LIBS})
SET(BUILD_SHARED_LIBS OFF)
add_subdirectory(Emgu.CV.Extern/depthai-core EXCLUDE_FROM_ALL)
SET(BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_CACHE})
ENDIF()
PROJECT(emgucv)
CMAKE_MINIMUM_REQUIRED(VERSION 3.16)
if(POLICY CMP0022)
#cmake_policy(SET CMP0022 NEW)
SET(CMAKE_POLICY_DEFAULT_CMP0022 NEW)
endif()
if(POLICY CMP0069)
#cmake_policy(SET CMP0069 NEW)
SET(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
endif()
#IF(ANDROID)
#include(CheckIPOSupported)
#check_ipo_supported(RESULT supported OUTPUT error)
#if( supported )
# message(STATUS "IPO / LTO enabled")
# set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
#else()
# message(STATUS "IPO / LTO not supported: <${error}>")
#endif()
#ENDIF()
IF( WIN32 OR ANDROID OR IOS OR NETFX_CORE)
SET(EMGU_CV_WITH_FREETYPE ON CACHE BOOL "BUILD FREETYPE")
ELSE()
SET(EMGU_CV_WITH_FREETYPE OFF CACHE BOOL "BUILD FREETYPE")
ENDIF()
#IF(WIN32)
# FIND_PACKAGE(HDF5)
# IF (TARGET hdf5-static)
# get_target_property(HDF5_LIBRARIES hdf5-static IMPORTED_LOCATION_RELEASE)
# MESSAGE(STATUS "HDF5_DIRS: ${HDF5_DIRS}")
# MESSAGE(STATUS "HDF5_INCLUDE_DIRS: ${HDF5_INCLUDE_DIRS}")
# MESSAGE(STATUS "HDF5_LIBRARIES: ${HDF5_LIBRARIES}")
# SET(HDF5_FOUND ON)
# SET(HDF5_C_LIBRARY ${HDF5_LIBRARIES})
# message(STATUS "HDF5: ${HDF5_DIR} (ver ${HDF5_VERSION})")
# MESSAGE(STATUS "ENV HDF5 : $ENV{HDF5_DIR}/../")
# MESSAGE(STATUS "HDF5_INCLUDE_DIRS SEARCH PATH : $ENV{HDF5_DIR}/../include")
# MESSAGE(STATUS "HDF5_C_LIBRARY SEARCH PATH : $ENV{HDF5_DIR}/../lib")
# else()
# message(STATUS "HDF5: NO")
# endif()
#ENDIF()
IF(IS_UBUNTU OR IS_RHEL)
#USE system freetype, do nothing here.
ELSEIF (EMGU_CV_WITH_FREETYPE)
# ExternalProject_Add(
# harfbuzz
# GIT_REPOSITORY https://github.com/harfbuzz/harfbuzz.git
# GIT_TAG 2.7.2
# CMAKE_ARGS -DCMAKE_FIND_ROOT_PATH:STRING=${FREETYPE_INSTALL_DIR} -DHB_HAVE_FREETYPE:BOOL=TRUE
# PREFIX ${CMAKE_CURRENT_BINARY_DIR}/install
# )
# ExternalProject_Get_Property(harfbuzz install_dir)
# SET(HARFBUZZ_INSTALL_DIR ${install_dir})
# #add_library(harfbuzz STATIC IMPORTED)
# #set_property(TARGET harfbuzz PROPERTY IMPORTED_LOCATION HARFBUZZ_INSTALL_DIR)
MESSAGE(STATUS "Setting up FREETYPE")
# find_package(FREETYPE CONFIG REQUIRED)
find_package(FREETYPE CONFIG)
if(NOT FREETYPE_FOUND)
message(STATUS "FREETYPE: NO")
else()
message(STATUS "FREETYPE: ${FREETYPE_DIR} (ver ${FREETYPE_VERSION})")
SET(FREETYPE_INCLUDE_DIRS "${FREETYPE_DIR}/../../../include/freetype2")
SET(FREETYPE_LIBRARY freetype)
get_target_property(FREETYPE_LIBRARIES freetype IMPORTED_LOCATION_RELEASE)
#SET(FREETYPE_LIBRARIES ${FREETYPE_LIBRARIES} CACHE STRING "FREETYPE library")
#SET(FREETYPE_LINK_LIBRARIES ${FREETYPE_LIBRARIES} CACHE STRING "FREETYPE library")
#SET(FREETYPE_LIBRARIES ${FREETYPE_LIBRARIES})
SET(FREETYPE_LINK_LIBRARIES ${FREETYPE_LIBRARIES})
SET(FREETYPE_LINK_LIBRARIES_XXXXX ${FREETYPE_LINK_LIBRARIES})
MESSAGE(STATUS "FREETYPE_LIBRARIES: ${FREETYPE_LIBRARIES}")
#SET(FREETYPE_LIBRARIES freetype)
#SET(FREETYPE_FOUND ON)
endif()
# find_package(HARFBUZZ CONFIG REQUIRED)
find_package(HARFBUZZ CONFIG)
if(NOT HARFBUZZ_FOUND)
message(STATUS "HARFBUZZ: NO")
else()
message(STATUS "HARFBUZZ: ${HARFBUZZ_DIR} (ver ${HARFBUZZ_VERSION})")
SET(HARFBUZZ_INCLUDE_DIRS "${HARFBUZZ_DIR}/../../../include/harfbuzz")
get_target_property(HARFBUZZ_LIBRARY harfbuzz::harfbuzz IMPORTED_LOCATION_RELEASE)
#SET(HARFBUZZ_LIBRARIES ${HARFBUZZ_LIBRARY} CACHE STRING "HARFBUZZ library")
#SET(HARFBUZZ_LINK_LIBRARIES ${HARFBUZZ_LIBRARY} CACHE STRING "HARFBUZZ library")
SET(HARFBUZZ_LIBRARIES ${HARFBUZZ_LIBRARY})
SET(HARFBUZZ_LINK_LIBRARIES ${HARFBUZZ_LIBRARY})
SET(HARFBUZZ_LINK_LIBRARIES_XXXXX ${HARFBUZZ_LINK_LIBRARIES})
MESSAGE(STATUS "HARFBUZZ_LIBRARIES: ${HARFBUZZ_LIBRARIES}")
#IF (WIN32)
# SET(HARFBUZZ_LIBRARY "${HARFBUZZ_DIR}/../../harfbuzz.lib")
#ELSE()
# SET(HARFBUZZ_LIBRARY "harfbuzz")
#ENDIF()
#message(STATUS "HARFBUZZ_DIR: ${HARFBUZZ_DIR}")
#message(STATUS "harfbuzz_INCLUDE_DIRS: ${harfbuzz_INCLUDE_DIRS}")
#message(STATUS "HARFBUZZ_INCLUDE_DIRS: ${HARFBUZZ_INCLUDE_DIRS}")
#SET(HARFBUZZ_FOUND ON)
#MESSAGE(STATUS "Adding include_directory: ${HARFBUZZ_DIR}/../../../include/harfbuzz")
include_directories(${HARFBUZZ_INCLUDE_DIRS})
endif()
# ELSE()
# ENDIF()
ELSE()
SET(FREETYPE_LIBRARY "")
ENDIF()
IF(WITH_OPENVINO)
find_package(TBB CONFIG)
find_package(OpenVINO CONFIG)
find_package(ngraph CONFIG)
ENDIF()
IF("${CMAKE_SYSTEM_NAME}" STREQUAL "Emscripten")
SET(CMAKE_C_FLAGS_RELEASE "-flto ${CMAKE_C_FLAGS_RELEASE}")
SET(CMAKE_CXX_FLAGS_RELEASE "-flto ${CMAKE_CXX_FLAGS_RELEASE}")
SET(CMAKE_C_FLAGS_DEBUG "-flto ${CMAKE_C_FLAGS_DEBUG}")
SET(CMAKE_CXX_FLAGS_DEBUG "-flto ${CMAKE_CXX_FLAGS_DEBUG}")
SET(CMAKE_EXE_LINKER_FLAGS "-flto ${CMAKE_EXE_LINKER_FLAGS}")
SET(CMAKE_SHARED_LINKER_FLAGS "-flto ${CMAKE_SHARED_LINKER_FLAGS}")
#SET(CMAKE_STATIC_LINKER_FLAGS "-flto ${CMAKE_STATIC_LINKER_FLAGS}")
set(CMAKE_AR "emcc")
set(CMAKE_STATIC_LIBRARY_SUFFIX ".bc")
set(CMAKE_C_CREATE_STATIC_LIBRARY "<CMAKE_AR> -flto -r -o <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_CXX_CREATE_STATIC_LIBRARY "<CMAKE_AR> -flto -r -o <TARGET> <LINK_FLAGS> <OBJECTS>")
ENDIF()
#IF( NOT (NETFX_CORE OR ANDROID OR IOS ) )
# IF (NOT WIN32)
# SET(CMAKE_C_FLAGS_RELEASE "-fPIC ${CMAKE_C_FLAGS_RELEASE}")
# SET(CMAKE_CXX_FLAGS_RELEASE "-fPIC ${CMAKE_CXX_FLAGS_RELEASE}")
# SET(CMAKE_C_FLAGS_DEBUG "-fPIC ${CMAKE_C_FLAGS_DEBUG}")
# SET(CMAKE_CXX_FLAGS_DEBUG "-fPIC ${CMAKE_CXX_FLAGS_DEBUG}")
# SET(CMAKE_EXE_LINKER_FLAGS "-fPIC ${CMAKE_EXE_LINKER_FLAGS}")
# SET(CMAKE_SHARED_LINKER_FLAGS "-fPIC ${CMAKE_SHARED_LINKER_FLAGS}")
# ENDIF()
#IF (WIN32)
# SET(BUILD_SHARED_LIBS_CACHE ${BUILD_SHARED_LIBS})
# SET(BUILD_SHARED_LIBS OFF)
# SET(CMAKE_EXPORT_NO_PACKAGE_REGISTRY ON)
#ADD_SUBDIRECTORY(vtk) # always build vtk as static library
#SET(BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_CACHE})
#ENDIF()
# IF (NOT WIN32)
# SET(CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE_CACHE} )
# SET(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE_CACHE})
# ENDIF()
#ENDIF()
SET(OPENCV_SUBFOLDER ${CMAKE_CURRENT_SOURCE_DIR}/opencv)
SET(OPENCV_CONTRIB_SUBFOLDER ${CMAKE_CURRENT_SOURCE_DIR}/opencv_contrib)
SET(OPENCV_EXTRA_SUBFOLDER ${CMAKE_CURRENT_SOURCE_DIR}/opencv_extra)
SET(CSC_PREFERRED_VERSION "4.0")
IF((NOT NETFX_CORE) AND MSVC)
#SET CSC 3.5 as the prefered compiler for EMGU CV
SET(CSC_TARGET_FRAMEWORK "3.5" CACHE STRING "C# target framework")
ELSE()
#SET CSC 4.5 (in the .Net framework 4.0 folder) as the prefered compiler for EMGU CV
SET(CSC_TARGET_FRAMEWORK "" CACHE STRING "C# target framework")
ENDIF()
FIND_PACKAGE(CSharp REQUIRED)
INCLUDE (CSharpMacros)
IF (NOT (DOTNET_FOUND))
IF (IS_UBUNTU)
MESSAGE(FATAL_ERROR "dotnet sdk is required to build Emgu CV on Ubuntu, please follow the instructions to install dotnet sdk on Ubuntu: https://dotnet.microsoft.com/download/linux-package-manager/ubuntu18-04/sdk-current")
ELSEIF(IS_DEBIAN OR IS_RHEL)
MESSAGE(FATAL_ERROR "dotnet sdk is required to build Emgu CV")
ENDIF()
ENDIF()
INCLUDE (CheckTargetArch)
INCLUDE (OpenCVVersion)
IF(WIN32)
INCLUDE (FindCodeSign)
ENDIF()
#SET(LIBRARY_3RDPARTY_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib/3rdParty)
# ----------------------------------------------------------------------------
# Check if 32bit or 64-bit
# ----------------------------------------------------------------------------
CHECK_TARGET_ARCH()
SET(EMGUCV_ARCH ${TARGET_ARCH_NAME})
MESSAGE(STATUS "Building for ${EMGUCV_ARCH}")
IF ( TARGET_ARCH_64 )
IF (TARGET_ARM)
SET(NUGET_NATIVE_PLATFORM_ID_ARCH "arm64")
ELSE()
SET(NUGET_NATIVE_PLATFORM_ID_ARCH "x64")
ENDIF()
ELSE()
IF (TARGET_ARM)
SET(NUGET_NATIVE_PLATFORM_ID_ARCH "arm")
ELSE()
SET(NUGET_NATIVE_PLATFORM_ID_ARCH "x86")
ENDIF()
ENDIF()
IF(WIN32 AND CV_ICC)
# SET(CV_ICC_ADDITIONAL_FLAGS_RELEASE "/O3 /QaxCORE-AVX2,AVX,SSE4.1,SSE3 /Qparallel /Qopt-report:1 /Qopt-report-phase:vec /Qopt-report-phase:par /Qopt-report-file:stderr /Qipo /Qunroll-aggressive")
SET(CV_ICC_ADDITIONAL_FLAGS_RELEASE "/O3 /QaxCORE-AVX2,AVX,SSE4.1,SSE3 /Qparallel /Qopt-report:1 /Qopt-report-phase:vec /Qopt-report-phase:par /Qipo /Qrestrict /Ot")
STRING(REGEX REPLACE "/O2" ${CV_ICC_ADDITIONAL_FLAGS_RELEASE} CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
STRING(REGEX REPLACE "/O2" ${CV_ICC_ADDITIONAL_FLAGS_RELEASE} CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:\"libcmt\"")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:\"libcmt\"")
set(EMGUCV_PLATFORM_TOOLSET "Intel C++ Compiler 19.1" CACHE STRING "Platform toolset for Visual Studio")
ENDIF()
IF(WIN32 AND NOT MINGW)
SET(NETFX_CORE OFF CACHE BOOL "Build Windows Store App")
# IF(NETFX_CORE)
# add_definitions(-DWINAPI_FAMILY=WINAPI_FAMILY_APP -DWINVER=0x0602 -D_WIN32_WINNT=0x0602)
# add_definitions(-D_UNICODE)
# ENDIF()
ENDIF()
IF(IOS)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/libs)
ELSE()
SET(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/libs)
ENDIF()
IF(NOT WIN32)
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/libs)
ENDIF()
MESSAGE(STATUS "<<<< EMGUCV_ARCH: ${EMGUCV_ARCH} >>>>")
MESSAGE(STATUS "<<<< CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME} >>>>")
MESSAGE(STATUS "<<<< CMAKE_SYSTEM_VERSION: ${CMAKE_SYSTEM_VERSION} >>>>")
MESSAGE(STATUS "<<<< CMAKE_GENERATOR: ${CMAKE_GENERATOR} >>>>")
MESSAGE(STATUS "<<<< CMAKE_HOST_SYSTEM_PROCESSOR: ${CMAKE_HOST_SYSTEM_PROCESSOR} >>>>")
MESSAGE(STATUS "<<<< CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR} >>>>")
IF(APPLE)
MESSAGE(STATUS "<<<< CMAKE_APPLE_SILICON_PROCESSOR: ${CMAKE_APPLE_SILICON_PROCESSOR} >>>>")
ENDIF()
IF(IPHONESIMULATOR)
MESSAGE(STATUS "<<<< IPHONESIMULATOR: ${IPHONESIMULATOR} >>>>")
ENDIF()
IF(IPHONEOS)
MESSAGE(STATUS "<<<< IPHONEOS: ${IPHONEOS} >>>>")
ENDIF()
IF(ANDROID)
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "/android/${ANDROID_ABI}")
ELSEIF("${CMAKE_SYSTEM_NAME}" STREQUAL "Emscripten")
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "/webgl")
ELSEIF(WIN32)
MESSAGE(STATUS "<<<< MSVC_C_ARCHITECTURE_ID: ${MSVC_C_ARCHITECTURE_ID} >>>>")
IF ("${EMGUCV_ARCH}" STREQUAL "win64")
IF("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore" AND (CMAKE_SYSTEM_VERSION MATCHES 10.0))
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "/runtimes/win10-x64/native")
ELSE()
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "/runtimes/win-x64/native")
ENDIF()
ELSEIF("${EMGUCV_ARCH}" STREQUAL "arm64")
IF("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore" AND (CMAKE_SYSTEM_VERSION MATCHES 10.0))
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "/runtimes/win10-arm64/native")
ELSE()
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "/runtimes/win-arm64/native")
ENDIF()
ELSEIF("${EMGUCV_ARCH}" STREQUAL "arm")
IF("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore" AND (CMAKE_SYSTEM_VERSION MATCHES 10.0))
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "/runtimes/win10-arm/native")
ELSE()
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "/runtimes/win-arm/native")
ENDIF()
ELSE()
IF("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore" AND (CMAKE_SYSTEM_VERSION MATCHES 10.0))
#IF("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
# IF(CMAKE_SYSTEM_VERSION MATCHES 10.0)
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "/runtimes/win10-x86/native")
ELSE()
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "/runtimes/win-x86/native")
ENDIF()
ENDIF()
#MESSAGE(STATUS ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")
#MESSAGE(STATUS ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> EMGUCV_ARCH: ${EMGUCV_ARCH}")
#MESSAGE(STATUS ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER: ${UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER}")
ELSEIF(APPLE AND NOT IOS)
IF ("${EMGUCV_ARCH}" STREQUAL "arm64")
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "/runtimes/osx/native/arm64")
ELSE()
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "/runtimes/osx/native/x64")
ENDIF()
ELSEIF("${EMGUCV_ARCH}" STREQUAL "ubuntu_x64")
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "/runtimes/ubuntu-x64/native")
ELSEIF("${EMGUCV_ARCH}" STREQUAL "ubuntu_x86")
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "/runtimes/ubuntu-x86/native")
ELSEIF("${EMGUCV_ARCH}" STREQUAL "ubuntu_arm64")
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "/runtimes/ubuntu-arm64/native")
ELSEIF("${EMGUCV_ARCH}" STREQUAL "ubuntu_arm")
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "/runtimes/ubuntu-arm/native")
ELSEIF("${EMGUCV_ARCH}" STREQUAL "rhel_x64")
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "/runtimes/rhel-x64/native")
ELSEIF("${EMGUCV_ARCH}" STREQUAL "rhel_x86")
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "/runtimes/rhel-x86/native")
ELSEIF("${EMGUCV_ARCH}" STREQUAL "rhel_arm64")
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "/runtimes/rhel-arm64/native")
ELSEIF("${EMGUCV_ARCH}" STREQUAL "rhel_arm")
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "/runtimes/rhel-arm/native")
ELSEIF("${EMGUCV_ARCH}" STREQUAL "debian_arm")
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "/runtimes/linux-arm/native")
ELSEIF("${EMGUCV_ARCH}" STREQUAL "debian_arm64")
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "/runtimes/linux-arm64/native")
ELSEIF("${EMGUCV_ARCH}" STREQUAL "arm64")
IF(IPHONEOS)
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "/iphoneos_arm64")
ELSEIF(IPHONESIMULATOR)
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "/simulator_arm64")
ELSE()
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "/arm64")
ENDIF()
ELSEIF("${EMGUCV_ARCH}" STREQUAL "arm")
IF(IPHONEOS)
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "/iphoneos_arm")
ELSEIF(IPHONESIMULATOR)
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "/simulator_arm")
ELSE()
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "/arm")
ENDIF()
ELSE()
SET(UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER "")
ENDIF()
SET(UNMANAGED_LIBRARY_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/libs${UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER}")
IF(ANDROID)
SET(LIBRARY_OUTPUT_PATH ${UNMANAGED_LIBRARY_OUTPUT_PATH})
ENDIF()
FILE(MAKE_DIRECTORY ${UNMANAGED_LIBRARY_OUTPUT_PATH})
SET(UNMANAGED_DLL_EXTRA)
MACRO(CHECK_BINARY_EXIST folder pattern property_name second_check)
#IF("${UNMANAGED_LIBRARY_OUTPUT_PATH}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/${folder}")
# SET(${property_name} ON)
#ELSE()
FILE(GLOB DLL_LIST "${CMAKE_CURRENT_SOURCE_DIR}/${folder}/${pattern}")
LIST(LENGTH DLL_LIST DLL_LIST_LENGTH)
IF(DLL_LIST_LENGTH GREATER 0)
LIST(APPEND UNMANAGED_DLL_EXTRA ${DLL_LIST})
MESSAGE(STATUS "Including the following files in package: ${DLL_LIST}")
INSTALL(
FILES
${DLL_LIST}
DESTINATION ${folder}
COMPONENT emgucv_binary
)
SET(${property_name} ON)
ELSE()
SET(${property_name} ${second_check})
ENDIF()
#ENDIF()
#MESSAGE(STATUS "Property - ${property_name}: ${${property_name}}")
IF(${${property_name}})
MESSAGE(STATUS "${property_name}: ${${property_name}}")
ENDIF()
ENDMACRO()
#MESSAGE(STATUS "CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}")
SET(IS_IOS_BUILD OFF)
SET(IS_MAC_CATALYST_BUILD OFF)
SET(IS_MAC_CATALYST_ARM64_BUILD OFF)
SET(IS_MAC_CATALYST_X86_64_BUILD OFF)
IF(MAC_CATALYST)
SET(IS_MAC_CATALYST_BUILD ON)
MESSAGE(STATUS "IS_MAC_CATALYST_BUILD: ${IS_MAC_CATALYST_BUILD}")
IF (IS_MAC_CATALYST_BUILD AND ("${EMGUCV_ARCH}" STREQUAL "arm64"))
SET(IS_MAC_CATALYST_ARM64_BUILD ON)
MESSAGE(STATUS "IS_MAC_CATALYST_ARM64_BUILD: ${IS_MAC_CATALYST_ARM64_BUILD}")
ENDIF()
IF (IS_MAC_CATALYST_BUILD AND ("${EMGUCV_ARCH}" STREQUAL "x86_64"))
SET(IS_MAC_CATALYST_X86_64_BUILD ON)
MESSAGE(STATUS "IS_MAC_CATALYST_X86_64_BUILD: ${IS_MAC_CATALYST_X86_64_BUILD}")
ENDIF()
ELSEIF(IOS)
SET(IS_IOS_BUILD ON)
MESSAGE(STATUS "IS_IOS_BUILD: ${IS_IOS_BUILD}")
SET(IS_IOS_I386_BUILD OFF)
IF(IS_IOS_BUILD AND ("${IOS_ARCH}" STREQUAL "i386"))
SET(IS_IOS_I386_BUILD ON)
MESSAGE(STATUS "IS_IOS_I386_BUILD: ${IS_IOS_I386_BUILD}")
ENDIF()
#CHECK_BINARY_EXIST("libs/iOS" "libcvextern_i386.a" HAVE_IOS_I386 ${IS_IOS_I386_BUILD})
SET(IS_IOS_X86_64_BUILD OFF)
IF(IS_IOS_BUILD AND ("${IOS_ARCH}" STREQUAL "x86_64"))
SET(IS_IOS_X86_64_BUILD ON)
MESSAGE(STATUS "IS_IOS_X86_64_BUILD: ${IS_IOS_X86_64_BUILD}")
ENDIF()
#CHECK_BINARY_EXIST("libs/iOS" "libcvextern_x86_64.a" HAVE_IOS_X86_64 ${IS_IOS_X86_64_BUILD})
SET(IS_IOS_ARMV7S_BUILD OFF)
IF(IS_IOS_BUILD AND ("${IOS_ARCH}" STREQUAL "armv7s"))
SET(IS_IOS_ARMV7S_BUILD ON)
MESSAGE(STATUS "IS_IOS_ARMV7S_BUILD: ${IS_IOS_ARMV7S_BUILD}")
ENDIF()
#CHECK_BINARY_EXIST("libs/iOS" "libcvextern_armv7s.a" HAVE_IOS_ARMV7S ${IS_IOS_ARMV7S_BUILD})
SET(IS_IOS_ARMV7_BUILD OFF)
IF(IS_IOS_BUILD AND ("${IOS_ARCH}" STREQUAL "armv7"))
SET(IS_IOS_ARMV7_BUILD ON)
MESSAGE(STATUS "IS_IOS_ARMV7_BUILD: ${IS_IOS_ARMV7_BUILD}")
ENDIF()
#CHECK_BINARY_EXIST("libs/iOS" "libcvextern_armv7.a" HAVE_IOS_ARMV7 ${IS_IOS_ARMV7_BUILD})
SET(IS_IOS_ARM64_BUILD OFF)
IF(IS_IOS_BUILD AND ("${IOS_ARCH}" STREQUAL "arm64"))
SET(IS_IOS_ARM64_BUILD ON)
MESSAGE(STATUS "IS_IOS_ARM64_BUILD: ${IS_IOS_ARM64_BUILD}")
ENDIF()
#CHECK_BINARY_EXIST("libs/iOS" "libcvextern_arm64.a" HAVE_IOS_ARM64 ${IS_IOS_ARM64_BUILD})
ENDIF()
CHECK_BINARY_EXIST("libs/iOS" "libcvextern_iphoneos.a" HAVE_IOS_DEVICE ${IS_IOS_BUILD})
CHECK_BINARY_EXIST("libs/iOS" "libcvextern_simulator.a" HAVE_IOS_SIMULATOR ${IS_IOS_BUILD})
CHECK_BINARY_EXIST("libs/iOS" "libcvextern_universal.a" HAVE_IOS_UNIVERSAL ${IS_IOS_BUILD})
IF (HAVE_IOS_DEVICE OR HAVE_IOS_SIMULATOR OR HAVE_IOS_UNIVERSAL)
SET(HAVE_IOS ON)
MESSAGE(STATUS "HAVE_IOS: ${HAVE_IOS}")
ELSE()
SET(HAVE_IOS OFF)
ENDIF()
CHECK_BINARY_EXIST("libs" "Emgu.CV.Platform.Xamarin.IOS.dll" HAVE_XAMARIN_IOS ${HAVE_IOS})
CHECK_BINARY_EXIST("libs" "Emgu.CV.Platform.Maui.iOS.dll" HAVE_MAUI_IOS ${HAVE_IOS})
CHECK_BINARY_EXIST("libs/iOS" "libcvextern_catalyst_arm64.a" HAVE_MAC_CATALYST_ARM64 ${IS_MAC_CATALYST_ARM64_BUILD})
CHECK_BINARY_EXIST("libs/iOS" "libcvextern_catalyst_x86_64.a" HAVE_MAC_CATALYST_X86_64 ${IS_MAC_CATALYST_X86_64_BUILD})
IF (HAVE_MAC_CATALYST_ARM64 OR HAVE_MAC_CATALYST_X86_64)
SET(HAVE_MAC_CATALYST ON)
MESSAGE(STATUS "HAVE_MAC_CATALYST: ${HAVE_MAC_CATALYST}")
ELSE()
SET(HAVE_MAC_CATALYST OFF)
ENDIF()
CHECK_BINARY_EXIST("libs" "Emgu.CV.Platform.Maui.Mac.dll" HAVE_MAUI_MAC ${HAVE_MAC_CATALYST})
#IF(NOT HAVE_IOS)
# IF(HAVE_IOS_I386 OR HAVE_IOS_X86_64 OR HAVE_IOS_ARMV7S OR HAVE_IOS_ARMV7 OR HAVE_IOS_ARM64)
# SET(HAVE_IOS ON)
# ENDIF()
#ENDIF()
#SET(HAVE_IOS_ALL_ARCH OFF)
#IF(HAVE_IOS_I386 AND HAVE_IOS_X86_64 AND HAVE_IOS_ARMV7S AND HAVE_IOS_ARMV7 AND HAVE_IOS_ARM64)
# SET(HAVE_IOS_ALL_ARCH ON)
#ENDIF()
#IF(HAVE_IOS_ALL_ARCH)
# MESSAGE(STATUS "HAVE_IOS_ALL_ARCH: ${HAVE_IOS_ALL_ARCH}")
#ENDIF()
#IF(HAVE_IOS)
# MESSAGE(STATUS "HAVE_IOS: ON")
#ENDIF()
SET(IS_MACOS_BUILD OFF)
IF(APPLE AND (NOT IOS))
SET(IS_MACOS_BUILD ON)
MESSAGE(STATUS "IS_MACOS_BUILD: ${IS_MACOS_BUILD}")
ENDIF()
CHECK_BINARY_EXIST("libs/runtimes/osx/native" "lib*.dylib" HAVE_MACOS ${IS_MACOS_BUILD})
CHECK_BINARY_EXIST("libs" "Emgu.CV.Platform.Xamarin.Mac.dll" HAVE_XAMARIN_MAC ${IS_MACOS_BUILD})
SET(IS_ANDROID_ARM64_V8A_BUILD OFF)
IF(ANDROID AND ("${ANDROID_ABI}" STREQUAL "arm64-v8a"))
SET(IS_ANDROID_ARM64_V8A_BUILD ON)
MESSAGE(STATUS "IS_ANDROID_ARM64_V8A_BUILD: ${IS_ANDROID_ARM64_V8A_BUILD}")
ENDIF()
CHECK_BINARY_EXIST("libs/android/arm64-v8a" "*.so" HAVE_ANDROID_ARM64_V8A ${IS_ANDROID_ARM64_V8A_BUILD})
#SET(IS_ANDROID_ARMEABI_BUILD OFF)
#IF(ANDROID AND ("${ANDROID_ABI}" STREQUAL "armeabi"))
# SET(IS_ANDROID_ARMEABI_BUILD ON)
# MESSAGE(STATUS "IS_ANDROID_ARMEABI_BUILD: ${IS_ANDROID_ARMEABI_BUILD}")
#ENDIF()
#CHECK_BINARY_EXIST("libs/android/armeabi" "*.so" HAVE_ANDROID_ARMEABI ${IS_ANDROID_ARMEABI_BUILD})
SET(IS_ANDROID_ARMEABI_V7A_BUILD OFF)
IF(ANDROID AND ("${ANDROID_ABI}" STREQUAL "armeabi-v7a"))
SET(IS_ANDROID_ARMEABI_V7A_BUILD ON)
MESSAGE(STATUS "IS_ANDROID_ARMEABI_V7A_BUILD: ${IS_ANDROID_ARMEABI_V7A_BUILD}")
ENDIF()
CHECK_BINARY_EXIST("libs/android/armeabi-v7a" "*.so" HAVE_ANDROID_ARMEABI_V7A ${IS_ANDROID_ARMEABI_V7A_BUILD})
SET(IS_ANDROID_X86_BUILD OFF)
IF(ANDROID AND ("${ANDROID_ABI}" STREQUAL "x86"))
SET(IS_ANDROID_X86_BUILD ON)
MESSAGE(STATUS "IS_ANDROID_X86_BUILD: ${IS_ANDROID_X86_BUILD}")
ENDIF()
CHECK_BINARY_EXIST("libs/android/x86" "*.so" HAVE_ANDROID_X86 ${IS_ANDROID_X86_BUILD})
SET(IS_ANDROID_X86_64_BUILD OFF)
IF(ANDROID AND ("${ANDROID_ABI}" STREQUAL "x86_64"))
SET(IS_ANDROID_X86_64_BUILD ON)
MESSAGE(STATUS "IS_ANDROID_X86_64_BUILD: ${IS_ANDROID_X86_64_BUILD}")
ENDIF()
CHECK_BINARY_EXIST("libs/android/x86_64" "*.so" HAVE_ANDROID_X86_64 ${IS_ANDROID_X86_64_BUILD})
SET(HAVE_ANDROID OFF)
IF(HAVE_ANDROID_ARM64_V8A OR HAVE_ANDROID_ARMEABI_V7A OR HAVE_ANDROID_X86 OR HAVE_ANDROID_X86_64)
SET(HAVE_ANDROID ON)
MESSAGE(STATUS "HAVE_ANDROID: ${HAVE_ANDROID}")
ENDIF()
SET(HAVE_ANDROID_ALL_ARCH OFF)
IF(HAVE_ANDROID_ARM64_V8A AND HAVE_ANDROID_ARMEABI_V7A AND HAVE_ANDROID_X86 AND HAVE_ANDROID_X86_64)
SET(HAVE_ANDROID_ALL_ARCH ON)
MESSAGE(STATUS "HAVE_ANDROID_ALL_ARCH: ${HAVE_ANDROID_ALL_ARCH}")
ENDIF()
SET(IS_WINSTORE_10_X86_BUILD OFF)
IF( ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore") AND (CMAKE_SYSTEM_VERSION MATCHES 10.0) AND ("${EMGUCV_ARCH}" STREQUAL "win32") )
SET(IS_WINSTORE_10_X86_BUILD ON)
MESSAGE(STATUS "IS_WINSTORE_10_X86_BUILD: ${IS_WINSTORE_10_X86_BUILD}")
ENDIF()
CHECK_BINARY_EXIST("libs/runtimes/win10-x86/native" "*.dll" HAVE_WINSTORE_10_X86 ${IS_WINSTORE_10_X86_BUILD})
SET(IS_WINSTORE_10_X64_BUILD OFF)
IF( ("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore") AND (CMAKE_SYSTEM_VERSION MATCHES 10.0) AND ("${EMGUCV_ARCH}" STREQUAL "win64") )
SET(IS_WINSTORE_10_X64_BUILD ON)
MESSAGE(STATUS "IS_WINSTORE_10_X64_BUILD: ${IS_WINSTORE_10_X64_BUILD}")
ENDIF()
CHECK_BINARY_EXIST("libs/runtimes/win10-x64/native" "*.dll" HAVE_WINSTORE_10_X64 ${IS_WINSTORE_10_X64_BUILD})
SET(IS_WINSTORE_10_ARM_BUILD OFF)
IF(("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore") AND (CMAKE_SYSTEM_VERSION MATCHES 10.0) AND ("${EMGUCV_ARCH}" STREQUAL "arm"))
SET(IS_WINSTORE_10_ARM_BUILD ON)
MESSAGE(STATUS "IS_WINSTORE_10_ARM_BUILD: ${IS_WINSTORE_10_ARM_BUILD}")
ENDIF()
CHECK_BINARY_EXIST("libs/runtimes/win10-arm/native" "*.dll" HAVE_WINSTORE_10_ARM ${IS_WINSTORE_10_ARM_BUILD})
SET(IS_WINSTORE_10_ARM64_BUILD OFF)
IF(("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore") AND (CMAKE_SYSTEM_VERSION MATCHES 10.0) AND ("${EMGUCV_ARCH}" STREQUAL "arm64"))
SET(IS_WINSTORE_10_ARM64_BUILD ON)
MESSAGE(STATUS "IS_WINSTORE_10_ARM64_BUILD: ${IS_WINSTORE_10_ARM64_BUILD}")
ENDIF()
CHECK_BINARY_EXIST("libs/runtimes/win10-arm64/native" "*.dll" HAVE_WINSTORE_10_ARM64 ${IS_WINSTORE_10_ARM64_BUILD})
SET(IS_WINDESKTOP_X86_BUILD OFF)
IF (WIN32 AND ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") AND ("${EMGUCV_ARCH}" STREQUAL "win32") AND (NOT ANDROID))
SET (IS_WINDESKTOP_X86_BUILD ON)
MESSAGE(STATUS "IS_WINDESKTOP_X86_BUILD: ${IS_WINDESKTOP_X86_BUILD}")
ENDIF()
CHECK_BINARY_EXIST("libs/runtimes/win-x86/native" "*.dll" HAVE_WINDESKTOP_X86 ${IS_WINDESKTOP_X86_BUILD})
SET (IS_WINDESKTOP_X64_BUILD OFF)
IF (WIN32 AND ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") AND ("${EMGUCV_ARCH}" STREQUAL "win64") AND (NOT ANDROID))
SET (IS_WINDESKTOP_X64_BUILD ON)
MESSAGE(STATUS "IS_WINDESKTOP_X64_BUILD: ${IS_WINDESKTOP_X64_BUILD}")
ENDIF()
CHECK_BINARY_EXIST("libs/runtimes/win-x64/native" "*.dll" HAVE_WINDESKTOP_X64 ${IS_WINDESKTOP_X64_BUILD})
SET (IS_WINDESKTOP_ARM64_BUILD OFF)
IF (WIN32 AND ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") AND ("${EMGUCV_ARCH}" STREQUAL "arm64") AND (NOT ANDROID))
SET (IS_WINDESKTOP_ARM64_BUILD ON)
MESSAGE(STATUS "IS_WINDESKTOP_ARM64_BUILD: ${IS_WINDESKTOP_ARM64_BUILD}")
ENDIF()
CHECK_BINARY_EXIST("libs/runtimes/win-arm64/native" "*.dll" HAVE_WINDESKTOP_ARM64 ${IS_WINDESKTOP_ARM64_BUILD})
SET(HAVE_WINDESKTOP OFF)
IF (HAVE_WINDESKTOP_X86 OR HAVE_WINDESKTOP_X64 OR HAVE_WINDESKTOP_ARM64)
SET(HAVE_WINDESKTOP ON)
ENDIF()
SET(IS_DEBIAN_ARM_BUILD OFF)
SET(IS_DEBIAN_ARM64_BUILD OFF)
IF (IS_DEBIAN)
IF(IS_ARM)
SET (IS_DEBIAN_ARM_BUILD ON)
MESSAGE(STATUS "IS_DEBIAN_ARM_BUILD: ${IS_DEBIAN_ARM_BUILD}")
ELSE(IS_ARM64)
SET (IS_DEBIAN_ARM64_BUILD ON)
MESSAGE(STATUS "IS_DEBIAN_ARM64_BUILD: ${IS_DEBIAN_ARM64_BUILD}")
ENDIF()
ENDIF()
SET (IS_DEBIAN_BUILD OFF)
IF(IS_DEBIAN_ARM_BUILD OR IS_DEBIAN_ARM64_BUILD)
SET (IS_DEBIAN_BUILD ON)
ENDIF()
CHECK_BINARY_EXIST("libs/runtimes/linux-arm/native" "*.so" HAVE_LINUX_ARM ${IS_DEBIAN_ARM_BUILD})
CHECK_BINARY_EXIST("libs/runtimes/linux-arm64/native" "*.so" HAVE_LINUX_ARM64 ${IS_DEBIAN_ARM64_BUILD})
IF(IS_DEBIAN_ARM_BUILD)
SET(NUGET_NATIVE_PLATFORM_ID_DEBIAN "linux-${NUGET_NATIVE_PLATFORM_ID_ARCH}")
MESSAGE(STATUS "NUGET_NATIVE_PLATFORM_ID_DEBIAN: ${NUGET_NATIVE_PLATFORM_ID_DEBIAN}")
ELSE()
SET(NUGET_NATIVE_PLATFORM_ID_DEBIAN "linux-arm")
ENDIF()
STRING(TOLOWER "${NUGET_NATIVE_PLATFORM_ID_DEBIAN}" NUGET_NATIVE_PLATFORM_ID_DEBIAN)
SET(IS_UBUNTU_X86_BUILD OFF)
IF (("${TARGET_ARCH_NAME}" STREQUAL "ubuntu_x86"))
SET(IS_UBUNTU_X86_BUILD ON)
MESSAGE(STATUS "IS_UBUNTU_X86_BUILD: ${IS_UBUNTU_X86_BUILD}")
ENDIF()
CHECK_BINARY_EXIST("libs/runtimes/ubuntu-x86/native" "*.so" HAVE_UBUNTU_X86 ${IS_UBUNTU_X86_BUILD})
SET(IS_UBUNTU_X64_BUILD OFF)
IF (("${TARGET_ARCH_NAME}" STREQUAL "ubuntu_x64"))
SET(IS_UBUNTU_X64_BUILD ON)
MESSAGE(STATUS "IS_UBUNTU_X64_BUILD: ${IS_UBUNTU_X64_BUILD}")
ENDIF()
CHECK_BINARY_EXIST("libs/runtimes/ubuntu-x64/native" "*.so" HAVE_UBUNTU_X64 ${IS_UBUNTU_X64_BUILD})
SET(IS_RHEL_X64_BUILD OFF)
IF (("${TARGET_ARCH_NAME}" STREQUAL "rhel_x64"))
SET(IS_RHEL_X64_BUILD ON)
MESSAGE(STATUS "IS_RHEL_X64_BUILD: ${IS_RHEL_X64_BUILD}")
ENDIF()
CHECK_BINARY_EXIST("libs/runtimes/rhel-x64/native" "*.so" HAVE_RHEL_X64 ${IS_RHEL_X64_BUILD})
#SET(IS_UBUNTU_ARM64_BUILD OFF)
#IF (("${TARGET_ARCH_NAME}" STREQUAL "ubuntu_arm64"))
# SET(IS_UBUNTU_ARM64_BUILD ON)
# MESSAGE(STATUS "IS_UBUNTU_ARM64_BUILD: ${IS_UBUNTU_ARM64_BUILD}")
#ENDIF()
#CHECK_BINARY_EXIST("libs/arm64" "*.so" HAVE_LINUX_ARM64 ${IS_UBUNTU_ARM64_BUILD})
IF ( IS_UBUNTU )
#MESSAGE(STATUS "TARGET_ARCH_64: ${TARGET_ARCH_64}")
#SET(NUGET_NATIVE_PLATFORM_ID_UBUNTU "${LSB_RELEASE_ID_SHORT}.${LSB_RELEASE_RELEASE_SHORT}-${NUGET_NATIVE_PLATFORM_ID_ARCH}")
IF (NOT ("" STREQUAL "${LSB_RELEASE_ID_SHORT}"))
SET(NUGET_NATIVE_PLATFORM_ID_UBUNTU "${LSB_RELEASE_ID_SHORT}-${NUGET_NATIVE_PLATFORM_ID_ARCH}")
ELSEIF (NOT ("" STREQUAL "${DISTRO_ID}"))
SET(NUGET_NATIVE_PLATFORM_ID_UBUNTU "${DISTRO_ID}-${NUGET_NATIVE_PLATFORM_ID_ARCH}")
ENDIF()
MESSAGE(STATUS "NUGET_NATIVE_PLATFORM_ID_UBUNTU: ${NUGET_NATIVE_PLATFORM_ID_UBUNTU}")
ELSE()
SET(UBUNTU_DEFAULT_PLATFORM_ID "ubuntu")
IF (HAVE_UBUNTU_X86)
SET(NUGET_NATIVE_PLATFORM_ID_UBUNTU "${UBUNTU_DEFAULT_PLATFORM_ID}-x86")
ENDIF()
IF (HAVE_UBUNTU_X64)
SET(NUGET_NATIVE_PLATFORM_ID_UBUNTU "${UBUNTU_DEFAULT_PLATFORM_ID}-x64")
ENDIF()
IF (HAVE_UBUNTU_ARM64)
SET(NUGET_NATIVE_PLATFORM_ID_UBUNTU "${UBUNTU_DEFAULT_PLATFORM_ID}-arm64")
ENDIF()
ENDIF()
STRING(TOLOWER "${NUGET_NATIVE_PLATFORM_ID_UBUNTU}" NUGET_NATIVE_PLATFORM_ID_UBUNTU)
IF (IS_RHEL)
SET(NUGET_NATIVE_PLATFORM_ID_RHEL "${DISTRO_ID}-${NUGET_NATIVE_PLATFORM_ID_ARCH}")
MESSAGE(STATUS "NUGET_NATIVE_PLATFORM_ID_RHEL: ${NUGET_NATIVE_PLATFORM_ID_RHEL}")
ELSE()
SET(RHEL_DEFAULT_PLATFORM_ID "rhel")
IF (HAVE_RHEL_X86)
SET(NUGET_NATIVE_PLATFORM_ID_RHEL "${RHEL_DEFAULT_PLATFORM_ID}-x86")
ENDIF()
IF (HAVE_RHEL_X64)
SET(NUGET_NATIVE_PLATFORM_ID_RHEL "${RHEL_DEFAULT_PLATFORM_ID}-x64")
ENDIF()
IF (HAVE_RHEL_ARM64)
SET(NUGET_NATIVE_PLATFORM_ID_RHEL "${RHEL_DEFAULT_PLATFORM_ID}-arm64")
ENDIF()
ENDIF()
STRING(TOLOWER "${NUGET_NATIVE_PLATFORM_ID_RHEL}" NUGET_NATIVE_PLATFORM_ID_RHEL)
SET(HAVE_MAUI OFF)
IF(HAVE_IOS AND HAVE_MAC_CATALYST AND HAVE_ANDROID AND HAVE_WINDESKTOP)
SET (HAVE_MAUI ON)
MESSAGE(STATUS "HAVE_MAUI: ${HAVE_MAUI}")
ENDIF()
#IF (HAVE_MAUI)
SET(EMGUCV_MAUI_DOTNET_VERSION "net7.0")
SET(EMGUCV_MAUI_ANDROID_SRC_FOLDER "${EMGUCV_MAUI_DOTNET_VERSION}-android")
SET(EMGUCV_MAUI_IOS_SRC_FOLDER "${EMGUCV_MAUI_DOTNET_VERSION}-ios")
SET(EMGUCV_MAUI_MACOS_SRC_FOLDER "${EMGUCV_MAUI_DOTNET_VERSION}-maccatalyst")
SET(EMGUCV_MAUI_WINDOWS_SRC_FOLDER "${EMGUCV_MAUI_DOTNET_VERSION}-windows10.0.19041.0")
SET(EMGUCV_MAUI_ANDROID_DST_FOLDER "${EMGUCV_MAUI_DOTNET_VERSION}-android33.0")
SET(EMGUCV_MAUI_IOS_DST_FOLDER "${EMGUCV_MAUI_DOTNET_VERSION}-ios16.1")
SET(EMGUCV_MAUI_MACOS_DST_FOLDER "${EMGUCV_MAUI_DOTNET_VERSION}-maccatalyst16.1")
SET(EMGUCV_MAUI_WINDOWS_DST_FOLDER "${EMGUCV_MAUI_DOTNET_VERSION}-windows10.0.19041.0")
#ENDIF()
SET(WINDESKTOP_LABEL "")
IF(HAVE_WINDESKTOP_X86)
SET(WINDESKTOP_LABEL "${WINDESKTOP_LABEL}_x86")
ENDIF()
IF(HAVE_WINDESKTOP_X64)
SET(WINDESKTOP_LABEL "${WINDESKTOP_LABEL}_x64")
ENDIF()
IF(HAVE_WINDESKTOP_ARM64)
SET(WINDESKTOP_LABEL "${WINDESKTOP_LABEL}_arm64")
ENDIF()
IF("${WINDESKTOP_LABEL}" STREQUAL "_x86_x64_arm64")
SET(WINDESKTOP_LABEL "-windesktop")
ELSEIF(NOT ("${WINDESKTOP_LABEL}" STREQUAL ""))
SET(WINDESKTOP_LABEL "-windesktop${WINDESKTOP_LABEL}")
ENDIF()
SET(WINSTORE_10_LABEL "")
IF(HAVE_WINSTORE_10_X86)
SET(WINSTORE_10_LABEL "${WINSTORE_10_LABEL}_x86")
ENDIF()
IF(HAVE_WINSTORE_10_X64)
SET(WINSTORE_10_LABEL "${WINSTORE_10_LABEL}_x64")
ENDIF()
IF(HAVE_WINSTORE_10_ARM)
SET(WINSTORE_10_LABEL "${WINSTORE_10_LABEL}_arm")
ENDIF()
IF(HAVE_WINSTORE_10_ARM64)
SET(WINSTORE_10_LABEL "${WINSTORE_10_LABEL}_arm64")
ENDIF()
SET(HAVE_WINSTORE_10 OFF)
IF(HAVE_WINSTORE_10_X86 OR HAVE_WINSTORE_10_X64 OR HAVE_WINSTORE_10_ARM OR HAVE_WINSTORE_10_ARM64)
SET(HAVE_WINSTORE_10 ON)
ENDIF()
IF("${WINSTORE_10_LABEL}" STREQUAL "_x86_x64_arm_arm64")
SET(WINSTORE_10_LABEL "-UWP")
ELSEIF(NOT ("${WINSTORE_10_LABEL}" STREQUAL ""))
SET(WINSTORE_10_LABEL "-UWP${WINSTORE_10_LABEL}")
ENDIF()
SET(WINDOWS_LABEL "${WINSTORE_10_LABEL}${WINDESKTOP_LABEL}")
IF ("${WINDOWS_LABEL}" STREQUAL "-UWP-windesktop")
SET(WINDOWS_LABEL "-windows")
ENDIF()
SET(IOS_LABEL "")
IF(HAVE_IOS)
SET(IOS_LABEL "-ios")
ENDIF()
SET(MACOS_LABEL "")
IF(HAVE_MACOS)
SET(MACOS_LABEL "-macos")
ENDIF()
IF (IS_DEBIAN_ARM_BUILD OR IS_DEBIAN_ARM64_BUILD OR IS_UBUNTU_X64_BUILD OR IS_UBUNTU_X86_BUILD OR IS_UBUNTU_ARM64_BUILD OR HAVE_LINUX_ARM OR HAVE_LINUX_ARM64 OR HAVE_LINUX_X64 OR HAVE_LINUX_X86 OR IS_RHEL_X64_BUILD OR HAVE_RHEL_X64)
SET(HAVE_LINUX ON)
ELSE()
SET(HAVE_LINUX OFF)
ENDIF()
SET(ANDROID_LABEL "")
IF(HAVE_ANDROID_ARM64_V8A)
SET(ANDROID_LABEL "${ANDROID_LABEL}-arm64-v8a")
ENDIF()
#IF(HAVE_ANDROID_ARMEABI)
# SET(ANDROID_LABEL "${ANDROID_LABEL}-armeabi")
#ENDIF()
IF(HAVE_ANDROID_ARMEABI_V7A)
SET(ANDROID_LABEL "${ANDROID_LABEL}-armeabi-v7a")
ENDIF()
IF(HAVE_ANDROID_X86)
SET(ANDROID_LABEL "${ANDROID_LABEL}-x86")
ENDIF()
IF(HAVE_ANDROID_X86_64)
SET(ANDROID_LABEL "${ANDROID_LABEL}-x86_64")
ENDIF()
#IF("${ANDROID_LABEL}" STREQUAL "-arm64-v8a-armeabi-armeabi-v7a-x86-x86_64")
IF("${ANDROID_LABEL}" STREQUAL "-arm64-v8a-armeabi-v7a-x86-x86_64")
SET(ANDROID_LABEL "-android")
ELSEIF(NOT ("${ANDROID_LABEL}" STREQUAL ""))
SET(ANDROID_LABEL "-android${ANDROID_LABEL}")
ENDIF()
#CHECK_BINARY_EXIST("libs" "Emgu.CV.World*" HAVE_PREBUILD_EMGU_CV_WORLD OFF)
CHECK_BINARY_EXIST("libs" "Emgu.CV.Platform.IOS.*" HAVE_PREBUILD_EMGU_CV_IOS OFF)
#IF(HAVE_PREBUILD_EMGU_CV_IOS)
# INSTALL(
# FILES
# "${CMAKE_SOURCE_DIR}/libs/Emgu.CV.Platform.IOS.dll"
# "${CMAKE_SOURCE_DIR}/libs/Emgu.CV.Platform.IOS.xml"
# DESTINATION "libs/"
# COMPONENT emgucv_binary
# )
#ENDIF()
IF (HAVE_IOS AND (NOT HAVE_MACOS) AND (NOT HAVE_ANDROID) AND (NOT HAVE_WINSTORE_10) AND (NOT (HAVE_WINDESKTOP_X86 OR HAVE_WINDESKTOP_X64 OR HAVE_WINDESKTOP_ARM64)) AND (NOT HAVE_LINUX))
SET(HAVE_IOS_ONLY ON)
ELSE()
SET(HAVE_IOS_ONLY OFF)
ENDIF()
# ----------------------------------------------------------------------------
# Setup Package information
# ----------------------------------------------------------------------------
SET(PACKAGE "${PROJECT_NAME}")
SET(CPACK_PACKAGE_CONTACT "Emgu CV SUPPORT <support@emgu.com>")
SET(PACKAGE_BUGREPORT "${CPACK_PACKAGE_CONTACT}")
SET(PACKAGE_NAME "${PROJECT_NAME}")
#SET(CPACK_PACKAGE_NAME "${PACKAGE_NAME}")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Emgu CV is a cross platform .Net wrapper to the OpenCV image processing library.")
SET(CPACK_PACKAGE_NAME "${PACKAGE_NAME}${IOS_LABEL}${ANDROID_LABEL}${MACOS_LABEL}${WINDOWS_LABEL}")
#STRING(LENGTH "${CPACK_PACKAGE_NAME}" PACKAGE_NAME_LENGTH)
#IF (${PACKAGE_NAME_LENGTH} GREATER 30)
# SET(CPACK_PACKAGE_NAME "${PACKAGE_NAME}-mixed")
# STRING(LENGTH "${CPACK_PACKAGE_NAME}" PACKAGE_NAME_LENGTH)
#ENDIF()
#IF (APPLE)
# SET(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-macos")
#ENDIF()
IF(WITH_CUDA)
SET(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-cuda")
ENDIF()
IF(WITH_OPENNI)
SET(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-openni")
ENDIF()
IF(CV_ICC)
SET(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-icc")
ENDIF()
#IF(WITH_TBB)
# SET(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-tbb")
#ENDIF()
IF(WITH_IPP)
SET(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-ipp")
ENDIF()
IF(WITH_INF_ENGINE OR WITH_OPENVINO)
SET(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-dldt")
ENDIF()
SET(IS_PRO_BUILD FALSE)
IF("${CPACK_PACKAGE_NAME}" STREQUAL "${PACKAGE_NAME}-ios-android-macos-windows-ipp-dldt")
SET(CPACK_PACKAGE_NAME "${PACKAGE_NAME}-pro")
SET(IS_PRO_BUILD TRUE)
ENDIF()
#IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/Emgu.CV.Commercial.License.txt")
# SET(LICENSE_FILE_NAME "Emgu.CV.Commercial.License.txt")
#ELSE()
SET(LICENSE_FILE_NAME "LICENSE")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/${LICENSE_FILE_NAME}")
#IF (WIN32 OR APPLE OR ANDROID)
SET(CPACK_PACKAGE_CLI_FOLDER libs)
#ELSE ()
# SET(CPACK_PACKAGE_CLI_FOLDER lib/cli/${PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR})
#ENDIF()
# ----------------------------------------------------------------------------
# Build opencv and Emgu.CV.Extern
# ----------------------------------------------------------------------------
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${UNMANAGED_LIBRARY_OUTPUT_PATH}" )
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
#SET(CMAKE_ARCHIEVE_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
#SET(CMAKE_ARCHIEVE_OUTPUT_DIRECTORY_DEBUG "${CMAKE_ARCHIEVE_OUTPUT_DIRECTORY}")
#SET(CMAKE_ARCHIEVE_OUTPUT_DIRECTORY_RELEASE "${CMAKE_ARCHIEVE_OUTPUT_DIRECTORY}")
#SET(CMAKE_INSTALL_PREFIX_COPY ${CMAKE_INSTALL_PREFIX})
#SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}${UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER})
#SET(CPACK_PACKAGING_INSTALL_PREFIX ${UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER})
#SET(DESTDIR ${UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER})
#SET(CPACK_OUTPUT_FILE_PREFIX "x64")
SET(ENTRYPOINT_CS_STRING "")
SET(ENTRYPOINT_MODULES_STRING "")
#Add opencl
#IF(WIN32 AND (NOT NETFX_CORE) )
# IF(WITH_OPENCL)
# MESSAGE(STATUS "Open CL build included")
# SET(OPENCL_SOURCE_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/lib/opencl-icd-1.2.11.0/icd")
# ADD_SUBDIRECTORY(${OPENCL_SOURCE_FOLDER})
# #GET_TARGET_PROPERTY(OPENCL_OUTPUT_NAME OpenCL OUTPUT_NAME)
# set(OPENCL_FOUND YES)
# set(OPENCL_LIBRARY "${CMAKE_CURRENT_SOURCE_DIR}/bin/Release/opencl.lib" CACHE STRING "OpenCL library")
# set(OPENCL_INCLUDE_DIR "${OPENCL_SOURCE_FOLDER}/inc" CACHE STRING "OpenCL include directory")
# mark_as_advanced(OPENCL_INCLUDE_DIR OPENCL_LIBRARY)
# SET(ENTRYPOINT_MODULES_STRING "${ENTRYPOINT_MODULES_STRING}
# OpenclLibrary,")
# SET(ENTRYPOINT_CS_STRING "${ENTRYPOINT_CS_STRING}
# /// <summary>
# /// The file name of the OpenCL library
# /// </summary>
# public const string OpenclLibrary = \"OpenCL\";")
# ELSE()
# SET(OPENCL_OUTPUT_NAME "")
# MESSAGE(STATUS "Open CL build not included")
# ENDIF()
#ENDIF()
SET(CMAKE_OLD_SOURCE_DIR ${CMAKE_SOURCE_DIR})
SET(CMAKE_SOURCE_DIR ${OPENCV_SUBFOLDER})
IF(MSVC)
set(ENABLE_SOLUTION_FOLDERS ON CACHE BOOL "Solution folder in Visual Studio")
ENDIF()
ADD_SUBDIRECTORY(${OPENCV_SUBFOLDER})
SET(CMAKE_SOURCE_DIR ${CMAKE_OLD_SOURCE_DIR})
SET (OPENCV_MODULE_NAME_CANDIDATES
core imgproc video flann ml imgcodecs videoio highgui objdetect features2d calib3d
cudaarithm cudawarping cudafilters cudaimgproc cudalegacy cudaoptflow
cudastereo cudabgsegm cudafeatures2d cudacodec cudaobjdetect
photo superres
videostab shape
cudev
face ximgproc xobjdetect xfeatures2d xphoto bgsegm optflow
stitching plot
dnn dnn_objdetect dnn_superres aruco fuzzy viz bioinspired text tracking
dpm
saliency
img_hash
phase_unwrapping
freetype
hfs
quality
stereo
surface_matching
alphamat
intensity_transform
rapid
line_descriptor
mcc
hdf
gapi
wechat_qrcode
structured_light
rgbd
reg
)
IF(BUILD_opencv_world)
LIST (APPEND OPENCV_MODULE_NAME_CANDIDATES world)
ENDIF()
FOREACH(OPENCV_MODULE_NAME ${OPENCV_MODULE_NAME_CANDIDATES})
IF(TARGET opencv_${OPENCV_MODULE_NAME})
LIST(APPEND OPENCV_MODULE_NAMES ${OPENCV_MODULE_NAME})
ENDIF()
ENDFOREACH()
# ----------------------------------------------------------------------------
# Autodetect if we are in a GIT repository
# ----------------------------------------------------------------------------
IF(GIT_EXECUTABLE)
MESSAGE(STATUS "Extracting Emgu CV git version, please wait...")
EXECUTE_PROCESS(
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND ${GIT_EXECUTABLE} rev-list HEAD --count
OUTPUT_VARIABLE GITVERSION_RESULT)
STRING(REGEX REPLACE "^([0123456789]+).*" "\\1" EMGUCV_GITVERSION "${GITVERSION_RESULT}")
STRING(STRIP "${EMGUCV_GITVERSION}" EMGUCV_GITVERSION)
IF(EMGUCV_GITVERSION MATCHES "^$" OR EMGUCV_GITVERSION MATCHES "^-")
# This is NOT a git repository:
SET(EMGUCV_GITVERSION "0")
ENDIF()
MESSAGE(STATUS "Emgu CV GIT VERSION: ${EMGUCV_GITVERSION}")
ELSE()
# We don't have git:
SET(EMGUCV_GITVERSION "0")
ENDIF()
SET(CPACK_PACKAGE_VENDOR "Emgu Corporation")
SET(CPACK_PACKAGE_VERSION_MAJOR ${OPENCV_VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${OPENCV_VERSION_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${OPENCV_VERSION_PATCH})
SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}.${EMGUCV_GITVERSION}")
IF(ANDROID)
SET(CPACK_PACKAGE_FILE_NAME "lib${CPACK_PACKAGE_NAME}")
ELSE()
SET(CPACK_PACKAGE_FILE_NAME "lib${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
ENDIF()
MESSAGE(STATUS "Package name will be ${CPACK_PACKAGE_NAME}")
FILE(WRITE "emgucv.version.txt" "${CPACK_PACKAGE_VERSION}")
MATH(EXPR CPACK_PACKAGE_VERSION_PATCH_PLUS_ONE "${CPACK_PACKAGE_VERSION_PATCH}+1")
#SET(CPACK_PACKAGE_DEPENDENCY_VERSION "[${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}.0,${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH_PLUS_ONE}.0)")
#SET(CPACK_PACKAGE_DEPENDENCY_VERSION "(${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}.0, ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH_PLUS_ONE}.0)")
SET(CPACK_PACKAGE_DEPENDENCY_VERSION "${CPACK_PACKAGE_VERSION}")
#IF(NETFX_CORE)
# SET(EMGU_CV_WITH_TESSERACT OFF CACHE BOOL "BUILD TESSERACT OCR")
#ELSE()
SET(EMGU_CV_WITH_TESSERACT ON CACHE BOOL "BUILD TESSERACT OCR")
#ENDIF()
IF(MSVC AND WIN32 AND EMGUCV_WITH_TESSERACT)
SET(TESSERACT_OPENCL OFF CACHE BOOL "ENABLE OpenCL for TESSERACT")
ELSE()
SET(TESSERACT_OPENCL OFF CACHE BOOL "ENABLE OpenCL for TESSERACT")
ENDIF()
IF(TESSERACT_OPENCL)
ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/3rdParty/opencl-icd-1.2.11.0/icd)
ENDIF()
IF (TARGET_ARCH_64)
SET(EMGU_ENABLE_SSE OFF CACHE BOOL "ENABLE SSE for Emgu CV")
ELSE()
SET(EMGU_ENABLE_SSE ON CACHE BOOL "ENABLE SSE for Emgu CV")
ENDIF()
ADD_SUBDIRECTORY(Emgu.CV.Extern)
ADD_SUBDIRECTORY(Emgu.CV.NativeImage)
IF(NOT (ANDROID OR IOS OR NETFX_CORE OR APPLE))
ENABLE_TESTING()
ADD_SUBDIRECTORY(tests/cvextern_test)
ENDIF()
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${LIBRARY_OUTPUT_PATH}" )
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
#SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX_COPY})
#SET(CPACK_PACKAGING_INSTALL_PREFIX "")
#SET(DESTDIR "")
#SET(CPACK_OUTPUT_FILE_PREFIX "")
SET(EMGU_CV_BUILD ON CACHE BOOL "BUILD Emgu CV")
SET(EMGU_CV_EXAMPLE_BUILD ON CACHE BOOL "Build Emgu CV Example")
# ----------------------------------------------------------------------------
# Generate required common assembly file for Emgu CV project
# ----------------------------------------------------------------------------
INCLUDE(Today)
TODAY() #set the variable CURRENT_YEAR
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/CommonAssemblyInfo.cs.in ${CMAKE_CURRENT_SOURCE_DIR}/CommonAssemblyInfo.cs)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Directory.Build.props.in ${CMAKE_CURRENT_SOURCE_DIR}/Directory.Build.props)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.rc.in ${CMAKE_CURRENT_SOURCE_DIR}/Emgu.CV.Extern/version.rc)
SET (EMGUCV_LICENSE_FILE "${LICENSE_FILE_NAME}.txt")
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${LICENSE_FILE_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/${EMGUCV_LICENSE_FILE} COPYONLY)
MACRO(CHECK_LICENSE_TYPE)
MESSAGE(STATUS "LICENSE FILE: ${CMAKE_CURRENT_SOURCE_DIR}/${LICENSE_FILE_NAME}")
IF (WIN32)
EXECUTE_PROCESS(COMMAND "findstr" "gpl" "${LICENSE_FILE_NAME}" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE TMP)
ELSE()
EXECUTE_PROCESS(COMMAND "grep" "gpl" "${LICENSE_FILE_NAME}" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE TMP)
ENDIF()
STRING(STRIP "${TMP}" TMP)
STRING(LENGTH "${TMP}" GPL_LICENSE_LENGTH)
SET (LICENSE_TYPE "Dual License")
IF(${GPL_LICENSE_LENGTH} EQUAL 0)
SET(LICENSE_TYPE "Commercial")
ENDIF()
MESSAGE(STATUS "LICENSE_TYPE: ${LICENSE_TYPE}")
ENDMACRO()
CHECK_LICENSE_TYPE()
# ----------------------------------------------------------------------------
# Generate neget packaging file for Emgu CV project
# ----------------------------------------------------------------------------
IF( "${OPENCV_EXTRA_MODULES_PATH}" STREQUAL "" )
SET(EMGUCV_RUNTIME_EXTRA_TAG ".mini")
SET(EMGUCV_MINI_RELEASE_NOTE "This is the mini release that only contains the minimum amount of Open CV modules. For full release that contains all Open CV modules, use a release that is not labeled 'mini'.")
ELSE()
SET(EMGUCV_RUNTIME_EXTRA_TAG "")
SET(EMGUCV_MINI_RELEASE_NOTE "")
ENDIF()
SET(EMGUCV_NUGET_ID "Emgu.CV")
SET(EMGUCV_BITMAP_NUGET_ID "Emgu.CV.Bitmap")
SET(EMGUCV_WPF_NUGET_ID "Emgu.CV.Wpf")
SET(EMGUCV_MODELS_NUGET_ID "Emgu.CV.Models")
SET(EMGUCV_UI_NUGET_ID "Emgu.CV.UI")
SET(EMGUCV_WINDOWS_NUGET_ID "${EMGUCV_NUGET_ID}.runtime${EMGUCV_RUNTIME_EXTRA_TAG}.windows")
SET(EMGU_WINDOWS_MSVCRT_X86_NUGET_ID "Emgu.runtime.windows.msvc.rt.x86")
SET(EMGU_WINDOWS_MSVCRT_X64_NUGET_ID "Emgu.runtime.windows.msvc.rt.x64")
SET(EMGU_WINDOWS_MSVCRT_ARM64_NUGET_ID "Emgu.runtime.windows.msvc.rt.arm64")
SET(EMGU_ZLIBWAPI_ID "Emgu.runtime.windows.zlibwapi.x64")
SET(EMGU_ZLIBWAPI_VERSION "1.2.3")
SET(NUGET_EMGU_URL "https://www.emgu.com")
IF(WITH_CUDA)
SET(EMGUCV_WINDOWS_NUGET_ID "${EMGUCV_WINDOWS_NUGET_ID}.cuda")
SET(EMGU_WINDOWS_CUDA_NUGET_ID "Emgu.runtime.windows.cuda")
SET(EMGU_CUDART_NUGET_ID "${EMGU_WINDOWS_CUDA_NUGET_ID}.rt")
SET(EMGU_CUDA_BLAS_NUGET_ID "${EMGU_WINDOWS_CUDA_NUGET_ID}.blas")
SET(EMGU_CUDA_BLAS_LT_NUGET_ID "${EMGU_CUDA_BLAS_NUGET_ID}.lt")
SET(EMGU_NPP_NUGET_ID "${EMGU_WINDOWS_CUDA_NUGET_ID}.npp")
SET(EMGU_CUFFT_NUGET_ID "${EMGU_WINDOWS_CUDA_NUGET_ID}.fft")
SET(EMGU_CUDNN_NUGET_ID "${EMGU_WINDOWS_CUDA_NUGET_ID}.dnn")
SET(EMGU_CUDNN_ADV_NUGET_ID "${EMGU_CUDNN_NUGET_ID}.adv")
SET(EMGU_CUDNN_CNN_INFER_NUGET_ID "${EMGU_CUDNN_NUGET_ID}.cnn.infer")
SET(EMGU_CUDNN_CNN_TRAIN_NUGET_ID "${EMGU_CUDNN_NUGET_ID}.cnn.train")
SET(EMGU_CUDNN_OPS_NUGET_ID "${EMGU_CUDNN_NUGET_ID}.ops")
#ELSE()
# SET(EMGUCV_NUGET_ID "${EMGUCV_NUGET_ID_BASE}")
ENDIF()
IF(HAVE_MACOS)
SET(EMGUCV_XAMARIN_MACOS_NUGET_ID "${EMGUCV_NUGET_ID}.runtime.xamarin${EMGUCV_RUNTIME_EXTRA_TAG}.macos")
SET(EMGUCV_MACOS_NUGET_ID "${EMGUCV_NUGET_ID}.runtime${EMGUCV_RUNTIME_EXTRA_TAG}.macos")
ENDIF()
IF(HAVE_ANDROID)
SET(EMGUCV_XAMARIN_ANDROID_NUGET_ID "${EMGUCV_NUGET_ID}.runtime.xamarin${EMGUCV_RUNTIME_EXTRA_TAG}.android")
SET(EMGUCV_MAUI_ANDROID_NUGET_ID "${EMGUCV_NUGET_ID}.runtime.maui${EMGUCV_RUNTIME_EXTRA_TAG}.android")
ENDIF()
IF(HAVE_IOS)
SET(EMGUCV_XAMARIN_IOS_NUGET_ID "${EMGUCV_NUGET_ID}.runtime.xamarin${EMGUCV_RUNTIME_EXTRA_TAG}.ios")
SET(EMGUCV_MAUI_IOS_NUGET_ID "${EMGUCV_NUGET_ID}.runtime.maui${EMGUCV_RUNTIME_EXTRA_TAG}.ios")
ENDIF()
IF(HAVE_MAC_CATALYST)
SET(EMGUCV_MAUI_MACOS_NUGET_ID "${EMGUCV_NUGET_ID}.runtime.maui${EMGUCV_RUNTIME_EXTRA_TAG}.macos")
ENDIF()
IF(HAVE_WINSTORE_10 AND WIN32)
SET(EMGUCV_UWP_NUGET_ID "${EMGUCV_NUGET_ID}.runtime${EMGUCV_RUNTIME_EXTRA_TAG}.uwp")
ENDIF()
IF(HAVE_LINUX_ARM)
SET(EMGUCV_DEBIAN_ARM_NUGET_ID "${EMGUCV_NUGET_ID}.runtime${EMGUCV_RUNTIME_EXTRA_TAG}.debian-arm")
ENDIF()
IF(HAVE_LINUX_ARM64)
SET(EMGUCV_DEBIAN_ARM64_NUGET_ID "${EMGUCV_NUGET_ID}.runtime${EMGUCV_RUNTIME_EXTRA_TAG}.debian-arm64")
ENDIF()
IF(HAVE_UBUNTU_X64 OR HAVE_UBUNTU_X86)
SET(EMGUCV_UBUNTU_NUGET_ID "${EMGUCV_NUGET_ID}.runtime${EMGUCV_RUNTIME_EXTRA_TAG}.${NUGET_NATIVE_PLATFORM_ID_UBUNTU}")
ENDIF()
IF(HAVE_RHEL_X64 OR HAVE_RHEL_X86)
SET(EMGUCV_RHEL_NUGET_ID "${EMGUCV_NUGET_ID}.runtime${EMGUCV_RUNTIME_EXTRA_TAG}.${NUGET_NATIVE_PLATFORM_ID_RHEL}")
ENDIF()
IF ("${LICENSE_TYPE}" STREQUAL "Commercial")
MESSAGE(STATUS "Configuring nuget package for commercial only release")
ELSEIF()
MESSAGE(STATUS "Configuring nuget package for dual license release")
ENDIF()
IF(WITH_OPENVINO OR WITH_INF_ENGINE)
SET(EMGUCV_WINDOWS_NUGET_ID "${EMGUCV_WINDOWS_NUGET_ID}.dldt")
ENDIF()
SET(EMGUCV_MACOS_NUGET_FILE_LIST "")
IF(HAVE_MACOS)
SET(EMGUCV_MACOS_NUGET_FILE_LIST "${EMGUCV_MACOS_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\libs\\runtimes\\osx\\native\\*.*\"/>
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"..\\..\\..\\${EMGUCV_LICENSE_FILE}\" target=\"\" />
<file src=\"docs\\README.md\" target=\"docs\\\" />")
ENDIF()
SET(EMGUCV_WINDOWS_NUGET_FILE_LIST "")
IF(HAVE_WINDESKTOP_X86)
SET(EMGUCV_WINDOWS_NUGET_FILE_LIST "${EMGUCV_WINDOWS_NUGET_FILE_LIST} <file src=\"..\\..\\..\\libs\\runtimes\\win-x86\\native\\*.dll\" exclude=\"..\\..\\..\\libs\\runtimes\\win-x86\\native\\cu*.dll;..\\..\\..\\libs\\runtimes\\win-x86\\native\\npp*.dll;..\\..\\..\\libs\\runtimes\\win-x86\\native\\concrt*.dll;..\\..\\..\\libs\\runtimes\\win-x86\\native\\msvcp*.dll;..\\..\\..\\libs\\runtimes\\win-x86\\native\\vcruntime*.dll;..\\..\\..\\libs\\runtimes\\win-x86\\native\\vccorlib*.dll\" target=\"runtimes\\win-x86\\native\" />")
SET(EMGUCV_WINDOWS_NUGET_FILE_LIST "${EMGUCV_WINDOWS_NUGET_FILE_LIST} <file src=\"..\\..\\..\\libs\\runtimes\\win-x86\\native\\version_string.inc\" target=\"docs\\build_info_x86.inc\" />")
SET(EMGU_WINDOWS_MSVCRT_X86_NUGET_TITLE "MSVC x86 runtime for windows")
SET(EMGU_WINDOWS_MSVCRT_X86_NUGET_FILE_LIST "${EMGU_WINDOWS_MSVCRT_X86_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\libs\\runtimes\\win-x86\\native\\concrt*.dll\" target=\"runtimes\\win-x86\\native\" />
<file src=\"..\\..\\..\\libs\\runtimes\\win-x86\\native\\msvcp*.dll\" target=\"runtimes\\win-x86\\native\" />
<file src=\"..\\..\\..\\libs\\runtimes\\win-x86\\native\\vcruntime*.dll\" target=\"runtimes\\win-x86\\native\" />
<file src=\"..\\..\\..\\libs\\runtimes\\win-x86\\native\\vccorlib*.dll\" target=\"runtimes\\win-x86\\native\" />
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"..\\..\\..\\${EMGUCV_LICENSE_FILE}\" target=\"\" />")
INSTALL(
FILES
"libs/runtimes/win-x86/native/version_string.inc"
DESTINATION "libs/runtimes/win-x86/native/"
COMPONENT emgucv_binary
)
ENDIF()
IF(HAVE_WINDESKTOP_X64)
SET(EMGUCV_WINDOWS_NUGET_FILE_LIST "${EMGUCV_WINDOWS_NUGET_FILE_LIST} <file src=\"..\\..\\..\\libs\\runtimes\\win-x64\\native\\*.dll\" exclude=\"..\\..\\..\\libs\\runtimes\\win-x64\\native\\cu*.dll;..\\..\\..\\libs\\runtimes\\win-x64\\native\\npp*.dll;..\\..\\..\\libs\\runtimes\\win-x64\\native\\concrt*.dll;..\\..\\..\\libs\\runtimes\\win-x64\\native\\msvcp*.dll;..\\..\\..\\libs\\runtimes\\win-x64\\native\\vcruntime*.dll;..\\..\\..\\libs\\runtimes\\win-x64\\native\\vccorlib*.dll;..\\..\\..\\libs\\runtimes\\win-x64\\native\\zlibwapi.dll\" target=\"runtimes\\win-x64\\native\" />")
#Also added configuration files from OpenVino
SET(EMGUCV_WINDOWS_NUGET_FILE_LIST "${EMGUCV_WINDOWS_NUGET_FILE_LIST} <file src=\"..\\..\\..\\libs\\runtimes\\win-x64\\native\\*.xml\" target=\"runtimes\\win-x64\\native\" />")
SET(EMGUCV_WINDOWS_NUGET_FILE_LIST "${EMGUCV_WINDOWS_NUGET_FILE_LIST} <file src=\"..\\..\\..\\libs\\runtimes\\win-x64\\native\\*.json\" target=\"runtimes\\win-x64\\native\" />")
SET(EMGUCV_WINDOWS_NUGET_FILE_LIST "${EMGUCV_WINDOWS_NUGET_FILE_LIST} <file src=\"..\\..\\..\\libs\\runtimes\\win-x64\\native\\*.elf\" target=\"runtimes\\win-x64\\native\" />")
SET(EMGUCV_WINDOWS_NUGET_FILE_LIST "${EMGUCV_WINDOWS_NUGET_FILE_LIST} <file src=\"..\\..\\..\\libs\\runtimes\\win-x64\\native\\*.mvcmd\" target=\"runtimes\\win-x64\\native\" />")
SET(EMGUCV_WINDOWS_NUGET_FILE_LIST "${EMGUCV_WINDOWS_NUGET_FILE_LIST} <file src=\"..\\..\\..\\libs\\runtimes\\win-x64\\native\\version_string.inc\" target=\"docs\\build_info_x64.inc\" />")
SET(EMGU_WINDOWS_MSVCRT_X64_NUGET_TITLE "MSVC x64 runtime for windows")
SET(EMGU_WINDOWS_MSVCRT_X64_NUGET_FILE_LIST "${EMGU_WINDOWS_MSVCRT_X64_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\libs\\runtimes\\win-x64\\native\\concrt*.dll\" target=\"runtimes\\win-x64\\native\" />
<file src=\"..\\..\\..\\libs\\runtimes\\win-x64\\native\\msvcp*.dll\" target=\"runtimes\\win-x64\\native\" />
<file src=\"..\\..\\..\\libs\\runtimes\\win-x64\\native\\vcruntime*.dll\" target=\"runtimes\\win-x64\\native\" />
<file src=\"..\\..\\..\\libs\\runtimes\\win-x64\\native\\vccorlib*.dll\" target=\"runtimes\\win-x64\\native\" />
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"..\\..\\..\\${EMGUCV_LICENSE_FILE}\" target=\"\" />")
SET(EMGU_WINDOWS_ZLIBWAPI_X64_NUGET_FILE_LIST "${EMGU_WINDOWS_ZLIBWAPI_X64_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\libs\\runtimes\\win-x64\\native\\zlibwapi.dll\" target=\"runtimes\\win-x64\\native\" />
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"zlib_license.txt\" target=\"\" />")
INSTALL(
FILES
"libs/runtimes/win-x64/native/version_string.inc"
DESTINATION "libs/runtimes/win-x64/native/"
COMPONENT emgucv_binary
)
ENDIF()
IF(HAVE_WINDESKTOP_ARM64)
SET(EMGUCV_WINDOWS_NUGET_FILE_LIST "${EMGUCV_WINDOWS_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\libs\\runtimes\\win-arm64\\native\\*.dll\" exclude=\"..\\..\\..\\libs\\runtimes\\win-arm64\\native\\cu*.dll;..\\..\\..\\libs\\runtimes\\win-arm64\\native\\npp*.dll;..\\..\\..\\libs\\runtimes\\win-arm64\\native\\concrt*.dll;..\\..\\..\\libs\\runtimes\\win-arm64\\native\\msvcp*.dll;..\\..\\..\\libs\\runtimes\\win-arm64\\native\\vcruntime*.dll;..\\..\\..\\libs\\runtimes\\win-arm64\\native\\vccorlib*.dll;..\\..\\..\\libs\\runtimes\\win-arm64\\native\\opencv_videoio_ffmpeg*.dll\" target=\"runtimes\\win-arm64\\native\" />
<file src=\"..\\..\\..\\libs\\runtimes\\win-arm64\\native\\version_string.inc\" target=\"docs\\build_info_arm64.inc\" />")
SET(EMGU_WINDOWS_MSVCRT_ARM64_NUGET_TITLE "MSVC arm64 runtime for windows")
SET(EMGU_WINDOWS_MSVCRT_ARM64_NUGET_FILE_LIST "${EMGU_WINDOWS_MSVCRT_ARM64_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\libs\\runtimes\\win-arm64\\native\\concrt*.dll\" target=\"runtimes\\win-arm64\\native\" />
<file src=\"..\\..\\..\\libs\\runtimes\\win-arm64\\native\\msvcp*.dll\" target=\"runtimes\\win-arm64\\native\" />
<file src=\"..\\..\\..\\libs\\runtimes\\win-arm64\\native\\vcruntime*.dll\" target=\"runtimes\\win-arm64\\native\" />
<file src=\"..\\..\\..\\libs\\runtimes\\win-arm64\\native\\vccorlib*.dll\" target=\"runtimes\\win-arm64\\native\" />
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"..\\..\\..\\${EMGUCV_LICENSE_FILE}\" target=\"\" />")
INSTALL(
FILES
"libs/runtimes/win-arm64/native/version_string.inc"
DESTINATION "libs/runtimes/win-arm64/native/"
COMPONENT emgucv_binary
)
ENDIF()
IF(HAVE_WINDESKTOP_X86 OR HAVE_WINDESKTOP_X64 OR HAVE_WINDESKTOP_ARM64)
SET(EMGUCV_WINDOWS_NUGET_FILE_LIST "${EMGUCV_WINDOWS_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"..\\..\\..\\${EMGUCV_LICENSE_FILE}\" target=\"\" />
<file src=\"README.md\" target=\"docs\\\" />")
ENDIF()
SET(EMGUCV_XAMARIN_MACOS_NUGET_FILE_LIST "")
SET(EMGUCV_MAUI_MACOS_NUGET_FILE_LIST "")
IF(HAVE_MACOS)
SET(EMGUCV_XAMARIN_MACOS_NUGET_DEPENDENCY "
<dependencies>
<dependency id=\"${EMGUCV_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" />
</dependencies>")
SET(EMGUCV_XAMARIN_MACOS_NUGET_FILE_LIST "${EMGUCV_XAMARIN_MACOS_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\libs\\Emgu.CV.Platform.Xamarin.Mac.dll\" target=\"lib\\Xamarin.Mac\" />
<file src=\"..\\..\\..\\libs\\Emgu.CV.Platform.Xamarin.Mac.xml\" target=\"lib\\Xamarin.Mac\" />
<file src=\"..\\_._\" target=\"lib\\netstandard2.0\" />
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"..\\..\\..\\${EMGUCV_LICENSE_FILE}\" target=\"\" />")
ENDIF()
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.maui.macos.Directory.Build.props.in ${CMAKE_CURRENT_SOURCE_DIR}/Emgu.CV.Platform/Maui/Mac/Directory.Build.props)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.maui.macos.Package.README.md.in ${CMAKE_CURRENT_SOURCE_DIR}/Emgu.CV.Platform/Maui/Mac/docs/README.md)
SET(EMGUCV_UWP_NUGET_FILE_LIST "")
IF(HAVE_WINSTORE_10_X86)
SET(EMGUCV_UWP_NUGET_FILE_LIST "${EMGUCV_UWP_NUGET_FILE_LIST} <file src=\"..\\..\\..\\libs\\runtimes\\win10-x86\\native\\*.dll\" target=\"runtimes\\win10-x86\\native\" />")
ENDIF()
IF(HAVE_WINSTORE_10_X64)
SET(EMGUCV_UWP_NUGET_FILE_LIST "${EMGUCV_UWP_NUGET_FILE_LIST} <file src=\"..\\..\\..\\libs\\runtimes\\win10-x64\\native\\*.dll\" target=\"runtimes\\win10-x64\\native\" />")
ENDIF()
IF(HAVE_WINSTORE_10_ARM)
SET(EMGUCV_UWP_NUGET_FILE_LIST "${EMGUCV_UWP_NUGET_FILE_LIST} <file src=\"..\\..\\..\\libs\\runtimes\\win10-arm\\native\\*.dll\" target=\"runtimes\\win10-arm\\native\" />")
ENDIF()
IF(HAVE_WINSTORE_10_ARM64)
SET(EMGUCV_UWP_NUGET_FILE_LIST "${EMGUCV_UWP_NUGET_FILE_LIST} <file src=\"..\\..\\..\\libs\\runtimes\\win10-arm64\\native\\*.dll\" target=\"runtimes\\win10-arm64\\native\" />")
ENDIF()
IF(HAVE_WINSTORE_10)
SET(EMGUCV_UWP_NUGET_DEPENDENCY "
<dependencies>
<dependency id=\"${EMGUCV_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" />
</dependencies>")
#<file src=\"Emgu.CV.runtime.uwp.targets\" target=\"build\\${EMGUCV_UWP_NUGET_ID}.targets\" />
SET(EMGUCV_UWP_NUGET_FILE_LIST "${EMGUCV_UWP_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"..\\..\\..\\${EMGUCV_LICENSE_FILE}\" target=\"\" />")
ENDIF()
SET(EMGUCV_DEBIAN_ARM_NUGET_FILE_LIST "")
SET(EMGUCV_DEBIAN_ARM64_NUGET_FILE_LIST "")
SET(EMGUCV_DEBIAN_NUGET_DEPENDENCY " <dependencies>
<dependency id=\"${EMGUCV_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" />
</dependencies>")
IF(HAVE_LINUX_ARM)
SET(EMGUCV_DEBIAN_ARM_NUGET_FILE_LIST "${EMGUCV_DEBIAN_ARM_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\libs\\runtimes\\linux-arm\\native\\*.so\" target=\"runtimes\\linux-arm\\native\" />")
SET(EMGUCV_DEBIAN_ARM_NUGET_FILE_LIST "${EMGUCV_DEBIAN_ARM_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\libs\\runtimes\\linux-arm\\native\\debian_arm_version_string.inc\" target=\"docs\\build_info_arm.inc\" />")
SET(EMGUCV_DEBIAN_ARM_NUGET_FILE_LIST "${EMGUCV_DEBIAN_ARM_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"..\\..\\..\\${EMGUCV_LICENSE_FILE}\" target=\"\" />")
ENDIF()
IF(HAVE_LINUX_ARM64)
SET(EMGUCV_DEBIAN_ARM64_NUGET_FILE_LIST "${EMGUCV_DEBIAN_ARM64_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\libs\\runtimes\\linux-arm64\\native\\*.so\" target=\"runtimes\\linux-arm64\\native\" />")
SET(EMGUCV_DEBIAN_ARM64_NUGET_FILE_LIST "${EMGUCV_DEBIAN_ARM64_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\libs\\runtimes\\linux-arm64\\native\\debian_arm64_version_string.inc\" target=\"docs\\build_info_arm64.inc\" />")
SET(EMGUCV_DEBIAN_ARM64_NUGET_FILE_LIST "${EMGUCV_DEBIAN_ARM64_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"..\\..\\..\\${EMGUCV_LICENSE_FILE}\" target=\"\" />")
ENDIF()
SET(EMGUCV_UBUNTU_NUGET_FILE_LIST "")
IF(HAVE_UBUNTU_X64)
SET(EMGUCV_UBUNTU_NUGET_FILE_LIST "${EMGUCV_UBUNTU_NUGET_FILE_LIST} <file src=\"..\\..\\..\\libs\\runtimes\\ubuntu-x64\\native\\*.so\" target=\"runtimes\\ubuntu-x64\\native\" />")
ENDIF()
IF(HAVE_UBUNTU_X86)
SET(EMGUCV_UBUNTU_NUGET_FILE_LIST "${EMGUCV_UBUNTU_NUGET_FILE_LIST} <file src=\"..\\..\\..\\libs\\runtimes\\ubuntu-x86\\native\\*.so\" target=\"runtimes\\ubuntu-x86\\native\" />")
ENDIF()
IF(HAVE_UBUNTU_ARM64)
SET(EMGUCV_UBUNTU_NUGET_FILE_LIST "${EMGUCV_UBUNTU_NUGET_FILE_LIST} <file src=\"..\\..\\..\\libs\\runtimes\\ubuntu-arm64\\native\\*.so\" target=\"runtimes\\ubuntu-arm64\\native\" />")
ENDIF()
IF(HAVE_UBUNTU_X64 OR HAVE_UBUNTU_X86 OR HAVE_UBUNTU_ARM64)
SET(EMGUCV_UBUNTU_NUGET_DEPENDENCY "
<dependencies>
<dependency id=\"${EMGUCV_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" />
</dependencies>")
SET(EMGUCV_UBUNTU_NUGET_FILE_LIST "${EMGUCV_UBUNTU_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"..\\..\\..\\${EMGUCV_LICENSE_FILE}\" target=\"\" />
<file src=\"README.md\" target=\"docs\\\" />")
IF(HAVE_UBUNTU_X64)
SET(EMGUCV_UBUNTU_NUGET_FILE_LIST "${EMGUCV_UBUNTU_NUGET_FILE_LIST} <file src=\"..\\..\\..\\libs\\runtimes\\ubuntu-x64\\native\\ubuntu_x64_version_string.inc\" target=\"docs\\build_info_x64.inc\" /> ")
ENDIF()
ENDIF()
SET(EMGUCV_RHEL_NUGET_FILE_LIST "")
IF(HAVE_RHEL_X64)
SET(EMGUCV_RHEL_NUGET_FILE_LIST "${EMGUCV_RHEL_NUGET_FILE_LIST} <file src=\"..\\..\\..\\libs\\runtimes\\rhel-x64\\native\\*.so\" target=\"runtimes\\rhel-x64\\native\" />")
ENDIF()
IF(HAVE_RHEL_X86)
SET(EMGUCV_RHEL_NUGET_FILE_LIST "${EMGUCV_RHEL_NUGET_FILE_LIST} <file src=\"..\\..\\..\\libs\\runtimes\\rhel-x86\\native\\*.so\" target=\"runtimes\\rhel-x86\\native\" />")
ENDIF()
IF(HAVE_RHEL_ARM64)
SET(EMGUCV_RHEL_NUGET_FILE_LIST "${EMGUCV_RHEL_NUGET_FILE_LIST} <file src=\"..\\..\\..\\libs\\runtimes\\rhel-arm64\\native\\*.so\" target=\"runtimes\\rhel-arm64\\native\" />")
ENDIF()
IF(HAVE_RHEL_X64 OR HAVE_RHEL_X86 OR HAVE_RHEL_ARM64)
SET(EMGUCV_RHEL_NUGET_DEPENDENCY "
<dependencies>
<dependency id=\"${EMGUCV_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" />
</dependencies>")
SET(EMGUCV_RHEL_NUGET_FILE_LIST "${EMGUCV_RHEL_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"..\\..\\..\\${EMGUCV_LICENSE_FILE}\" target=\"\" />
<file src=\"README.md\" target=\"docs\\\" />")
IF(HAVE_RHEL_X64)
SET(EMGUCV_RHEL_NUGET_FILE_LIST "${EMGUCV_RHEL_NUGET_FILE_LIST} <file src=\"..\\..\\..\\libs\\runtimes\\rhel-x64\\native\\rhel_x64_version_string.inc\" target=\"docs\\build_info_x64.inc\" /> ")
ENDIF()
ENDIF()
SET(EMGUCV_NUGET_FILE_LIST "")
SET(EMGUCV_NUGET_DEPENDENCY "")
SET(EMGUCV_NUGET_FRAMEWORK_REFERENCES "")
SET(NUGET_SYSTEM_DRAWING_COMMON_VERSION "8.0.1")
SET(NUGET_SYSTEM_TEXT_JSON_VERSION "8.0.1")
SET(EMGUCV_NUGET_FILE_LIST "${EMGUCV_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\libs\\iOS\\Emgu.CV.dll\" target=\"lib\\xamarinios10\" />
<file src=\"..\\..\\..\\libs\\iOS\\Emgu.CV.xml\" target=\"lib\\xamarinios10\" />
<file src=\"..\\..\\..\\libs\\iOS\\Emgu.CV.dll\" target=\"lib\\${EMGUCV_MAUI_MACOS_DST_FOLDER}\" />
<file src=\"..\\..\\..\\libs\\iOS\\Emgu.CV.xml\" target=\"lib\\${EMGUCV_MAUI_MACOS_DST_FOLDER}\" />
<file src=\"..\\..\\..\\libs\\iOS\\Emgu.CV.dll\" target=\"lib\\${EMGUCV_MAUI_IOS_DST_FOLDER}\" />
<file src=\"..\\..\\..\\libs\\iOS\\Emgu.CV.xml\" target=\"lib\\${EMGUCV_MAUI_IOS_DST_FOLDER}\" />
")
SET(EMGUCV_NUGET_DEPENDENCY "${EMGUCV_NUGET_DEPENDENCY}
<group targetFramework=\"Xamarin.iOS1.0\">
<dependency id=\"System.Drawing.Primitives\" version=\"4.3.0\" exclude=\"Build,Analyzers\" />
<dependency id=\"System.Runtime\" version=\"4.3.1\" exclude=\"Build,Analyzers\" />
<dependency id=\"System.Runtime.InteropServices.RuntimeInformation\" version=\"4.3.0\" exclude=\"Build,Analyzers\" />
<dependency id=\"System.Text.Json\" version=\"${NUGET_SYSTEM_TEXT_JSON_VERSION}\" exclude=\"Build,Analyzers\" />
</group>
<group targetFramework=\"${EMGUCV_MAUI_MACOS_DST_FOLDER}\">
<dependency id=\"System.Drawing.Primitives\" version=\"4.3.0\" exclude=\"Build,Analyzers\" />
<dependency id=\"System.Runtime\" version=\"4.3.1\" exclude=\"Build,Analyzers\" />
<dependency id=\"System.Runtime.InteropServices.RuntimeInformation\" version=\"4.3.0\" exclude=\"Build,Analyzers\" />
<dependency id=\"System.Runtime.InteropServices.NFloat.Internal\" version=\"6.0.1\" exclude=\"Build,Analyzers\" />
</group>
<group targetFramework=\"${EMGUCV_MAUI_IOS_DST_FOLDER}\">
<dependency id=\"System.Drawing.Primitives\" version=\"4.3.0\" exclude=\"Build,Analyzers\" />
<dependency id=\"System.Runtime\" version=\"4.3.1\" exclude=\"Build,Analyzers\" />
<dependency id=\"System.Runtime.InteropServices.RuntimeInformation\" version=\"4.3.0\" exclude=\"Build,Analyzers\" />
<dependency id=\"System.Runtime.InteropServices.NFloat.Internal\" version=\"6.0.1\" exclude=\"Build,Analyzers\" />
</group>")
SET(EMGUCV_NUGET_FILE_LIST "${EMGUCV_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\libs\\Emgu.CV.dll\" target=\"lib\\netstandard2.0\" />
<file src=\"..\\..\\..\\libs\\Emgu.CV.xml\" target=\"lib\\netstandard2.0\" />
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"..\\..\\..\\${EMGUCV_LICENSE_FILE}\" target=\"\" />
<file src=\"README.md\" target=\"docs\\\" />")
SET(EMGUCV_NUGET_DEPENDENCY "${EMGUCV_NUGET_DEPENDENCY}
<group targetFramework=\".NETStandard2.0\">
<dependency id=\"System.Drawing.Primitives\" version=\"4.3.0\" exclude=\"Build,Analyzers\" />
<dependency id=\"System.Runtime\" version=\"4.3.1\" exclude=\"Build,Analyzers\" />
<dependency id=\"System.Runtime.InteropServices.RuntimeInformation\" version=\"4.3.0\" exclude=\"Build,Analyzers\" />
<dependency id=\"System.Text.Json\" version=\"${NUGET_SYSTEM_TEXT_JSON_VERSION}\" exclude=\"Build,Analyzers\" />
</group>")
SET(EMGUCV_BITMAP_NUGET_TITLE "Bitmap extension for Emgu CV")
SET(EMGUCV_BITMAP_NUGET_SUMMARY "This package add extension method to convert Bitmap to and from Emgu objects (e.g. Mat, UMat, GpuMat)")
SET(EMGUCV_BITMAP_NUGET_FILE_LIST "")
SET(EMGUCV_BITMAP_NUGET_DEPENDENCY "")
SET(EMGUCV_BITMAP_NUGET_FILE_LIST "${EMGUCV_BITMAP_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\libs\\Emgu.CV.Bitmap.dll\" target=\"lib\\netstandard2.0\" />
<file src=\"..\\..\\..\\libs\\Emgu.CV.Bitmap.xml\" target=\"lib\\netstandard2.0\" />
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"..\\..\\..\\${EMGUCV_LICENSE_FILE}\" target=\"\" />
<file src=\"README.md\" target=\"docs\\\" />")
SET(EMGUCV_BITMAP_NUGET_DEPENDENCY "${EMGUCV_BITMAP_NUGET_DEPENDENCY}
<group targetFramework=\".NETStandard2.0\">
<dependency id=\"System.Drawing.Common\" version=\"${NUGET_SYSTEM_DRAWING_COMMON_VERSION}\" exclude=\"Build,Analyzers\" />
<dependency id=\"${EMGUCV_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" />
</group>")
SET(EMGUCV_BITMAP_NUGET_DEPENDENCY "
<dependencies>
${EMGUCV_BITMAP_NUGET_DEPENDENCY}
</dependencies>")
SET(EMGUCV_WPF_NUGET_TITLE "WPF extension for Emgu CV")
SET(EMGUCV_WPF_NUGET_SUMMARY "This package add extension method to convert BitmapSource to and from Emgu objects (e.g. Mat)")
SET(EMGUCV_WPF_NUGET_FILE_LIST "")
SET(EMGUCV_WPF_NUGET_DEPENDENCY "")
SET(EMGUCV_WPF_NUGET_FILE_LIST "${EMGUCV_WPF_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\libs\\Emgu.CV.Wpf.dll\" target=\"lib\\netcoreapp3.1\" />
<file src=\"..\\..\\..\\libs\\Emgu.CV.Wpf.xml\" target=\"lib\\netcoreapp3.1\" />
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"..\\..\\..\\${EMGUCV_LICENSE_FILE}\" target=\"\" />
<file src=\"README.md\" target=\"docs\\\" />")
SET(EMGUCV_WPF_NUGET_DEPENDENCY "${EMGUCV_WPF_NUGET_DEPENDENCY}
<group targetFramework=\".NETCoreApp3.1\">
<frameworkReference name=\"Microsoft.WindowsDesktop.App.WPF\" />
<dependency id=\"${EMGUCV_BITMAP_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" />
</group>")
SET(EMGUCV_WPF_NUGET_DEPENDENCY "
<dependencies>
${EMGUCV_WPF_NUGET_DEPENDENCY}
</dependencies>")
SET(EMGUCV_MODELS_NUGET_TITLE "Experimental component to help download, initialize and execute image processing/AI models.")
SET(EMGUCV_MODELS_NUGET_SUMMARY "Experimental component to help download, initialize and execute image processing/AI models. This is under active development and API may change from time to time.")
SET(EMGUCV_MODELS_NUGET_FILE_LIST "")
SET(EMGUCV_MODELS_NUGET_DEPENDENCY "")
IF (HAVE_IOS)
SET(EMGUCV_MODELS_NUGET_FILE_LIST "${EMGUCV_MODELS_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\libs\\iOS\\Emgu.CV.Models.dll\" target=\"lib\\xamarinios10\" />
<file src=\"..\\..\\..\\libs\\iOS\\Emgu.CV.Models.xml\" target=\"lib\\xamarinios10\" />
<file src=\"..\\..\\..\\libs\\iOS\\Emgu.CV.Models.dll\" target=\"lib\\${EMGUCV_MAUI_MACOS_DST_FOLDER}\" />
<file src=\"..\\..\\..\\libs\\iOS\\Emgu.CV.Models.xml\" target=\"lib\\${EMGUCV_MAUI_MACOS_DST_FOLDER}\" />
<file src=\"..\\..\\..\\libs\\iOS\\Emgu.CV.Models.dll\" target=\"lib\\${EMGUCV_MAUI_IOS_DST_FOLDER}\" />
<file src=\"..\\..\\..\\libs\\iOS\\Emgu.CV.Models.xml\" target=\"lib\\${EMGUCV_MAUI_IOS_DST_FOLDER}\" />
")
SET(EMGUCV_MODELS_NUGET_DEPENDENCY "${EMGUCV_MODELS_NUGET_DEPENDENCY}
<group targetFramework=\"Xamarin.iOS1.0\">
<dependency id=\"System.Drawing.Common\" version=\"${NUGET_SYSTEM_DRAWING_COMMON_VERSION}\" exclude=\"Build,Analyzers\" />
<dependency id=\"${EMGUCV_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" />
</group>
<group targetFramework=\"${EMGUCV_MAUI_MACOS_DST_FOLDER}\">
<dependency id=\"System.Drawing.Common\" version=\"${NUGET_SYSTEM_DRAWING_COMMON_VERSION}\" exclude=\"Build,Analyzers\" />
<dependency id=\"${EMGUCV_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" />
</group>
<group targetFramework=\"${EMGUCV_MAUI_IOS_DST_FOLDER}\">
<dependency id=\"System.Drawing.Common\" version=\"${NUGET_SYSTEM_DRAWING_COMMON_VERSION}\" exclude=\"Build,Analyzers\" />
<dependency id=\"${EMGUCV_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" />
</group>")
ENDIF()
SET(EMGUCV_MODELS_NUGET_FILE_LIST "${EMGUCV_MODELS_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\libs\\Emgu.CV.Models.dll\" target=\"lib\\netstandard2.0\" />
<file src=\"..\\..\\..\\libs\\Emgu.CV.Models.xml\" target=\"lib\\netstandard2.0\" />
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"..\\..\\..\\${EMGUCV_LICENSE_FILE}\" target=\"\" />
<file src=\"README.md\" target=\"docs\\\" />")
SET(EMGUCV_MODELS_NUGET_DEPENDENCY "${EMGUCV_MODELS_NUGET_DEPENDENCY}
<group targetFramework=\".NETStandard2.0\">
<dependency id=\"System.Drawing.Common\" version=\"${NUGET_SYSTEM_DRAWING_COMMON_VERSION}\" exclude=\"Build,Analyzers\" />
<dependency id=\"${EMGUCV_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" />
</group>")
SET(EMGUCV_MODELS_NUGET_DEPENDENCY "
<dependencies>
${EMGUCV_MODELS_NUGET_DEPENDENCY}
</dependencies>")
IF (HAVE_WINDESKTOP_X64 OR HAVE_WINDESKTOP_X86 OR HAVE_WINDESKTOP_ARM64)
#SET(EMGU_WINDOWS_MSVCRT_VERSION ${MSVC_TOOLSET_VERSION})
IF(MSVC)
SET(EMGU_WINDOWS_MSVCRT_VERSION ${CMAKE_CXX_COMPILER_VERSION})
string(REPLACE "." ";" EMGU_WINDOWS_MSVCRT_VERSION_LIST ${EMGU_WINDOWS_MSVCRT_VERSION})
list(GET EMGU_WINDOWS_MSVCRT_VERSION_LIST 0 EMGU_WINDOWS_MSVCRT_VERSION_MAJOR)
list(GET EMGU_WINDOWS_MSVCRT_VERSION_LIST 1 EMGU_WINDOWS_MSVCRT_VERSION_MINOR)
list(GET EMGU_WINDOWS_MSVCRT_VERSION_LIST 2 EMGU_WINDOWS_MSVCRT_VERSION_PATCH)
list(GET EMGU_WINDOWS_MSVCRT_VERSION_LIST 3 EMGU_WINDOWS_MSVCRT_VERSION_BUILD)
MESSAGE(STATUS "MSVCRT VERSION: ${EMGU_WINDOWS_MSVCRT_VERSION_MAJOR}.${EMGU_WINDOWS_MSVCRT_VERSION_MINOR}.${EMGU_WINDOWS_MSVCRT_VERSION_PATCH}.${EMGU_WINDOWS_MSVCRT_VERSION_BUILD}")
SET(EMGU_WINDOWS_MSVCRT_NUGET_VERSION ${EMGU_WINDOWS_MSVCRT_VERSION})
IF ("${EMGU_WINDOWS_MSVCRT_VERSION_BUILD}" STREQUAL "0")
SET(EMGU_WINDOWS_MSVCRT_NUGET_VERSION "${EMGU_WINDOWS_MSVCRT_VERSION_MAJOR}.${EMGU_WINDOWS_MSVCRT_VERSION_MINOR}.${EMGU_WINDOWS_MSVCRT_VERSION_PATCH}")
ENDIF()
MESSAGE(STATUS "MSVCRT NUGET VERSION: ${EMGU_WINDOWS_MSVCRT_NUGET_VERSION}")
ENDIF()
SET(EMGUCV_UI_NUGET_TITLE "Windows UI components for Emgu CV")
SET(EMGUCV_UI_NUGET_FILE_LIST "${EMGUCV_UI_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\libs\\Emgu.CV.Platform.NetFramework.dll\" target=\"lib\\net461\" />
<file src=\"..\\..\\..\\libs\\Emgu.CV.Platform.NetFramework.xml\" target=\"lib\\net461\" />
<file src=\"..\\..\\..\\libs\\Emgu.CV.Platform.NetCore.dll\" target=\"lib\\netcoreapp3.1\" />
<file src=\"..\\..\\..\\libs\\Emgu.CV.Platform.NetCore.xml\" target=\"lib\\netcoreapp3.1\" />
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"..\\..\\..\\${EMGUCV_LICENSE_FILE}\" target=\"\" />
<file src=\"README.md\" target=\"docs\\\" />")
SET(EMGUCV_UI_NUGET_DEPENDENCY "${EMGUCV_UI_NUGET_DEPENDENCY}
<group targetFramework=\".NETFramework4.6.1\">
<dependency id=\"${EMGUCV_BITMAP_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" />
</group>")
SET(EMGUCV_UI_NUGET_DEPENDENCY "${EMGUCV_UI_NUGET_DEPENDENCY}
<group targetFramework=\".NETCoreApp3.1\">
<dependency id=\"${EMGUCV_BITMAP_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" />
</group>")
SET(EMGUCV_UI_NUGET_DEPENDENCY "${EMGUCV_UI_NUGET_DEPENDENCY}
<frameworkReferences>
<group targetFramework=\".NETCoreApp3.1\">
<frameworkReference name=\"Microsoft.WindowsDesktop.App.WindowsForms\" />
</group>
</frameworkReferences>")
SET(EMGUCV_UI_NUGET_DEPENDENCY "
<dependencies>
${EMGUCV_UI_NUGET_DEPENDENCY}
</dependencies>
<frameworkAssemblies>
<frameworkAssembly assemblyName=\"System.Windows.Forms\" targetFramework=\".NETFramework4.6.1\" />
</frameworkAssemblies>")
ENDIF()
SET(EMGUCV_NUGET_DEPENDENCY "
<dependencies>
${EMGUCV_NUGET_DEPENDENCY}
</dependencies>")
#SET(EMGUCV_NUGET_FRAMEWORK_REFERENCES "
# <frameworkReferences>
#${EMGUCV_NUGET_FRAMEWORK_REFERENCES}
# </frameworkReferences>")
SET(EMGUCV_NUGET_TITLE_ARCH "")
IF(HAVE_WINDESKTOP_X86)
SET(EMGUCV_NUGET_TITLE_ARCH "${EMGUCV_NUGET_TITLE_ARCH} x86")
ENDIF()
IF(HAVE_WINDESKTOP_X64)
SET(EMGUCV_NUGET_TITLE_ARCH "${EMGUCV_NUGET_TITLE_ARCH} x64")
ENDIF()
IF(HAVE_WINDESKTOP_ARM64)
SET(EMGUCV_NUGET_TITLE_ARCH "${EMGUCV_NUGET_TITLE_ARCH} arm64")
ENDIF()
STRING(STRIP "${EMGUCV_NUGET_TITLE_ARCH}" EMGUCV_NUGET_TITLE_ARCH)
STRING(REPLACE "x86 x64 arm64" "" EMGUCV_NUGET_TITLE_ARCH "${EMGUCV_NUGET_TITLE_ARCH}")
SET(EMGUCV_WINDOWS_NUGET_DEPENDENCY "${EMGUCV_WINDOWS_NUGET_DEPENDENCY}<dependency id=\"${EMGUCV_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" />")
#SET(EMGUCV_WINDOWS_NETCORE_NUGET_DEPENDENCY "<dependency id=\"${EMGUCV_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" />")
#SET(EMGUCV_WINDOWS_NETFRAMEWORK_NUGET_DEPENDENCY "<dependency id=\"${EMGUCV_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" />")
SET(EMGUCV_WINDOWS_NUGET_TITLE "EMGU CV ${EMGUCV_NUGET_TITLE_ARCH}")
#SET(EMGUCV_WINDOWS_NUGET_TITLE "EMGU CV ${EMGUCV_NUGET_TITLE_ARCH}")
STRING(STRIP "${EMGUCV_WINDOWS_NUGET_TITLE}" EMGUCV_WINDOWS_NUGET_TITLE)
SET(EMGUCV_WINDOWS_NUGET_TITLE "${EMGUCV_WINDOWS_NUGET_TITLE} runtime for windows")
SET(EMGUCV_MACOS_NUGET_DEPENDENCY "${EMGUCV_MACOS_NUGET_DEPENDENCY}<dependency id=\"${EMGUCV_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" />")
SET(EMGUCV_MACOS_NUGET_TITLE "EMGU CV")
STRING(STRIP "${EMGUCV_MACOS_NUGET_TITLE}" EMGUCV_MACOS_NUGET_TITLE)
SET(EMGUCV_MACOS_NUGET_TITLE "${EMGUCV_MACOS_NUGET_TITLE} runtime for MacOS")
IF(WITH_CUDA)
SET(EMGUCV_WINDOWS_NUGET_TITLE "${EMGUCV_WINDOWS_NUGET_TITLE} with CUDA support")
SET(EMGU_CUDA_NUGET_TITLE "Native x64 CUDA dependency for EMGU CV")
#SET(EMGU_CUDA_VERSION "${npp_major}.${npp_minor}.${npp_build}")
IF ( (${cuda_major}) AND (${cuda_minor}) AND (${npp_build}) )
SET(EMGU_CUDA_VERSION "${cuda_major}.${cuda_minor}.${npp_build}")
ELSEIF (${CUDA_VERSION} AND (${npp_build}) )
SET(EMGU_CUDA_VERSION "${CUDA_VERSION}.${npp_build}")
ELSEIF (${CUDA_VERSION})
SET(EMGU_CUDA_VERSION "${CUDA_VERSION}")
ENDIF()
SET(EMGU_CUDART_VERSION "${EMGU_CUDA_VERSION}")
SET(EMGU_CUDA_NUGET_DEPENDENCY_STR "${EMGU_CUDA_VERSION}")
SET(EMGU_CUFFT_VERSION "${EMGU_CUDA_VERSION}")
SET(EMGU_CUFFT_NUGET_TITLE "Native x64 FFT component for CUDA")
SET(EMGU_CUDNN_VERSION "${CUDNN_VERSION_MAJOR}.${CUDNN_VERSION_MINOR}.${CUDNN_VERSION_PATCH}")
IF ("${EMGU_CUDNN_VERSION}" STREQUAL "")
MESSAGE(FATAL_ERROR "FAILED to detect DNN version")
ENDIF()
SET(EMGU_CUDNN_NUGET_DEPENDENCY_STR "${EMGU_CUDNN_VERSION}")
SET(EMGU_CUDNN_NUGET_TITLE "Native x64 DNN component for CUDA")
SET(EMGU_CUDNN_CNN_INFER_NUGET_TITLE "Native x64 CNN inference component for CUDA DNN")
SET(EMGU_CUDNN_CNN_TRAIN_NUGET_TITLE "Native x64 CNN training component for CUDA DNN")
SET(EMGU_CUDNN_OPS_NUGET_TITLE "Native x64 OPS component for CUDA DNN")
SET(EMGU_CUDNN_CNN_INFER_NUGET_TITLE "Native x64 CNN inference component for CUDA DNN")
SET(EMGU_CUDNN_CNN_TRAIN_NUGET_TITLE "Native x64 CNN training component for CUDA DNN")
SET(EMGU_NPP_VERSION "${EMGU_CUDA_VERSION}")
SET(EMGU_CUDA_BLAS_VERSION "${EMGU_CUDA_VERSION}")
SET(EMGU_NPP_NUGET_TITLE "Native x64 NPP component for CUDA")
SET(EMGU_CUDA_BLAS_NUGET_TITLE "Native x64 blas component for CUDA")
SET(EMGU_CUDA_BLAS_LT_NUGET_TITLE "Native x64 blas lt component for CUDA")
IF(HAVE_WINDESKTOP_X64)
#SET(CUDA_EULA_URL https://docs.nvidia.com/pdf/EULA.pdf)
#file(DOWNLOAD ${CUDA_EULA_URL} "${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.runtime.windows.cuda.npp/EULA.pdf")
#file(DOWNLOAD ${CUDA_EULA_URL} "${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.runtime.windows.cuda.cufft/EULA.pdf")
#file(COPY "${CUDA_TOOLKIT_ROOT_DIR}/EULA.txt" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Cudnn")
SET(EMGU_CUDA_RT_NUGET_FILE_LIST "${EMGU_CUDA_RT_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\libs\\runtimes\\win-x64\\native\\cu*.dll\" exclude=\"..\\..\\..\\libs\\runtimes\\win-x64\\native\\cufft*.dll;..\\..\\..\\libs\\runtimes\\win-x64\\native\\cudnn*.dll;..\\..\\..\\libs\\runtimes\\win-x64\\native\\cublas*.dll\" target=\"runtimes\\win-x64\\native\" />
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"EULA.txt\" target=\"CUDA_EULA.txt\" />")
SET(EMGU_CUDA_NPP_NUGET_FILE_LIST "${EMGU_CUDA_NPP_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\libs\\runtimes\\win-x64\\native\\npp*.dll\" target=\"runtimes\\win-x64\\native\" />
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"EULA.txt\" target=\"CUDA_EULA.txt\" />")
SET(EMGU_CUDA_BLAS_NUGET_FILE_LIST "${EMGU_CUDA_BLAS_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\libs\\runtimes\\win-x64\\native\\cublas64*.dll\" target=\"runtimes\\win-x64\\native\" />
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"EULA.txt\" target=\"CUDA_EULA.txt\" />")
SET(EMGU_CUDA_BLAS_LT_NUGET_FILE_LIST "${EMGU_CUDA_BLAS_LT_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\libs\\runtimes\\win-x64\\native\\cublasLt*.dll\" target=\"runtimes\\win-x64\\native\" />
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"EULA.txt\" target=\"CUDA_EULA.txt\" />")
SET(EMGU_CUFFT_NUGET_FILE_LIST "${EMGU_CUFFT_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\libs\\runtimes\\win-x64\\native\\cufft*.dll\" target=\"runtimes\\win-x64\\native\" />
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"EULA.txt\" target=\"CUDA_EULA.txt\" />")
SET(EMGU_CUDNN_NUGET_FILE_LIST "${EMGU_CUDNN_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\libs\\runtimes\\win-x64\\native\\cudnn*.dll\" exclude=\"..\\..\\..\\libs\\runtimes\\win-x64\\native\\cudnn_ops_*.dll;..\\..\\..\\libs\\runtimes\\win-x64\\native\\cudnn_cnn_*.dll;..\\..\\..\\libs\\runtimes\\win-x64\\native\\cudnn_adv_*.dll\" target=\"runtimes\\win-x64\\native\" />
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"NVIDIA_SLA_cuDNN_Support.txt\" target=\"cuDNN_SLA.txt\" />")
SET(EMGU_CUDNN_CNN_INFER_NUGET_FILE_LIST "${EMGU_CUDNN_CNN_INFER_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\libs\\runtimes\\win-x64\\native\\cudnn_cnn_infer*.dll\" target=\"runtimes\\win-x64\\native\" />
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"NVIDIA_SLA_cuDNN_Support.txt\" target=\"cuDNN_SLA.txt\" />")
SET(EMGU_CUDNN_CNN_TRAIN_NUGET_FILE_LIST "${EMGU_CUDNN_CNN_TRAIN_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\libs\\runtimes\\win-x64\\native\\cudnn_cnn_train*.dll\" target=\"runtimes\\win-x64\\native\" />
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"NVIDIA_SLA_cuDNN_Support.txt\" target=\"cuDNN_SLA.txt\" />")
SET(EMGU_CUDNN_CNN_INFER_NUGET_DEPENDENCY "
<dependencies>
<dependency id=\"${EMGU_CUDNN_NUGET_ID}\" version=\"${EMGU_CUDNN_NUGET_DEPENDENCY_STR}\" />
</dependencies>")
SET(EMGU_CUDNN_CNN_TRAIN_NUGET_DEPENDENCY "
<dependencies>
<dependency id=\"${EMGU_CUDNN_NUGET_ID}\" version=\"${EMGU_CUDNN_NUGET_DEPENDENCY_STR}\" />
</dependencies>")
SET(EMGU_CUDNN_OPS_NUGET_FILE_LIST "${EMGU_CUDNN_OPS_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\libs\\runtimes\\win-x64\\native\\cudnn_ops_*.dll\" target=\"runtimes\\win-x64\\native\" />
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"NVIDIA_SLA_cuDNN_Support.txt\" target=\"cuDNN_SLA.txt\" />")
SET(EMGU_CUDNN_OPS_NUGET_DEPENDENCY "
<dependencies>
<dependency id=\"${EMGU_CUDNN_NUGET_ID}\" version=\"${EMGU_CUDNN_NUGET_DEPENDENCY_STR}\" />
</dependencies>")
SET(EMGU_CUDNN_ADV_NUGET_FILE_LIST "${EMGU_CUDNN_ADV_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\libs\\runtimes\\win-x64\\native\\cudnn_adv_*.dll\" target=\"runtimes\\win-x64\\native\" />
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"NVIDIA_SLA_cuDNN_Support.txt\" target=\"cuDNN_SLA.txt\" />")
SET(EMGU_CUDNN_ADV_NUGET_DEPENDENCY "
<dependencies>
<dependency id=\"${EMGU_CUDNN_NUGET_ID}\" version=\"${EMGU_CUDNN_NUGET_DEPENDENCY_STR}\" />
</dependencies>")
SET(EMGU_CUDNN_NUGET_DEPENDENCY "
<dependencies>
<dependency id=\"${EMGU_CUDART_NUGET_ID}\" version=\"${EMGU_CUDA_NUGET_DEPENDENCY_STR}\" />
<dependency id=\"${EMGU_ZLIBWAPI_ID}\" version=\"${EMGU_ZLIBWAPI_VERSION}\" />
</dependencies>")
SET(EMGUCV_WINDOWS_NUGET_DEPENDENCY "${EMGUCV_WINDOWS_NUGET_DEPENDENCY}
<dependency id=\"${EMGU_CUDART_NUGET_ID}\" version=\"${EMGU_CUDA_NUGET_DEPENDENCY_STR}\" />
<dependency id=\"${EMGU_CUDA_BLAS_LT_NUGET_ID}\" version=\"${EMGU_CUDA_NUGET_DEPENDENCY_STR}\" />
<dependency id=\"${EMGU_CUDA_BLAS_NUGET_ID}\" version=\"${EMGU_CUDA_NUGET_DEPENDENCY_STR}\" />
<dependency id=\"${EMGU_NPP_NUGET_ID}\" version=\"${EMGU_CUDA_NUGET_DEPENDENCY_STR}\" />
<dependency id=\"${EMGU_CUFFT_NUGET_ID}\" version=\"${EMGU_CUDA_NUGET_DEPENDENCY_STR}\" />
<dependency id=\"${EMGU_CUDNN_ADV_NUGET_ID}\" version=\"${EMGU_CUDNN_NUGET_DEPENDENCY_STR}\" />
<dependency id=\"${EMGU_CUDNN_CNN_INFER_NUGET_ID}\" version=\"${EMGU_CUDNN_NUGET_DEPENDENCY_STR}\" />
<dependency id=\"${EMGU_CUDNN_CNN_TRAIN_NUGET_ID}\" version=\"${EMGU_CUDNN_NUGET_DEPENDENCY_STR}\" />
<dependency id=\"${EMGU_CUDNN_OPS_NUGET_ID}\" version=\"${EMGU_CUDNN_NUGET_DEPENDENCY_STR}\" />
<dependency id=\"${EMGU_ZLIBWAPI_ID}\" version=\"${EMGU_ZLIBWAPI_VERSION}\" />
")
IF (WITH_CUDNN)
SET(EMGUCV_WINDOWS_NUGET_DEPENDENCY "${EMGUCV_WINDOWS_NUGET_DEPENDENCY}<dependency id=\"${EMGU_CUDNN_NUGET_ID}\" version=\"${EMGU_CUDNN_NUGET_DEPENDENCY_STR}\" />")
ENDIF()
ENDIF()
SET(NUGET_PACKAGE_VENDOR "${CPACK_PACKAGE_VENDOR}")
MESSAGE(STATUS "<<<<<<<<<<<<<<<< npp_major: ${npp_major} >>>>>>>>>>>>>>>>>>>>>> ")
MESSAGE(STATUS "<<<<<<<<<<<<<<<< npp_minor: ${npp_minor} >>>>>>>>>>>>>>>>>>>>>> ")
MESSAGE(STATUS "<<<<<<<<<<<<<<<< npp_build: ${npp_build} >>>>>>>>>>>>>>>>>>>>>> ")
MESSAGE(STATUS "<<<<<<<<<<<<<<<< cuda_major: ${cuda_major} >>>>>>>>>>>>>>>>>>>>>> ")
MESSAGE(STATUS "<<<<<<<<<<<<<<<< cuda_minor: ${cuda_minor} >>>>>>>>>>>>>>>>>>>>>> ")
MESSAGE(STATUS "<<<<<<<<<<<<<<<< CUDA_VERSION: ${CUDA_VERSION} >>>>>>>>>>>>>>>>>>>>>> ")
#MESSAGE(STATUS "<<<<<<<<<<<<<<<< CUDA_VERSION_MAJOR: ${CUDA_VERSION_MAJOR} >>>>>>>>>>>>>>>>>>>>>> ")
#MESSAGE(STATUS "<<<<<<<<<<<<<<<< CUDA_VERSION_MINOR: ${CUDA_VERSION_MINOR} >>>>>>>>>>>>>>>>>>>>>> ")
#MESSAGE(STATUS "<<<<<<<<<<<<<<<< cuda_build: ${cuda_build} >>>>>>>>>>>>>>>>>>>>>> ")
MESSAGE(STATUS "<<<<<<<<<<<<<<<< cudnn_version_major: ${CUDNN_VERSION_MAJOR} >>>>>>>>>>>>>>>>>>>>>> ")
MESSAGE(STATUS "<<<<<<<<<<<<<<<< cudnn_version_minor: ${CUDNN_VERSION_MINOR} >>>>>>>>>>>>>>>>>>>>>> ")
MESSAGE(STATUS "<<<<<<<<<<<<<<<< cudnn_version_patch: ${CUDNN_VERSION_PATCH} >>>>>>>>>>>>>>>>>>>>>> ")
MESSAGE(STATUS "<<<<<<<<<<<<<<<< EMGU_CUDA_VERSION: ${EMGU_CUDA_VERSION} >>>>>>>>>>>>>>>>>>>>>> ")
#IF ("${npp_major}" STREQUAL "")
# MESSAGE(FATAL_ERROR "CUDA is enabled, but failed to detect npp_major version")
#ENDIF()
#IF ("${npp_minor}" STREQUAL "")
# MESSAGE(FATAL_ERROR "CUDA is enabled, but failed to detect npp_minor version")
#ENDIF()
#IF ("${npp_build}" STREQUAL "")
# MESSAGE(FATAL_ERROR "CUDA is enabled, but failed to detect npp_build version")
#ENDIF()
IF ( (${cuda_major}) AND (${cuda_minor}) )
SET(CUDA_VERSION_NUMERIC_ONLY "${cuda_major}${cuda_minor}")
ELSE()
SET(CUDA_VERSION_NUMERIC_ONLY "${npp_major}${npp_minor}")
ENDIF()
IF(WIN32)
IF((${npp_major} GREATER 10) OR (("${npp_major}" STREQUAL "10") AND (${npp_minor} GREATER 0)))
IF (${cuda_major})
SET(CUFFT_POSTFIX "${cuda_major}")
else()
SET(CUFFT_POSTFIX "${npp_major}")
endif()
ELSE()
SET(CUFFT_POSTFIX "${npp_major}${npp_minor}")
ENDIF()
ENDIF()
#MESSAGE(STATUS "<<<<<<<<<<<<<<<< CUDA_VERSION_NUMERIC_ONLY: ${CUDA_VERSION_NUMERIC_ONLY} >>>>>>>>>>>>>>>>>>>>>> ")
#CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.windows.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.runtime.windows/Package.nuspec)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/${EMGU_ZLIBWAPI_ID}.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/${EMGU_ZLIBWAPI_ID}/Package.nuspec)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/${EMGU_CUFFT_NUGET_ID}.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/${EMGU_CUFFT_NUGET_ID}/Package.nuspec)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/${EMGU_CUDNN_NUGET_ID}.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/${EMGU_CUDNN_NUGET_ID}/Package.nuspec)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/${EMGU_CUDNN_ADV_NUGET_ID}.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/${EMGU_CUDNN_ADV_NUGET_ID}/Package.nuspec)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/${EMGU_CUDNN_CNN_INFER_NUGET_ID}.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/${EMGU_CUDNN_CNN_INFER_NUGET_ID}/Package.nuspec)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/${EMGU_CUDNN_CNN_TRAIN_NUGET_ID}.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/${EMGU_CUDNN_CNN_TRAIN_NUGET_ID}/Package.nuspec)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/${EMGU_CUDNN_OPS_NUGET_ID}.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/${EMGU_CUDNN_OPS_NUGET_ID}/Package.nuspec)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/${EMGU_NPP_NUGET_ID}.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/${EMGU_NPP_NUGET_ID}/Package.nuspec)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/${EMGU_CUDART_NUGET_ID}.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/${EMGU_CUDART_NUGET_ID}/Package.nuspec)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/${EMGU_CUDA_BLAS_NUGET_ID}.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/${EMGU_CUDA_BLAS_NUGET_ID}/Package.nuspec)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/${EMGU_CUDA_BLAS_LT_NUGET_ID}.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/${EMGU_CUDA_BLAS_LT_NUGET_ID}/Package.nuspec)
ENDIF()
IF(HAVE_WINDESKTOP_X86)
SET(EMGUCV_WINDOWS_NUGET_DEPENDENCY "${EMGUCV_WINDOWS_NUGET_DEPENDENCY}
<dependency id=\"${EMGU_WINDOWS_MSVCRT_X86_NUGET_ID}\" version=\"${EMGU_WINDOWS_MSVCRT_VERSION}\" />
")
ENDIF()
IF(HAVE_WINDESKTOP_X64)
SET(EMGUCV_WINDOWS_NUGET_DEPENDENCY "${EMGUCV_WINDOWS_NUGET_DEPENDENCY}
<dependency id=\"${EMGU_WINDOWS_MSVCRT_X64_NUGET_ID}\" version=\"${EMGU_WINDOWS_MSVCRT_VERSION}\" />
")
ENDIF()
IF(HAVE_WINDESKTOP_ARM64)
SET(EMGUCV_WINDOWS_NUGET_DEPENDENCY "${EMGUCV_WINDOWS_NUGET_DEPENDENCY}
<dependency id=\"${EMGU_WINDOWS_MSVCRT_ARM64_NUGET_ID}\" version=\"${EMGU_WINDOWS_MSVCRT_VERSION}\" />
")
ENDIF()
SET(EMGUCV_WINDOWS_NUGET_DEPENDENCY " <dependencies>
${EMGUCV_WINDOWS_NUGET_DEPENDENCY}
</dependencies>")
SET(EMGUCV_MACOS_NUGET_DEPENDENCY " <dependencies>
${EMGUCV_MACOS_NUGET_DEPENDENCY}
</dependencies>")
#SET(EMGUCV_WINDOWS_NUGET_DEPENDENCY " <dependencies>
# <group targetFramework=\"net461\">${EMGUCV_WINDOWS_NETFRAMEWORK_NUGET_DEPENDENCY}</group>
# <group targetFramework=\".NETStandard2.0\">${EMGUCV_WINDOWS_NETSTANDARD_NUGET_DEPENDENCY}</group>
# <group targetFramework=\".NETCoreApp3.1\">${EMGUCV_WINDOWS_NETSTANDARD_NUGET_DEPENDENCY}</group>
# </dependencies>
# <frameworkAssemblies>
# <frameworkAssembly assemblyName=\"mscorlib\" targetFramework=\".NETFramework4.6.1\" />
# <frameworkAssembly assemblyName=\"System.Drawing\" targetFramework=\".NETFramework4.6.1\" />
# </frameworkAssemblies>")
IF(HAVE_ANDROID)
SET(EMGUCV_XAMARIN_ANDROID_NUGET_TITLE "Emgu CV for Xamarin Android Native Runtime")
SET(EMGUCV_XAMARIN_ANDROID_NUGET_FILE_LIST "
<file src=\"..\\..\\..\\libs\\Emgu.CV.Platform.Xamarin.Android.dll\" target=\"lib\\MonoAndroid50\" />
<file src=\"..\\..\\..\\libs\\Emgu.CV.Platform.Xamarin.Android.xml\" target=\"lib\\MonoAndroid50\" />")
SET(EMGUCV_XAMARIN_ANDROID_NUGET_FILE_LIST "${EMGUCV_XAMARIN_ANDROID_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"..\\..\\..\\${EMGUCV_LICENSE_FILE}\" target=\"\" />
<file src=\"README.md\" target=\"docs\\\" />")
SET(EMGUCV_XAMARIN_ANDROID_NUGET_DEPENDENCY "
<dependencies>
<group targetFramework=\"MonoAndroid5.0\">
<dependency id=\"${EMGUCV_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" />
</group>
</dependencies>")
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.xamarin.android.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.runtime.xamarin.android/Package.nuspec)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.xamarin.android.Package.README.md.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.runtime.xamarin.android/README.md)
SET(EMGUCV_MAUI_ANDROID_NUGET_TITLE "Emgu CV for MAUI Android Native Runtime")
# Sign and copy the binary
SET(EMGUCV_MAUI_ANDROID_POST_PROCESS_BINARY "<Target Name=\"PostProcessBinary\" AfterTargets=\"PostBuildEvent\">")
IF(EMGU_SIGN_FOUND AND WIN32)
file(TO_NATIVE_PATH ${EMGU_SIGN_EXECUTABLE} EMGU_SIGN_EXECUTABLE_NATIVE_PATH)
file(TO_NATIVE_PATH ${SIGNTOOL_EXECUTABLE} SIGNTOOL_EXECUTABLE_NATIVE_PATH)
SET(EMGUCV_MAUI_ANDROID_POST_PROCESS_BINARY "${EMGUCV_MAUI_ANDROID_POST_PROCESS_BINARY}
<Message Text=\"Signing $(OutputPath)$(AssemblyName).dll\" Importance=\"high\" />
<MakeDir Directories=\"$(OutputPath)\\signed\"/>
<Exec Command='${EMGU_SIGN_EXECUTABLE_NATIVE_PATH} \"$(OutputPath)$(AssemblyName).dll\" \"$(OutputPath)signed\" \"${SIGNTOOL_EXECUTABLE_NATIVE_PATH}\"' WorkingDirectory=\"$(OutputPath)\" />
")
ENDIF()
SET(EMGUCV_MAUI_ANDROID_POST_PROCESS_BINARY "${EMGUCV_MAUI_ANDROID_POST_PROCESS_BINARY}
<Message Text=\"Copying $(OutputPath)$(AssemblyName).dll, $(OutputPath)$(AssemblyName).xml to $(OpenCVBinaryDir)\" Importance=\"high\" />
<Copy SourceFiles=\"$(OutputPath)$(AssemblyName).dll\" DestinationFolder=\"$(OpenCVBinaryDir)\" ContinueOnError=\"true\" />
<Copy SourceFiles=\"$(OutputPath)$(AssemblyName).xml\" DestinationFolder=\"$(OpenCVBinaryDir)\" ContinueOnError=\"true\" />
</Target>")
# Sign the nuget package
SET(EMGUCV_MAUI_ANDROID_POST_PROCESS_NUGET "")
IF(EMGU_NUGET_SIGN_FOUND AND WIN32)
file(TO_NATIVE_PATH ${EMGU_NUGET_SIGN_EXECUTABLE} EMGU_NUGET_SIGN_EXECUTABLE_NATIVE_PATH)
file(TO_NATIVE_PATH ${NUGET_EXECUTABLE} NUGET_EXECUTABLE_NATIVE_PATH)
SET(EMGUCV_MAUI_ANDROID_POST_PROCESS_NUGET "${EMGUCV_MAUI_ANDROID_POST_PROCESS_NUGET}
<Target Name=\"PostProcessNuget\" AfterTargets=\"Pack\">
<Message Text=\"Signing $(PackageOutputPath)\\$(PackageId).$(PackageVersion).nupkg\" Importance=\"high\" />
<MakeDir Directories=\"$(PackageOutputPath)\\signed\"/>
<Exec Command='${EMGU_NUGET_SIGN_EXECUTABLE_NATIVE_PATH} \"$(PackageOutputPath)\\$(PackageId).$(PackageVersion).nupkg\" \"$(PackageOutputPath)\\signed\" \"${NUGET_EXECUTABLE_NATIVE_PATH}\"' WorkingDirectory=\"$(PackageOutputPath)\" />
</Target>
")
ENDIF()
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.maui.android.Directory.Build.props.in ${CMAKE_CURRENT_SOURCE_DIR}/Emgu.CV.Platform/Maui/Android/Directory.Build.props)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.maui.android.Package.README.md.in ${CMAKE_CURRENT_SOURCE_DIR}/Emgu.CV.Platform/Maui/Android/docs/README.md)
ENDIF()
IF(HAVE_IOS)
SET(EMGUCV_XAMARIN_IOS_NUGET_TITLE "Emgu CV for Xamarin iOS Native Runtime")
SET(EMGUCV_XAMARIN_IOS_NUGET_FILE_LIST "
<file src=\"..\\..\\..\\libs\\Emgu.CV.Platform.Xamarin.IOS.dll\" target=\"lib\\Xamarin.iOS10\" />
<file src=\"..\\..\\..\\libs\\Emgu.CV.Platform.Xamarin.IOS.XML\" target=\"lib\\Xamarin.iOS10\" />")
SET(EMGUCV_XAMARIN_IOS_NUGET_FILE_LIST "${EMGUCV_XAMARIN_IOS_NUGET_FILE_LIST}
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"..\\..\\..\\${EMGUCV_LICENSE_FILE}\" target=\"\" />
<file src=\"README.md\" target=\"docs\\\" />")
SET(EMGUCV_XAMARIN_IOS_NUGET_DEPENDENCY "
<dependencies>
<group targetFramework=\"Xamarin.iOS10\">
<dependency id=\"${EMGUCV_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" />
</group>
</dependencies>")
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.xamarin.ios.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.runtime.xamarin.ios/Package.nuspec)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.xamarin.ios.Package.README.md.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.runtime.xamarin.ios/README.md)
SET(EMGUCV_MAUI_IOS_NUGET_TITLE "Emgu CV for MAUI iOS Native Runtime")
SET(EMGUCV_MAUI_IOS_POST_PROCESS_BINARY "${EMGUCV_MAUI_IOS_POST_PROCESS_BINARY}
<Target Name=\"PostProcessBinary\" AfterTargets=\"PostBuildEvent\">
<Message Text=\"Copying $(OutputPath)$(AssemblyName).dll, $(OutputPath)$(AssemblyName).xml to $(OpenCVBinaryDir)\" Importance=\"high\" />
<Copy SourceFiles=\"$(OutputPath)$(AssemblyName).dll\" DestinationFolder=\"$(OpenCVBinaryDir)\" ContinueOnError=\"true\" />
<Copy SourceFiles=\"$(OutputPath)$(AssemblyName).xml\" DestinationFolder=\"$(OpenCVBinaryDir)\" ContinueOnError=\"true\" />
</Target>")
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.maui.ios.Directory.Build.props.in ${CMAKE_CURRENT_SOURCE_DIR}/Emgu.CV.Platform/Maui/iOS/Directory.Build.props)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.maui.ios.Package.README.md.in ${CMAKE_CURRENT_SOURCE_DIR}/Emgu.CV.Platform/Maui/iOS/docs/README.md)
ENDIF()
IF(HAVE_MACOS)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.xamarin.macos.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.runtime.xamarin.macos/Package.nuspec)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.macos.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.runtime.macos/Package.nuspec)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.macos.Package.README.md.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.runtime.macos/docs/README.md)
ENDIF()
IF(HAVE_MAUI)
SET(EMGUCV_MAUI_NUGET_ID "${EMGUCV_NUGET_ID}.runtime.maui${EMGUCV_RUNTIME_EXTRA_TAG}")
SET(EMGUCV_MAUI_NUGET_TITLE "Emgu CV for MAUI Native Runtime")
SET(EMGUCV_MAUI_NUGET_FILE_LIST "
<file src=\"..\\..\\..\\miscellaneous\\nuget_icon.png\" target=\"icon.png\" />
<file src=\"..\\..\\..\\libs\\${EMGUCV_MAUI_ANDROID_SRC_FOLDER}\\Emgu.CV.Platform.Maui.UI.dll\" target=\"lib\\${EMGUCV_MAUI_ANDROID_DST_FOLDER}\" />
<file src=\"..\\..\\..\\libs\\${EMGUCV_MAUI_ANDROID_SRC_FOLDER}\\Emgu.CV.Platform.Maui.UI.xml\" target=\"lib\\${EMGUCV_MAUI_ANDROID_DST_FOLDER}\" />
<file src=\"..\\..\\..\\libs\\${EMGUCV_MAUI_IOS_SRC_FOLDER}\\Emgu.CV.Platform.Maui.UI.dll\" target=\"lib\\${EMGUCV_MAUI_IOS_DST_FOLDER}\" />
<file src=\"..\\..\\..\\libs\\${EMGUCV_MAUI_IOS_SRC_FOLDER}\\Emgu.CV.Platform.Maui.UI.xml\" target=\"lib\\${EMGUCV_MAUI_IOS_DST_FOLDER}\" />
<file src=\"..\\..\\..\\libs\\${EMGUCV_MAUI_MACOS_SRC_FOLDER}\\Emgu.CV.Platform.Maui.UI.dll\" target=\"lib\\${EMGUCV_MAUI_MACOS_DST_FOLDER}\" />
<file src=\"..\\..\\..\\libs\\${EMGUCV_MAUI_MACOS_SRC_FOLDER}\\Emgu.CV.Platform.Maui.UI.xml\" target=\"lib\\${EMGUCV_MAUI_MACOS_DST_FOLDER}\" />
<file src=\"..\\..\\..\\libs\\${EMGUCV_MAUI_WINDOWS_SRC_FOLDER}\\Emgu.CV.Platform.Maui.UI.dll\" target=\"lib\\${EMGUCV_MAUI_WINDOWS_DST_FOLDER}\" />
<file src=\"..\\..\\..\\libs\\${EMGUCV_MAUI_WINDOWS_SRC_FOLDER}\\Emgu.CV.Platform.Maui.UI.xml\" target=\"lib\\${EMGUCV_MAUI_WINDOWS_DST_FOLDER}\" />
<file src=\"README.md\" target=\"docs\\\" />
<file src=\"..\\..\\..\\${EMGUCV_LICENSE_FILE}\" target=\"\" />")
SET(EMGUCV_MAUI_NUGET_DEPENDENCY "
<dependencies>
<group targetFramework=\"${EMGUCV_MAUI_ANDROID_DST_FOLDER}\">
<dependency id=\"${EMGUCV_MAUI_ANDROID_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" exclude=\"Build,Analyzers\" />
<dependency id=\"${EMGUCV_MODELS_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" exclude=\"Build,Analyzers\" />
<dependency id=\"System.Drawing.Primitives\" version=\"4.3.0\" exclude=\"Build,Analyzers\" />
<dependency id=\"System.Runtime.InteropServices\" version=\"4.3.0\" exclude=\"Build,Analyzers\" />
</group>
<group targetFramework=\"${EMGUCV_MAUI_IOS_DST_FOLDER}\">
<dependency id=\"${EMGUCV_MAUI_IOS_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" exclude=\"Build,Analyzers\" />
<dependency id=\"${EMGUCV_MODELS_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" exclude=\"Build,Analyzers\" />
<dependency id=\"System.Drawing.Primitives\" version=\"4.3.0\" exclude=\"Build,Analyzers\" />
<dependency id=\"System.Runtime.InteropServices\" version=\"4.3.0\" exclude=\"Build,Analyzers\" />
</group>
<group targetFramework=\"${EMGUCV_MAUI_MACOS_DST_FOLDER}\">
<dependency id=\"${EMGUCV_MODELS_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" exclude=\"Build,Analyzers\" />
<dependency id=\"${EMGUCV_MAUI_MACOS_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" exclude=\"Build,Analyzers\" />
<dependency id=\"System.Drawing.Primitives\" version=\"4.3.0\" exclude=\"Build,Analyzers\" />
<dependency id=\"System.Runtime.InteropServices\" version=\"4.3.0\" exclude=\"Build,Analyzers\" />
</group>
<group targetFramework=\"${EMGUCV_MAUI_WINDOWS_DST_FOLDER}\">
<dependency id=\"${EMGUCV_WINDOWS_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" exclude=\"Build,Analyzers\" />
<dependency id=\"${EMGUCV_MODELS_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" exclude=\"Build,Analyzers\" />
<dependency id=\"${EMGUCV_BITMAP_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" exclude=\"Build,Analyzers\" />
<dependency id=\"${EMGUCV_WPF_NUGET_ID}\" version=\"${CPACK_PACKAGE_DEPENDENCY_VERSION}\" exclude=\"Build,Analyzers\" />
<dependency id=\"System.Drawing.Primitives\" version=\"4.3.0\" exclude=\"Build,Analyzers\" />
<dependency id=\"System.Runtime.InteropServices\" version=\"4.3.0\" exclude=\"Build,Analyzers\" />
<dependency id=\"System.Runtime.InteropServices.WindowsRuntime\" version=\"4.3.0\" exclude=\"Build,Analyzers\" />
</group>
</dependencies>")
# Sign and copy the binary
SET(EMGUCV_MAUI_POST_PROCESS_BINARY "
<!--
<PropertyGroup>
<OutputFullPath>$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)$(OutputPath)))</OutputFullPath>
</PropertyGroup>
-->
<Target Name=\"PostProcessBinary\" AfterTargets=\"PostBuildEvent\">")
IF(EMGU_SIGN_FOUND AND WIN32)
file(TO_NATIVE_PATH ${EMGU_SIGN_EXECUTABLE} EMGU_SIGN_EXECUTABLE_NATIVE_PATH)
file(TO_NATIVE_PATH ${SIGNTOOL_EXECUTABLE} SIGNTOOL_EXECUTABLE_NATIVE_PATH)
SET(EMGUCV_MAUI_POST_PROCESS_BINARY "${EMGUCV_MAUI_POST_PROCESS_BINARY}
<Message Text=\"Signing $(MSBuildThisFileDirectory)$(OutputPath)$(AssemblyName).dll\" Importance=\"high\" />
<MakeDir Directories=\"$(MSBuildThisFileDirectory)$(OutputPath)\\signed\"/>
<Exec Command='${EMGU_SIGN_EXECUTABLE_NATIVE_PATH} \"$(MSBuildThisFileDirectory)$(OutputPath)$(AssemblyName).dll\" \"$(MSBuildThisFileDirectory)$(OutputPath)\\signed\" \"${SIGNTOOL_EXECUTABLE_NATIVE_PATH}\"' WorkingDirectory=\"$(MSBuildThisFileDirectory)$(OutputPath)\" />
")
ENDIF()
SET(EMGUCV_MAUI_POST_PROCESS_BINARY "${EMGUCV_MAUI_POST_PROCESS_BINARY}
<Message Text=\"Copying $(MSBuildThisFileDirectory)$(OutputPath)$(AssemblyName).dll, $(MSBuildThisFileDirectory)$(OutputPath)$(AssemblyName).xml to $(OpenCVBinaryDir)\\$(TargetFramework)\" Importance=\"high\" />
<Copy SourceFiles=\"$(MSBuildThisFileDirectory)$(OutputPath)$(AssemblyName).dll\" DestinationFolder=\"$(OpenCVBinaryDir)\\$(TargetFramework)\" ContinueOnError=\"true\" />
<Copy SourceFiles=\"$(MSBuildThisFileDirectory)$(OutputPath)$(AssemblyName).xml\" DestinationFolder=\"$(OpenCVBinaryDir)\\$(TargetFramework)\" ContinueOnError=\"true\" />
</Target>")
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.Platform.Maui.UI.Directory.Build.props.in ${CMAKE_CURRENT_SOURCE_DIR}/Emgu.CV.Platform/Maui/UI/Directory.Build.props)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.maui.Package.README.md.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.runtime.maui/README.md)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.maui.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.runtime.maui/Package.nuspec)
ENDIF()
IF(HAVE_WINSTORE_10)
SET(EMGUCV_UWP_NUGET_TITLE "Emgu CV for UWP Native Runtime")
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.uwp.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.runtime.uwp/Package.nuspec)
ENDIF()
IF(HAVE_WINDESKTOP_X86)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/${EMGU_WINDOWS_MSVCRT_X86_NUGET_ID}.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/${EMGU_WINDOWS_MSVCRT_X86_NUGET_ID}/Package.nuspec)
ENDIF()
IF(HAVE_WINDESKTOP_X64)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/${EMGU_WINDOWS_MSVCRT_X64_NUGET_ID}.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/${EMGU_WINDOWS_MSVCRT_X64_NUGET_ID}/Package.nuspec)
ENDIF()
IF(HAVE_WINDESKTOP_ARM64)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/${EMGU_WINDOWS_MSVCRT_ARM64_NUGET_ID}.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/${EMGU_WINDOWS_MSVCRT_ARM64_NUGET_ID}/Package.nuspec)
ENDIF()
IF(HAVE_WINDESKTOP_X86 OR HAVE_WINDESKTOP_X64 OR HAVE_WINDESKTOP_ARM64)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.windows.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.runtime.windows/Package.nuspec)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.windows.Package.README.md.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.runtime.windows/README.md)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.UI.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.UI/Package.nuspec)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.UI.Package.README.md.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.UI/README.md)
ENDIF()
IF(HAVE_LINUX_ARM)
SET(EMGUCV_DEBIAN_ARM_NUGET_TITLE "Emgu CV Native ARM Runtime for Debian (including Raspberry Pi OS)")
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.debian-arm.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.runtime.debian-arm/Package.nuspec)
ENDIF()
IF(HAVE_LINUX_ARM64)
SET(EMGUCV_DEBIAN_ARM64_NUGET_TITLE "Emgu CV Native ARM64 Runtime for Debian (including Raspberry Pi OS)")
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.debian-arm64.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.runtime.debian-arm64/Package.nuspec)
ENDIF()
IF(HAVE_UBUNTU_X86 OR HAVE_UBUNTU_X64 OR HAVE_UBUNTU_ARM64)
SET(EMGUCV_UBUNTU_NUGET_TITLE "Emgu CV Native Runtime for Ubuntu")
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.ubuntu.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.runtime.ubuntu/Package.nuspec)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.ubuntu.Package.README.md.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.runtime.ubuntu/README.md)
ENDIF()
IF(HAVE_RHEL_X86 OR HAVE_RHEL_X64 OR HAVE_RHEL_ARM64)
SET(EMGUCV_RHEL_NUGET_TITLE "Emgu CV Native Runtime for RHEL")
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.rhel.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.runtime.rhel/Package.nuspec)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.runtime.rhel.Package.README.md.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.runtime.rhel/README.md)
ENDIF()
SET(EMGUCV_NUGET_TITLE "Emgu CV")
SET(EMGUCV_NUGET_SUMMARY "Emgu CV is a cross platform .Net wrapper to the OpenCV image processing library.")
IF ("${LICENSE_TYPE}" STREQUAL "Commercial")
SET(EMGUCV_NUGET_TITLE "${EMGUCV_NUGET_TITLE} Commercial Release")
SET(EMGUCV_NUGET_SUMMARY "${EMGUCV_NUGET_SUMMARY} This is the commercial release.")
IF(HAVE_ANDROID)
SET(EMGUCV_XAMARIN_ANDROID_NUGET_TITLE "${EMGUCV_XAMARIN_ANDROID_NUGET_TITLE} Commercial Release for Xamarin")
SET(EMGUCV_MAUI_ANDROID_NUGET_TITLE "${EMGUCV_MAUI_ANDROID_NUGET_TITLE} Commercial Release for MAUI")
ENDIF()
IF(HAVE_WINSTORE_10)
SET(EMGUCV_UWP_NUGET_TITLE "${EMGUCV_UWP_NUGET_TITLE} Commercial Release")
ENDIF()
ENDIF()
# Sign and copy the binary
SET(EMGUCV_POST_PROCESS_BINARY "<Target Name=\"PostProcessBinary\" AfterTargets=\"PostBuildEvent\">")
IF(EMGU_SIGN_FOUND AND WIN32)
file(TO_NATIVE_PATH ${EMGU_SIGN_EXECUTABLE} EMGU_SIGN_EXECUTABLE_NATIVE_PATH)
file(TO_NATIVE_PATH ${SIGNTOOL_EXECUTABLE} SIGNTOOL_EXECUTABLE_NATIVE_PATH)
SET(EMGUCV_POST_PROCESS_BINARY "${EMGUCV_POST_PROCESS_BINARY}
<Message Text=\"Signing $(OutputPath)$(AssemblyName).dll\" Importance=\"high\" />
<MakeDir Directories=\"$(OutputPath)\\signed\"/>
<Exec Command='${EMGU_SIGN_EXECUTABLE_NATIVE_PATH} \"$(OutputPath)$(AssemblyName).dll\" \"$(OutputPath)signed\" \"${SIGNTOOL_EXECUTABLE_NATIVE_PATH}\"' WorkingDirectory=\"$(OutputPath)\" />
")
ENDIF()
SET(EMGUCV_IOS_POST_PROCESS_BINARY "${EMGUCV_POST_PROCESS_BINARY}")
SET(EMGUCV_POST_PROCESS_BINARY "${EMGUCV_POST_PROCESS_BINARY}
<Message Text=\"Copying $(OutputPath)$(AssemblyName).dll, $(OutputPath)$(AssemblyName).xml to $(OpenCVBinaryDir)\" Importance=\"high\" />
<Copy SourceFiles=\"$(OutputPath)$(AssemblyName).dll\" DestinationFolder=\"$(OpenCVBinaryDir)\" ContinueOnError=\"true\" />
<Copy SourceFiles=\"$(OutputPath)$(AssemblyName).xml\" DestinationFolder=\"$(OpenCVBinaryDir)\" ContinueOnError=\"true\" />
</Target>")
SET(EMGUCV_IOS_POST_PROCESS_BINARY "${EMGUCV_IOS_POST_PROCESS_BINARY}
<Message Text=\"Copying $(OutputPath)$(AssemblyName).dll, $(OutputPath)$(AssemblyName).xml to $([System.IO.Path]::Combine($(OpenCVBinaryDir),'iOS'))\" Importance=\"high\" />
<Copy SourceFiles=\"$(OutputPath)$(AssemblyName).dll\" DestinationFolder=\"$([System.IO.Path]::Combine($(OpenCVBinaryDir),'iOS'))\" ContinueOnError=\"true\" />
<Copy SourceFiles=\"$(OutputPath)$(AssemblyName).xml\" DestinationFolder=\"$([System.IO.Path]::Combine($(OpenCVBinaryDir),'iOS'))\" ContinueOnError=\"true\" />
</Target>")
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.Platform.NetStandard.Directory.Build.props.in ${CMAKE_CURRENT_SOURCE_DIR}/Emgu.CV.Platform/NetStandard/Directory.Build.props)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.Platform.NetStandard.IOS.Directory.Build.props.in ${CMAKE_CURRENT_SOURCE_DIR}/Emgu.CV.Platform/NetStandard_iOS/Directory.Build.props)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.Platform.NetStandard.Directory.Build.props.in ${CMAKE_CURRENT_SOURCE_DIR}/Emgu.CV.Models/Emgu.CV.Models.NetStandard/Directory.Build.props)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.Platform.NetStandard.IOS.Directory.Build.props.in ${CMAKE_CURRENT_SOURCE_DIR}/Emgu.CV.Models/Emgu.CV.Models.IOS/Directory.Build.props)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.Platform.NetStandard.Directory.Build.props.in ${CMAKE_CURRENT_SOURCE_DIR}/Emgu.CV.Platform/DotNet/Core/Directory.Build.props)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.Platform.NetStandard.Directory.Build.props.in ${CMAKE_CURRENT_SOURCE_DIR}/Emgu.CV.Platform/DotNet/Framework/Directory.Build.props)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.Platform.NetStandard.Directory.Build.props.in ${CMAKE_CURRENT_SOURCE_DIR}/Emgu.CV.Platform/Emgu.CV.Wpf/Directory.Build.props)
#generate nuget config file for Emgu.CV
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV/Package.nuspec)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.Package.README.md.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV/README.md)
#generate nuget config file for Emgu.CV.Bitmap
# Sign and copy the binary
SET(EMGUCV_BITMAP_POST_PROCESS_BINARY "<Target Name=\"PostProcessBinary\" AfterTargets=\"PostBuildEvent\">")
IF(EMGU_SIGN_FOUND AND WIN32)
file(TO_NATIVE_PATH ${EMGU_SIGN_EXECUTABLE} EMGU_SIGN_EXECUTABLE_NATIVE_PATH)
file(TO_NATIVE_PATH ${SIGNTOOL_EXECUTABLE} SIGNTOOL_EXECUTABLE_NATIVE_PATH)
SET(EMGUCV_BITMAP_POST_PROCESS_BINARY "${EMGUCV_BITMAP_POST_PROCESS_BINARY}
<Message Text=\"Signing $(OutputPath)$(AssemblyName).dll\" Importance=\"high\" />
<MakeDir Directories=\"$(OutputPath)\\signed\"/>
<Exec Command='${EMGU_SIGN_EXECUTABLE_NATIVE_PATH} \"$(OutputPath)$(AssemblyName).dll\" \"$(OutputPath)signed\" \"${SIGNTOOL_EXECUTABLE_NATIVE_PATH}\"' WorkingDirectory=\"$(OutputPath)\" />
")
ENDIF()
SET(EMGUCV_BITMAP_POST_PROCESS_BINARY "${EMGUCV_BITMAP_POST_PROCESS_BINARY}
<Message Text=\"Copying $(OutputPath)$(AssemblyName).dll, $(OutputPath)$(AssemblyName).xml to $(OpenCVBinaryDir)\" Importance=\"high\" />
<Copy SourceFiles=\"$(OutputPath)$(AssemblyName).dll\" DestinationFolder=\"$(OpenCVBinaryDir)\" ContinueOnError=\"true\" />
<Copy SourceFiles=\"$(OutputPath)$(AssemblyName).xml\" DestinationFolder=\"$(OpenCVBinaryDir)\" ContinueOnError=\"true\" />
</Target>")
# Sign the nuget package
SET(EMGUCV_BITMAP_POST_PROCESS_NUGET "")
IF(EMGU_NUGET_SIGN_FOUND AND WIN32)
file(TO_NATIVE_PATH ${EMGU_NUGET_SIGN_EXECUTABLE} EMGU_NUGET_SIGN_EXECUTABLE_NATIVE_PATH)
file(TO_NATIVE_PATH ${NUGET_EXECUTABLE} NUGET_EXECUTABLE_NATIVE_PATH)
SET(EMGUCV_BITMAP_POST_PROCESS_NUGET "${EMGUCV_BITMAP_POST_PROCESS_NUGET}
<Target Name=\"PostProcessNuget\" AfterTargets=\"Pack\">
<Message Text=\"Signing $(PackageOutputPath)\\$(PackageId).$(PackageVersion).nupkg\" Importance=\"high\" />
<MakeDir Directories=\"$(PackageOutputPath)\\signed\"/>
<Exec Command='${EMGU_NUGET_SIGN_EXECUTABLE_NATIVE_PATH} \"$(PackageOutputPath)\\$(PackageId).$(PackageVersion).nupkg\" \"$(PackageOutputPath)\\signed\" \"${NUGET_EXECUTABLE_NATIVE_PATH}\"' WorkingDirectory=\"$(PackageOutputPath)\" />
</Target>
")
ENDIF()
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.Bitmap.Directory.Build.props.in ${CMAKE_CURRENT_SOURCE_DIR}/Emgu.CV.Platform/Emgu.CV.Bitmap/Directory.Build.props)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.Bitmap.Package.README.md.in ${CMAKE_CURRENT_SOURCE_DIR}/Emgu.CV.Platform/Emgu.CV.Bitmap/docs/README.md)
#generate nuget config file for Emgu.CV.Wpf
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.Wpf.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.Wpf/Package.nuspec)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.Wpf.Package.README.md.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.Wpf/README.md)
#generate nuget config file for Emgu.CV.Models
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.Models.Package.nuspec.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.Models/Package.nuspec)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Emgu.CV.Models.Package.README.md.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/nuget/Emgu.CV.Models/README.md)
#CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/component.yaml.in ${CMAKE_CURRENT_SOURCE_DIR}/platforms/xamarin/emgucv_v3/component/component.yaml)
#CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Example.Android.AndroidManifest.xml.in ${CMAKE_CURRENT_SOURCE_DIR}/Emgu.CV.Example/Android/Properties/AndroidManifest.xml @ONLY)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/XamarinForms.Android.AndroidManifest.xml.in ${CMAKE_CURRENT_SOURCE_DIR}/Emgu.CV.Example/XamarinForms/Android/Properties/AndroidManifest.xml @ONLY)
# ----------------------------------------------------------------------------
# Generate readme file for Emgu CV project
# ----------------------------------------------------------------------------
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/README.txt.in ${CMAKE_CURRENT_SOURCE_DIR}/Emgu.CV/README.txt)
INSTALL(FILES "${CMAKE_CURRENT_SOURCE_DIR}/Emgu.CV/README.txt" DESTINATION "." COMPONENT libs)
# ----------------------------------------------------------------------------
# Generate CvInvokeEntryPoints.cs file for Emgu CV project
# ----------------------------------------------------------------------------
SET(OPENCV_LIBRARY_OUTPUT_NAME_PREFIX "")
IF (APPLE)
SET(OPENCV_LIBRARY_OUTPUT_NAME_POSTFIX ".${OPENCV_VERSION_MAJOR}.${OPENCV_VERSION_MINOR}.${OPENCV_VERSION_PATCH}")
ELSE()
SET(OPENCV_LIBRARY_OUTPUT_NAME_POSTFIX "")
ENDIF()
SET(OPENCV_LIBRARY_OUTPUT_NAMES )
FOREACH(OPENCV_MODULE_NAME ${OPENCV_MODULE_NAME_CANDIDATES})
STRING (TOUPPER "${OPENCV_MODULE_NAME}" OPENCV_MODULE_NAME_UPPER)
STRING (SUBSTRING "${OPENCV_MODULE_NAME}" 0 1 OPENCV_MODULE_NAME_FIRST_LETTER)
STRING (TOUPPER "${OPENCV_MODULE_NAME_FIRST_LETTER}" OPENCV_MODULE_NAME_FIRST_LETTER_UPPER)
STRING (SUBSTRING "${OPENCV_MODULE_NAME}" 1 -1 OPENCV_MODULE_NAME_REMAINDER)
SET(OPENCV_MODULE_NAME_FIRST_LETTER_UPPER "${OPENCV_MODULE_NAME_FIRST_LETTER_UPPER}${OPENCV_MODULE_NAME_REMAINDER}")
SET(OPENCV_OUTPUT_PROJ_TYPE "")
IF(NOT (TARGET opencv_${OPENCV_MODULE_NAME}))
SET(OPENCV_${OPENCV_MODULE_NAME_UPPER}_OUTPUT_NAME "")
ELSE()
#MESSAGE( STATUS "opencv_${OPENCV_MODULE_NAME} type: ${OPENCV_OUTPUT_PROJ_TYPE}")
GET_TARGET_PROPERTY(OPENCV_OUTPUT_PROJ_TYPE opencv_${OPENCV_MODULE_NAME} TYPE)
IF(NOT ("${OPENCV_OUTPUT_PROJ_TYPE}" STREQUAL "SHARED_LIBRARY"))
SET(OPENCV_${OPENCV_MODULE_NAME_UPPER}_OUTPUT_NAME "")
ELSE()
GET_TARGET_PROPERTY(OPENCV_OUTPUT_NAME_TMP opencv_${OPENCV_MODULE_NAME} OUTPUT_NAME)
SET(OPENCV_${OPENCV_MODULE_NAME_UPPER}_OUTPUT_NAME ${OPENCV_LIBRARY_OUTPUT_NAME_PREFIX}${OPENCV_OUTPUT_NAME_TMP}${OPENCV_LIBRARY_OUTPUT_NAME_POSTFIX})
LIST(APPEND OPENCV_LIBRARY_OUTPUT_NAMES ${OPENCV_${OPENCV_MODULE_NAME_UPPER}_OUTPUT_NAME})
SET(ENTRYPOINT_MODULES_STRING "${ENTRYPOINT_MODULES_STRING}
Opencv${OPENCV_MODULE_NAME_FIRST_LETTER_UPPER}Library,")
ENDIF()
ENDIF()
IF(IOS)
SET(ENTRYPOINT_CS_STRING "${ENTRYPOINT_CS_STRING}
/// <summary>
/// The file name of the ${OPENCV_MODULE_NAME} library
/// </summary>
public const string Opencv${OPENCV_MODULE_NAME_FIRST_LETTER_UPPER}Library = \"__Internal\";")
ELSEIF(((WIN32 AND NOT ANDROID) OR APPLE))
IF(("${OPENCV_OUTPUT_PROJ_TYPE}" STREQUAL "SHARED_LIBRARY"))
SET(ANDROID_ENTRYPOINT "opencv_${OPENCV_MODULE_NAME}")
SET(MACOS_ENTRYPOINT "opencv_${OPENCV_MODULE_NAME}.${OPENCV_VERSION_MAJOR}.${OPENCV_VERSION_MINOR}.${OPENCV_VERSION_PATCH}")
SET(MACOS_UNITY_STANDALONE_ENTRYPOINT "@executable_path/../Plugins/emgucv.bundle/Contents/MacOS/lib${MACOS_ENTRYPOINT}.dylib")
SET(MACOS_UNITY_EDITOR_ENTRYPOINT "Assets/Plugins/emgucv.bundle/Contents/MacOS/lib${MACOS_ENTRYPOINT}.dylib")
SET(WINDOWS_ENTRYPOINT "opencv_${OPENCV_MODULE_NAME}${OPENCV_VERSION_MAJOR}${OPENCV_VERSION_MINOR}${OPENCV_VERSION_PATCH}")
SET(IOS_ENTRYPOINT "__Internal")
IF("${OPENCV_${OPENCV_MODULE_NAME_UPPER}_OUTPUT_NAME}" STREQUAL "")
SET(ANDROID_ENTRYPOINT "")
SET(MACOS_ENTRYPOINT "")
SET(MACOS_UNITY_ENTRYPOINT "emgucv")
SET(WINDOWS_ENTRYPOINT "")
SET(IOS_ENTRYPOINT "")
ENDIF()
SET(ENTRYPOINT_CS_STRING "${ENTRYPOINT_CS_STRING}
/// <summary>
/// The file name of the ${OPENCV_MODULE_NAME} library
/// </summary>
#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
public const string Opencv${OPENCV_MODULE_NAME_FIRST_LETTER_UPPER}Library = \"${WINDOWS_ENTRYPOINT}\";
#elif UNITY_EDITOR_OSX
public const string Opencv${OPENCV_MODULE_NAME_FIRST_LETTER_UPPER}Library = \"${MACOS_UNITY_EDITOR_ENTRYPOINT}\";
#elif UNITY_STANDALONE_OSX
public const string Opencv${OPENCV_MODULE_NAME_FIRST_LETTER_UPPER}Library = \"${MACOS_UNITY_STANDALONE_ENTRYPOINT}\";
#elif __IOS__ || UNITY_IPHONE || UNITY_WEBGL
public const string Opencv${OPENCV_MODULE_NAME_FIRST_LETTER_UPPER}Library = \"${IOS_ENTRYPOINT}\";
#elif __ANDROID__ || UNITY_ANDROID
public const string Opencv${OPENCV_MODULE_NAME_FIRST_LETTER_UPPER}Library = \"${ANDROID_ENTRYPOINT}\";
#else
public const string Opencv${OPENCV_MODULE_NAME_FIRST_LETTER_UPPER}Library = \"${OPENCV_${OPENCV_MODULE_NAME_UPPER}_OUTPUT_NAME}\";
#endif
")
ENDIF()
ELSE()
IF("${OPENCV_OUTPUT_PROJ_TYPE}" STREQUAL "SHARED_LIBRARY")
SET(ENTRYPOINT_CS_STRING "${ENTRYPOINT_CS_STRING}
/// <summary>
/// The file name of the ${OPENCV_MODULE_NAME} library
/// </summary>
public const string Opencv${OPENCV_MODULE_NAME_FIRST_LETTER_UPPER}Library = \"${OPENCV_${OPENCV_MODULE_NAME_UPPER}_OUTPUT_NAME}\";")
ENDIF()
ENDIF()
ENDFOREACH()
SET(ENTRYPOINT_MODULES_STRING "public static List<String> OpenCVModuleList = new List<String>
{
#if !(__ANDROID__ || __IOS__ || UNITY_IPHONE || UNITY_WEBGL || UNITY_ANDROID || NETFX_CORE)
OpencvFFMpegLibrary,
#endif
${ENTRYPOINT_MODULES_STRING}
ExternLibrary
};
")
GET_TARGET_PROPERTY(CVEXTERN_OUTPUT_NAME cvextern OUTPUT_NAME)
LIST(APPEND OPENCV_LIBRARY_OUTPUT_NAMES ${CVEXTERN_OUTPUT_NAME})
if(WIN32 AND WITH_FFMPEG)
if(TARGET_ARCH_64)
set(FFMPEG_SUFFIX _64)
endif()
#STRING(LENGTH "${OPENCV_CORE_OUTPUT_NAME}" temp)
#MATH(EXPR temp "${temp}-3")
#STRING(SUBSTRING ${OPENCV_CORE_OUTPUT_NAME} ${temp} -1 OPENCV_DLLVERSION)
set(OPENCV_FFMPEG_OUTPUT_NAME "opencv_videoio_ffmpeg${OPENCV_VERSION_MAJOR}${OPENCV_VERSION_MINOR}${OPENCV_VERSION_PATCH}${FFMPEG_SUFFIX}")
#set(OPENCV_FFMPEG_OUTPUT_NAME "opencv_ffmpeg${FFMPEG_SUFFIX}")
MESSAGE(STATUS "OPENCV_FFMPEG_OUTPUT_NAME: ${OPENCV_FFMPEG_OUTPUT_NAME}")
LIST(APPEND OPENCV_LIBRARY_OUTPUT_NAMES ${OPENCV_FFMPEG_OUTPUT_NAME})
endif()
IF(TARGET_ARCH_64)
SET(UNMANAGED_CODE_BITNESS "64")
ELSE()
SET(UNMANAGED_CODE_BITNESS "32")
ENDIF()
#IF(ANDROID)
# SET(CVINVOKE_ENTRYPOINTS_FILE_SUBFOLDER "Android/")
#ELSE()
SET(CVINVOKE_ENTRYPOINTS_FILE_SUBFOLDER "")
#ENDIF()
IF(IOS)
SET(CVEXTERN_OUTPUT_NAME "__Internal")
ENDIF()
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/CvInvokeEntryPoints.cs.in ${CMAKE_CURRENT_SOURCE_DIR}/Emgu.CV/PInvoke/${CVINVOKE_ENTRYPOINTS_FILE_SUBFOLDER}CvInvokeEntryPoints.cs)
# ----------------------------------------------------------------------------
# Build the managed dlls of Emgu CV
# ----------------------------------------------------------------------------
ADD_SUBDIRECTORY(Emgu.Util)
ADD_SUBDIRECTORY(Emgu.CV)
ADD_SUBDIRECTORY(Emgu.CV.Platform)
ADD_SUBDIRECTORY(Emgu.CV.Example)
ADD_SUBDIRECTORY(Emgu.CV.Test)
ADD_SUBDIRECTORY(Emgu.CV.Cuda)
IF (EMGU_CV_WITH_TESSERACT)
ADD_SUBDIRECTORY(Emgu.CV.OCR)
ENDIF()
ADD_SUBDIRECTORY(Emgu.CV.Contrib)
ADD_SUBDIRECTORY(Emgu.CV.Runtime)
ADD_SUBDIRECTORY(Emgu.CV.Models)
ADD_SUBDIRECTORY(platforms/nuget)
INSTALL(
FILES
"opencv/LICENSE"
DESTINATION "lib"
COMPONENT emgucv_example_source
RENAME "opencv.license.txt"
)
IF(HAVE_ANDROID)
INSTALL(
FILES
"Solution/Android/Emgu.CV.Android.Example.sln"
"Solution/Android/Emgu.CV.Android.sln"
DESTINATION "Solution/Android"
COMPONENT emgucv_example_source
)
ENDIF()
IF(HAVE_IOS)
INSTALL(
FILES
"Solution/iOS/Emgu.CV.iOS.Example.sln"
"Solution/iOS/Emgu.CV.iOS.Xamarin.sln"
"Solution/iOS/Emgu.CV.iOS.Maui.sln"
DESTINATION "Solution/iOS"
COMPONENT emgucv_example_source
)
ENDIF()
IF(HAVE_MACOS)
INSTALL(
FILES
"Solution/Mac/Emgu.CV.Mac.Example.sln"
"Solution/Mac/Emgu.CV.Mac.Xamarin.sln"
DESTINATION "Solution/Mac"
COMPONENT emgucv_example_source
)
IF (NOT IS_MACOS_BUILD)
INSTALL(
FILES
"libs/runtimes/osx/native/libcvextern.dylib"
DESTINATION "libs/runtimes/osx/native"
COMPONENT emgucv_binary
)
ENDIF()
ENDIF()
IF(HAVE_MAC_CATALYST)
INSTALL(
FILES
"Solution/Mac/Emgu.CV.Mac.Maui.sln"
DESTINATION "Solution/Mac"
COMPONENT emgucv_example_source
)
IF (HAVE_MAC_CATALYST_ARM64)
INSTALL(
FILES
"libs/iOS/libcvextern_catalyst_arm64.a"
DESTINATION "libs/iOS"
COMPONENT emgucv_binary
)
ENDIF()
IF (HAVE_MAC_CATALYST_X86_64)
INSTALL(
FILES
"libs/iOS/libcvextern_catalyst_x86_64.a"
DESTINATION "libs/iOS"
COMPONENT emgucv_binary
)
ENDIF()
ENDIF()
IF(IS_PRO_BUILD)
INSTALL(
FILES
"Solution/CrossPlatform/Emgu.CV.CrossPlatform.sln"
"Solution/CrossPlatform/Emgu.CV.sln"
DESTINATION "Solution/CrossPlatform"
COMPONENT emgucv_example_source
)
ENDIF()
INSTALL(
FILES
"${CMAKE_CURRENT_SOURCE_DIR}/Emgu.CV.snk"
"${CMAKE_CURRENT_SOURCE_DIR}/CommonAssemblyInfo.cs"
"${CMAKE_CURRENT_SOURCE_DIR}/Directory.Build.props"
"${CMAKE_CURRENT_SOURCE_DIR}/${LICENSE_FILE_NAME}"
#"${CMAKE_CURRENT_SOURCE_DIR}/nuget.config"
#"${CMAKE_CURRENT_SOURCE_DIR}/components.config"
DESTINATION .
COMPONENT emgucv_source
)
IF (EMGU_CV_WITH_FREETYPE)
IF (ANDROID)
#INSTALL(EXPORT freetype DESTINATION lib)
ENDIF()
ENDIF()
IF (ANDROID)
SET(CPACK_GENERATOR ZIP)
ELSEIF (WIN32)
IF(NETFX_CORE)
SET(CPACK_GENERATOR ZIP)
ELSE()
#SET(CPACK_GENERATOR ZIP)
SET(CPACK_GENERATOR NSIS;ZIP)
ENDIF()
SET(CPACK_ARCHIVE_COMPONENT_INSTALL ON) #enable components install for zip
IF(CPACK_GENERATOR MATCHES "ZIP")
SET(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1)
ENDIF()
SET(CPACK_NSIS_MODIFY_PATH OFF)
SET(CPACK_NSIS_INSTALL_ROOT "C:\\\\Emgu")
IF(NOT NETFX_CORE)
ADD_SUBDIRECTORY(Emgu.CV.DebuggerVisualizers)
ENDIF()
IF(NOT NETFX_CORE)
if(WITH_FFMPEG)
INSTALL(
FILES
"${UNMANAGED_LIBRARY_OUTPUT_PATH}/${OPENCV_FFMPEG_OUTPUT_NAME}.dll"
DESTINATION "libs/${UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER}/"
COMPONENT libs
)
endif()
# ----------------------------------------------------------------------------
# Install Debugger Visualizer
# ----------------------------------------------------------------------------
#Find the x86 binary for VS2019 or earlier
SET (HAS_WINDESKTOP_X86_NATIVE_BINARY OFF)
IF (IS_WINDESKTOP_X86_BUILD)
FOREACH(tmp_component ${OPENCV_LIBRARY_OUTPUT_NAMES})
LIST(APPEND UNMANAGED_DLL_32BIT "${UNMANAGED_LIBRARY_OUTPUT_PATH}/${tmp_component}.dll")
ENDFOREACH()
FOREACH(tmp_component ${CVEXTERN_DEPENDENCY_DLL_NAMES})
LIST(APPEND UNMANAGED_DLL_32BIT "${UNMANAGED_LIBRARY_OUTPUT_PATH}/${tmp_component}.dll")
ENDFOREACH()
LIST(REMOVE_DUPLICATES UNMANAGED_DLL_32BIT)
SET (HAS_WINDESKTOP_X86_NATIVE_BINARY ON)
IF (${UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER} MATCHES "^$")
SET(DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES_SUBFOLDER "")
ELSE()
#MESSAGE(STATUS "UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER: ${UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER}")
#remove leading slashes
STRING(REGEX REPLACE "^/" "" DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES_SUBFOLDER ${UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER})
#add tailing slashes
SET(DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES_SUBFOLDER "${DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES_SUBFOLDER}\\")
#replace single slashes with quard slashes
STRING(REGEX REPLACE "\\\\" "\\\\\\\\" DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES_SUBFOLDER ${DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES_SUBFOLDER})
#MESSAGE(STATUS "DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES_SUBFOLDER: ${DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES_SUBFOLDER}")
ENDIF()
ELSE()
FILE(GLOB UNMANAGED_DLL_32BIT "${CMAKE_CURRENT_SOURCE_DIR}/libs/runtimes/win-x86/native/*.dll")
LIST(LENGTH UNMANAGED_DLL_32BIT UNMANAGED_DLL_32BIT_LENGTH)
IF(UNMANAGED_DLL_32BIT_LENGTH GREATER 0)
SET(HAS_WINDESKTOP_X86_NATIVE_BINARY ON)
SET(DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES_SUBFOLDER "runtimes\\\\win-x86\\\\native\\\\")
ENDIF()
ENDIF()
SET(DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES_DEPLOY_SUBFOLDER "runtimes\\\\win-x86\\\\native\\\\")
MESSAGE(STATUS "HAS_WINDESKTOP_X86_NATIVE_BINARY: ${HAS_WINDESKTOP_X86_NATIVE_BINARY}")
#FOREACH (file ${UNMANAGED_DLL_32BIT})
# MESSAGE(STATUS "WILL DEPLOY ${file} with 32bit DEBUGGER VISUALIZER")
#ENDFOREACH()
#Find the x64 binary for VS2022 or later
SET (HAS_WINDESKTOP_X64_NATIVE_BINARY OFF)
IF (IS_WINDESKTOP_X64_BUILD)
FOREACH(tmp_component ${OPENCV_LIBRARY_OUTPUT_NAMES})
LIST(APPEND UNMANAGED_DLL_64BIT "${UNMANAGED_LIBRARY_OUTPUT_PATH}/${tmp_component}.dll")
ENDFOREACH()
FOREACH(tmp_component ${CVEXTERN_DEPENDENCY_DLL_NAMES})
LIST(APPEND UNMANAGED_DLL_64BIT "${UNMANAGED_LIBRARY_OUTPUT_PATH}/${tmp_component}.dll")
ENDFOREACH()
LIST(REMOVE_DUPLICATES UNMANAGED_DLL_64BIT)
SET (HAS_WINDESKTOP_X64_NATIVE_BINARY ON)
IF (${UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER} MATCHES "^$")
SET(DEBUGGER_VISUALIZER_UNMANAGED_X64_FILES_SUBFOLDER "")
ELSE()
#MESSAGE(STATUS "UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER: ${UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER}")
#remove leading slashes
STRING(REGEX REPLACE "^/" "" DEBUGGER_VISUALIZER_UNMANAGED_X64_FILES_SUBFOLDER ${UNMANAGED_LIBRARY_OUTPUT_SUBFOLDER})
#add tailing slashes
SET(DEBUGGER_VISUALIZER_UNMANAGED_X64_FILES_SUBFOLDER "${DEBUGGER_VISUALIZER_UNMANAGED_X64_FILES_SUBFOLDER}\\")
#replace single slashes with quard slashes
STRING(REGEX REPLACE "\\\\" "\\\\\\\\" DEBUGGER_VISUALIZER_UNMANAGED_X64_FILES_SUBFOLDER ${DEBUGGER_VISUALIZER_UNMANAGED_X64_FILES_SUBFOLDER})
#MESSAGE(STATUS "DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES_SUBFOLDER: ${DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES_SUBFOLDER}")
ENDIF()
ELSE()
FILE(GLOB UNMANAGED_DLL_64BIT "${CMAKE_CURRENT_SOURCE_DIR}/libs/runtimes/win-x64/native/*.dll")
LIST(LENGTH UNMANAGED_DLL_64BIT UNMANAGED_DLL_64BIT_LENGTH)
IF(UNMANAGED_DLL_64BIT_LENGTH GREATER 0)
SET(HAS_WINDESKTOP_X64_NATIVE_BINARY ON)
SET(DEBUGGER_VISUALIZER_UNMANAGED_X64_FILES_SUBFOLDER "runtimes\\\\win-x64\\\\native\\\\")
ENDIF()
ENDIF()
SET(DEBUGGER_VISUALIZER_UNMANAGED_X64_FILES_DEPLOY_SUBFOLDER "runtimes\\\\win-x64\\\\native\\\\")
MESSAGE(STATUS "HAS_WINDESKTOP_X64_NATIVE_BINARY: ${HAS_WINDESKTOP_X64_NATIVE_BINARY}")
#FOREACH (file ${UNMANAGED_DLL_64BIT})
# MESSAGE(STATUS "WILL DEPLOY ${file} with 64bit DEBUGGER VISUALIZER")
#ENDFOREACH()
MACRO(INSTALL_DEBUGER_VISUALIZER vs_version vs_description hklm_key DEBUGER_VISUALIZER_FILES DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES DEBUGGER_VISUALIZER_UNMANAGED_X64_FILES)
SET(INSTALL_DEBUGER_VISUALIZER_COMMAND "installDebuggerVisualizer4${vs_version}:
ClearErrors
Var /GLOBAL ${vs_version}_INSTALL_FOLDER ")
IF("${vs_version}" STREQUAL "VS2017")
SET(INSTALL_DEBUGER_VISUALIZER_COMMAND
"${INSTALL_DEBUGER_VISUALIZER_COMMAND}
ReadRegStr \\\$R1 HKLM '${hklm_key}' '15.0'
StrCpy $${vs_version}_INSTALL_FOLDER '\\\$R1Common7\\\\Packages\\\\Debugger\\\\Visualizers\\\\'")
ELSEIF("${vs_version}" STREQUAL "VS2019")
SET(INSTALL_DEBUGER_VISUALIZER_COMMAND
"${INSTALL_DEBUGER_VISUALIZER_COMMAND}
ExecDos::exec /NOUNLOAD /TOSTACK '\\\$INSTDIR\\\\miscellaneous\\\\vswhere.exe -version [16.0,17.0) -property installationPath' ''
Pop $0
StrCmp $0 0 0 installDebuggerVisualizer4${vs_version}Done
Pop $1
;MessageBox MB_OK 'vswhere result ($1).'
StrCmp $1 0 installDebuggerVisualizer4${vs_version}Done 0
StrCpy $${vs_version}_INSTALL_FOLDER '\\\$1\\\\Common7\\\\Packages\\\\Debugger\\\\Visualizers\\\\'
")
ELSEIF("${vs_version}" STREQUAL "VS2022")
SET(INSTALL_DEBUGER_VISUALIZER_COMMAND
"${INSTALL_DEBUGER_VISUALIZER_COMMAND}
ExecDos::exec /NOUNLOAD /TOSTACK '\\\$INSTDIR\\\\miscellaneous\\\\vswhere.exe -prerelease -version [17.0,18.0) -property installationPath' ''
Pop $0
StrCmp $0 0 0 installDebuggerVisualizer4${vs_version}Done
Pop $1
;MessageBox MB_OK 'vswhere result ($1).'
StrCmp $1 0 installDebuggerVisualizer4${vs_version}Done 0
StrCpy $${vs_version}_INSTALL_FOLDER '\\\$1\\\\Common7\\\\Packages\\\\Debugger\\\\Visualizers\\\\'
")
ELSE()
SET(INSTALL_DEBUGER_VISUALIZER_COMMAND
"${INSTALL_DEBUGER_VISUALIZER_COMMAND}
ReadRegStr \\\$R1 HKLM '${hklm_key}' 'InstallDir'
StrCpy $${vs_version}_INSTALL_FOLDER '\\\$R1..\\\\Packages\\\\Debugger\\\\Visualizers\\\\'")
ENDIF()
SET(INSTALL_DEBUGER_VISUALIZER_COMMAND
"${INSTALL_DEBUGER_VISUALIZER_COMMAND}
IfErrors installDebuggerVisualizer4${vs_version}Done
MessageBox MB_YESNO 'Install Debugger Visualizer for ${vs_description}?' IDNO installDebuggerVisualizer4${vs_version}Done")
#Install Emgu CV managed DLLs
FOREACH (file ${DEBUGER_VISUALIZER_FILES})
SET(INSTALL_DEBUGER_VISUALIZER_COMMAND
"${INSTALL_DEBUGER_VISUALIZER_COMMAND}
CopyFiles /SILENT '\\\$INSTDIR\\\\libs\\\\${file}.dll' '$${vs_version}_INSTALL_FOLDER'")
ENDFOREACH()
#INSTALL 32bit native DLLs
IF (NOT ("" STREQUAL "${DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES}"))
SET(INSTALL_DEBUGER_VISUALIZER_COMMAND
"${INSTALL_DEBUGER_VISUALIZER_COMMAND}
CreateDirectory '$${vs_version}_INSTALL_FOLDER${DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES_DEPLOY_SUBFOLDER}'
;MessageBox MB_OK 'Creating directory $${vs_version}_INSTALL_FOLDER${DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES_DEPLOY_SUBFOLDER}'
")
FOREACH (file ${DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES})
SET(INSTALL_DEBUGER_VISUALIZER_COMMAND
"${INSTALL_DEBUGER_VISUALIZER_COMMAND}
CopyFiles /SILENT '\\\$INSTDIR\\\\libs\\\\runtimes\\\\win-x86\\\\native\\\\${file}.dll' '$${vs_version}_INSTALL_FOLDER${DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES_DEPLOY_SUBFOLDER}'
;MessageBox MB_OK 'copying \\\$INSTDIR\\\\libs\\\\runtimes\\\\win-x86\\\\native\\\\${file}.dll to $${vs_version}_INSTALL_FOLDER${DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES_DEPLOY_SUBFOLDER}'
")
#MESSAGE(STATUS " --- Adding libs\\x86\\${file}.dll to debuger visualizer folder '$${vs_version}_INSTALL_FOLDER${DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES_SUBFOLDER}' for ${vs_description}")
ENDFOREACH()
ENDIF()
#INSTALL 64bit native DLLs
IF (NOT ("" STREQUAL "${DEBUGGER_VISUALIZER_UNMANAGED_X64_FILES}"))
SET(INSTALL_DEBUGER_VISUALIZER_COMMAND
"${INSTALL_DEBUGER_VISUALIZER_COMMAND}
CreateDirectory '$${vs_version}_INSTALL_FOLDER${DEBUGGER_VISUALIZER_UNMANAGED_X64_FILES_DEPLOY_SUBFOLDER}'
;MessageBox MB_OK 'Creating directory $${vs_version}_INSTALL_FOLDER${DEBUGGER_VISUALIZER_UNMANAGED_X64_FILES_DEPLOY_SUBFOLDER}'
")
FOREACH (file ${DEBUGGER_VISUALIZER_UNMANAGED_X64_FILES})
SET(INSTALL_DEBUGER_VISUALIZER_COMMAND
"${INSTALL_DEBUGER_VISUALIZER_COMMAND}
CopyFiles /SILENT '\\\$INSTDIR\\\\libs\\\\runtimes\\\\win-x64\\\\native\\\\${file}.dll' '$${vs_version}_INSTALL_FOLDER${DEBUGGER_VISUALIZER_UNMANAGED_X64_FILES_DEPLOY_SUBFOLDER}'
;MessageBox MB_OK 'copying \\\$INSTDIR\\\\libs\\\\runtimes\\\\win-x64\\\\native\\\\${file}.dll to $${vs_version}_INSTALL_FOLDER${DEBUGGER_VISUALIZER_UNMANAGED_X64_FILES_DEPLOY_SUBFOLDER}'
")
#MESSAGE(STATUS " --- Adding libs\\x64\\${file}.dll to debuger visualizer folder '$${vs_version}_INSTALL_FOLDER${DEBUGGER_VISUALIZER_UNMANAGED_X64_FILES_SUBFOLDER}' for ${vs_description}")
ENDFOREACH()
ENDIF()
#IF(DEFINED UNIVERSAL_BUILD)
#SET(INSTALL_DEBUGER_VISUALIZER_COMMAND
# "${INSTALL_DEBUGER_VISUALIZER_COMMAND}
#CreateDirectory '$${vs_version}_INSTALL_FOLDERx86\\\\'")
#FOREACH (file ${UNMANAGED_DLL_32BIT})
# GET_FILENAME_COMPONENT(UNMANAGED_FILE_NAME_TO_DEPLOY ${file} NAME)
# MESSAGE(STATUS "Adding ${UNMANAGED_FILE_NAME_TO_DEPLOY} to debuger visualizer for ${vs_description}")
# SET(INSTALL_DEBUGER_VISUALIZER_COMMAND
# "${INSTALL_DEBUGER_VISUALIZER_COMMAND}
#CopyFiles /SILENT '\\\$INSTDIR\\\\libs\\\\x86\\\\${UNMANAGED_FILE_NAME_TO_DEPLOY}' '$${vs_version}_INSTALL_FOLDERx86\\\\'")
#ENDFOREACH()
#ENDIF()
#Install the Debugger Visualizer itself
#SET(INSTALL_DEBUGER_VISUALIZER_COMMAND
# "${INSTALL_DEBUGER_VISUALIZER_COMMAND}
#CopyFiles /SILENT '\\\$INSTDIR\\\\libs\\\\Emgu.CV.DebuggerVisualizers.dll' '$${vs_version}_INSTALL_FOLDER'
#CopyFiles /SILENT '\\\$INSTDIR\\\\libs\\\\System.Runtime.InteropServices.RuntimeInformation.dll' '$${vs_version}_INSTALL_FOLDER'")
#mark the end of the marco
SET(INSTALL_DEBUGER_VISUALIZER_COMMAND
"${INSTALL_DEBUGER_VISUALIZER_COMMAND}
installDebuggerVisualizer4${vs_version}Done:")
ENDMACRO()
MACRO(UNINSTALL_DEBUGER_VISUALIZER vs_version hklm_key DEBUGER_VISUALIZER_FILES DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES DEBUGGER_VISUALIZER_UNMANAGED_X64_FILES)
SET(UNINSTALL_DEBUGER_VISUALIZER_COMMAND "uninstallDebuggerVisualizer4${vs_version}:
ClearErrors")
IF("${vs_version}" STREQUAL "VS2017")
SET(UNINSTALL_DEBUGER_VISUALIZER_COMMAND
"${UNINSTALL_DEBUGER_VISUALIZER_COMMAND}
ReadRegStr \\\$R1 HKLM '${hklm_key}' '15.0'
StrCpy $${vs_version}_INSTALL_FOLDER '\\\$R1Common7\\\\Packages\\\\Debugger\\\\Visualizers\\\\'")
ELSEIF("${vs_version}" STREQUAL "VS2019")
SET(UNINSTALL_DEBUGER_VISUALIZER_COMMAND
"${UNINSTALL_DEBUGER_VISUALIZER_COMMAND}
ExecDos::exec /NOUNLOAD /TOSTACK '\\\$INSTDIR\\\\miscellaneous\\\\vswhere.exe -version [16.0,17.0) -property installationPath' '' '$EXEDIR\\\\execdos.log'
Pop $0
StrCmp $0 0 0 uninstallDebuggerVisualizer4${vs_version}Done
Pop $1
StrCmp $1 0 uninstallDebuggerVisualizer4${vs_version}Done 0
StrCpy $${vs_version}_INSTALL_FOLDER '\\\$1\\\\Common7\\\\Packages\\\\Debugger\\\\Visualizers\\\\'
")
ELSEIF("${vs_version}" STREQUAL "VS2022")
SET(UNINSTALL_DEBUGER_VISUALIZER_COMMAND
"${UNINSTALL_DEBUGER_VISUALIZER_COMMAND}
ExecDos::exec /NOUNLOAD /TOSTACK '\\\$INSTDIR\\\\miscellaneous\\\\vswhere.exe -prerelease -version [17.0,18.0) -property installationPath' '' '$EXEDIR\\\\execdos.log'
Pop $0
StrCmp $0 0 0 uninstallDebuggerVisualizer4${vs_version}Done
Pop $1
StrCmp $1 0 uninstallDebuggerVisualizer4${vs_version}Done 0
StrCpy $${vs_version}_INSTALL_FOLDER '\\\$1\\\\Common7\\\\Packages\\\\Debugger\\\\Visualizers\\\\'
")
#MESSAGE(STATUS "Calculating VS2020 install folder for uninstall")
ELSE()
SET(UNINSTALL_DEBUGER_VISUALIZER_COMMAND
"${UNINSTALL_DEBUGER_VISUALIZER_COMMAND}
ReadRegStr \\\$R1 HKLM '${hklm_key}' 'InstallDir'
StrCpy $${vs_version}_INSTALL_FOLDER '\\\$R1..\\\\Packages\\\\Debugger\\\\Visualizers\\\\'")
ENDIF()
#UNINSTALL managed dlls
SET(UNINSTALL_DEBUGER_VISUALIZER_COMMAND
"${UNINSTALL_DEBUGER_VISUALIZER_COMMAND}
IfErrors uninstallDebuggerVisualizer4${vs_version}Done")
FOREACH (file ${DEBUGER_VISUALIZER_FILES})
SET(UNINSTALL_DEBUGER_VISUALIZER_COMMAND
"${UNINSTALL_DEBUGER_VISUALIZER_COMMAND}
Delete '$${vs_version}_INSTALL_FOLDER${file}.dll'
;MessageBox MB_OK 'removing $${vs_version}_INSTALL_FOLDER${file}.dll'
")
#MESSAGE(STATUS "Will remove ${file}.dll from debuger visualizer folder '$${vs_version}_INSTALL_FOLDER' for ${vs_version}")
ENDFOREACH()
#UNINSTALL 32bit native DLLs
FOREACH (file ${DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES})
SET(UNINSTALL_DEBUGER_VISUALIZER_COMMAND
"${UNINSTALL_DEBUGER_VISUALIZER_COMMAND}
Delete '$${vs_version}_INSTALL_FOLDER${DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES_DEPLOY_SUBFOLDER}${file}.dll'
;MessageBox MB_OK 'removing $${vs_version}_INSTALL_FOLDER${DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES_DEPLOY_SUBFOLDER}${file}.dll'
")
#MESSAGE(STATUS "Will remove 32-bit ${file}.dll from debuger visualizer folder '$${vs_version}_INSTALL_FOLDER${DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES_DEPLOY_SUBFOLDER}' for ${vs_version}")
ENDFOREACH()
#UNINSTALL 64bit native DLLs
FOREACH (file ${DEBUGGER_VISUALIZER_UNMANAGED_X64_FILES})
SET(UNINSTALL_DEBUGER_VISUALIZER_COMMAND
"${UNINSTALL_DEBUGER_VISUALIZER_COMMAND}
Delete '$${vs_version}_INSTALL_FOLDER${DEBUGGER_VISUALIZER_UNMANAGED_X64_FILES_DEPLOY_SUBFOLDER}${file}.dll'
;MessageBox MB_OK 'removing $${vs_version}_INSTALL_FOLDER${DEBUGGER_VISUALIZER_UNMANAGED_X64_FILES_DEPLOY_SUBFOLDER}${file}.dll'
")
#MESSAGE(STATUS "Will remove 64-bit ${file}.dll from debuger visualizer folder '$${vs_version}_INSTALL_FOLDER${DEBUGGER_VISUALIZER_UNMANAGED_X64_FILES_DEPLOY_SUBFOLDER}' for ${vs_version}")
ENDFOREACH()
#IF(DEFINED UNIVERSAL_BUILD)
#FOREACH (file ${UNMANAGED_DLL_32BIT})
# GET_FILENAME_COMPONENT(UNMANAGED_FILE_NAME_TO_DEPLOY ${file} NAME)
# SET(UNINSTALL_DEBUGER_VISUALIZER_COMMAND
# "${UNINSTALL_DEBUGER_VISUALIZER_COMMAND}
#Delete '$${vs_version}_INSTALL_FOLDERx86\\\\${UNMANAGED_FILE_NAME_TO_DEPLOY}'")
#ENDFOREACH()
#ENDIF()
#SET(UNINSTALL_DEBUGER_VISUALIZER_COMMAND
# "${UNINSTALL_DEBUGER_VISUALIZER_COMMAND}
##Delete '$${vs_version}_INSTALL_FOLDEREmgu.CV.DebuggerVisualizers.${vs_version}.dll'
#Delete '$${vs_version}_INSTALL_FOLDEREmgu.CV.DebuggerVisualizers.dll'
#")
#mark the end of the marco
SET(UNINSTALL_DEBUGER_VISUALIZER_COMMAND
"${UNINSTALL_DEBUGER_VISUALIZER_COMMAND}
uninstallDebuggerVisualizer4${vs_version}Done:
")
ENDMACRO()
SET(DEBUGER_VISUALIZER_FILES_ANY_CPU "Emgu.CV.Platform.NetStandard" "Emgu.CV.DebuggerVisualizers" "System.Runtime.InteropServices.RuntimeInformation")
IF (HAS_WINDESKTOP_X86_NATIVE_BINARY)
SET(DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES)
FOREACH(full_file_name ${UNMANAGED_DLL_32BIT})
get_filename_component(just_the_file_name "${full_file_name}" NAME_WE)
LIST(APPEND DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES "${just_the_file_name}")
ENDFOREACH()
#MESSAGE(STATUS "########### UNMANAGED_DLL_32BIT: ${UNMANAGED_DLL_32BIT}")
#MESSAGE(STATUS "########### DEBUGGER_VISUALIZER_UNMANAGED_FILES: ${DEBUGGER_VISUALIZER_UNMANAGED_FILES}")
#MESSAGE(STATUS "########### DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES_SUBFOLDER: ${DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES_SUBFOLDER}")
#FOREACH(UNMANAGE_DLL_NAME ${CVEXTERN_DEPENDENCY_DLL_NAMES})
# LIST(APPEND DEBUGGER_VISUALIZER_FILES "${DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES_SUBFOLDER}${UNMANAGE_DLL_NAME}")
#ENDFOREACH()
#MESSAGE(STATUS "DEBUGGER VISUALIZER FILES: ${DEBUGER_VISUALIZER_FILES}")
INSTALL_DEBUGER_VISUALIZER("VS2017" "Visual Studio 2017" "SOFTWARE\\\\\\\\WOW6432NODE\\\\\\\\Microsoft\\\\\\\\VisualStudio\\\\\\\\SxS\\\\\\\\VS7" "${DEBUGER_VISUALIZER_FILES_ANY_CPU}" "${DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES}" "")
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}\n${INSTALL_DEBUGER_VISUALIZER_COMMAND}")
INSTALL_DEBUGER_VISUALIZER("VS2019" "Visual Studio 2019" "" "${DEBUGER_VISUALIZER_FILES_ANY_CPU}" "${DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES}" "")
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}\n${INSTALL_DEBUGER_VISUALIZER_COMMAND}")
#UNINSTALL_DEBUGER_VISUALIZER("VS2008" "SOFTWARE\\\\\\\\Microsoft\\\\\\\\VisualStudio\\\\\\\\9.0")
#SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}\n${UNINSTALL_DEBUGER_VISUALIZER_COMMAND}")
#UNINSTALL_DEBUGER_VISUALIZER("VS2010" "SOFTWARE\\\\\\\\Microsoft\\\\\\\\VisualStudio\\\\\\\\10.0")
#SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}\n${UNINSTALL_DEBUGER_VISUALIZER_COMMAND}")
#UNINSTALL_DEBUGER_VISUALIZER("VS2012" "SOFTWARE\\\\\\\\Microsoft\\\\\\\\VisualStudio\\\\\\\\11.0")
#SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}\n${UNINSTALL_DEBUGER_VISUALIZER_COMMAND}")
#UNINSTALL_DEBUGER_VISUALIZER("VS2013" "SOFTWARE\\\\\\\\Microsoft\\\\\\\\VisualStudio\\\\\\\\12.0")
#SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}\n${UNINSTALL_DEBUGER_VISUALIZER_COMMAND}")
#UNINSTALL_DEBUGER_VISUALIZER("VS2015" "SOFTWARE\\\\\\\\Microsoft\\\\\\\\VisualStudio\\\\\\\\14.0")
#SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}\n${UNINSTALL_DEBUGER_VISUALIZER_COMMAND}")
UNINSTALL_DEBUGER_VISUALIZER("VS2017" "SOFTWARE\\\\\\\\WOW6432NODE\\\\\\\\Microsoft\\\\\\\\VisualStudio\\\\\\\\SxS\\\\\\\\VS7" "${DEBUGER_VISUALIZER_FILES_ANY_CPU}" "${DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES}" "")
SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}\n${UNINSTALL_DEBUGER_VISUALIZER_COMMAND}")
UNINSTALL_DEBUGER_VISUALIZER("VS2019" "" "${DEBUGER_VISUALIZER_FILES_ANY_CPU}" "${DEBUGGER_VISUALIZER_UNMANAGED_X86_FILES}" "")
SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}\n${UNINSTALL_DEBUGER_VISUALIZER_COMMAND}")
ELSE()
MESSAGE(STATUS "x86 binary not found, will not deploy 32bit debugger visualizer")
ENDIF()
IF (HAS_WINDESKTOP_X64_NATIVE_BINARY)
SET(DEBUGGER_VISUALIZER_UNMANAGED_X64_FILES)
FOREACH(full_file_name ${UNMANAGED_DLL_64BIT})
get_filename_component(just_the_file_name "${full_file_name}" NAME_WE)
LIST(APPEND DEBUGGER_VISUALIZER_UNMANAGED_X64_FILES "${just_the_file_name}")
ENDFOREACH()
#MESSAGE(STATUS "########### DEBUGGER_VISUALIZER_UNMANAGED_X64_FILES 64BIT: ${DEBUGGER_VISUALIZER_UNMANAGED_x64_FILES}")
#MESSAGE(STATUS "########### DEBUGER_VISUALIZER_FILES_ANY_CPU 64BIT: ${DEBUGER_VISUALIZER_FILES_ANY_CPU}")
#MESSAGE(STATUS "########### DEBUGGER_VISUALIZER_UNMANAGED_X64_FILES_SUBFOLDER: ${DEBUGGER_VISUALIZER_UNMANAGED_X64_FILES_SUBFOLDER}")
INSTALL_DEBUGER_VISUALIZER("VS2022" "Visual Studio 2022" "" "${DEBUGER_VISUALIZER_FILES_ANY_CPU}" "" "${DEBUGGER_VISUALIZER_UNMANAGED_X64_FILES}")
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}\n${INSTALL_DEBUGER_VISUALIZER_COMMAND}")
UNINSTALL_DEBUGER_VISUALIZER("VS2022" "" "${DEBUGER_VISUALIZER_FILES_ANY_CPU}" "" "${DEBUGGER_VISUALIZER_UNMANAGED_X64_FILES}")
SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}\n${UNINSTALL_DEBUGER_VISUALIZER_COMMAND}")
ELSE()
MESSAGE(STATUS "x64 binary not found, will not deploy 64bit debugger visualizer")
ENDIF()
ENDIF()
# ----------------------------------------------------------------------------
# Build the documents of Emgu CV
# ----------------------------------------------------------------------------
SET(EMGU_CV_DOCUMENTATION_BUILD OFF CACHE BOOL "Build Emgu CV Documentation")
IF(EMGU_CV_DOCUMENTATION_BUILD)
ADD_SUBDIRECTORY(miscellaneous)
ENDIF()
# ----------------------------------------------------------------------------
# Set if we should sign the managed assembly
# ----------------------------------------------------------------------------
IF (WIN32)
SET(EMGU_SIGN_ASSEMBLY OFF CACHE BOOL "If enabled, we will sign the managed assembly")
ELSE()
SET(EMGU_SIGN_ASSEMBLY ON CACHE BOOL "If enabled, we will sign the managed assembly")
ENDIF()
# ----------------------------------------------------------------------------
# Build the extra components of Emgu CV
# ----------------------------------------------------------------------------
SET(EMGU_CV_EXTRA_BUILD OFF CACHE BOOL "Build Emgu CV Extra")
IF(EMGU_CV_EXTRA_BUILD)
ADD_SUBDIRECTORY(Emgu.RPC)
ENDIF()
# ----------------------------------------------------------------------------
# The source files
# ----------------------------------------------------------------------------
INSTALL(
DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}/lib
DESTINATION .
COMPONENT emgucv_source
FILES_MATCHING
PATTERN "*.dll"
PATTERN "*.txt"
PATTERN "*.xml"
PATTERN ".git" EXCLUDE
PATTERN "obj" EXCLUDE
PATTERN "CMake*" EXCLUDE
PATTERN "Release" EXCLUDE
PATTERN "${PROJECT_NAME}.dir" EXCLUDE
)
#WINDOWS STORE EXAMPLE
IF(HAVE_WINSTORE_10_X86 OR HAVE_WINSTORE_10_X64 OR HAVE_WINSTORE_10_ARM)
INSTALL(
DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}/Solution
DESTINATION .
COMPONENT emgucv_example_source
FILES_MATCHING
PATTERN "Emgu.CV.Example.Windows.UWP.sln"
PATTERN "Windows.UWP/packages/repositories.config"
PATTERN ".git" EXCLUDE
PATTERN "bin" EXCLUDE
PATTERN "Android" EXCLUDE
PATTERN "iOS" EXCLUDE
PATTERN "Windows.Phone" EXCLUDE
PATTERN "Windows.Desktop" EXCLUDE
PATTERN "CrossPlatform" EXCLUDE
PATTERN "Mac" EXCLUDE
)
ENDIF()
#WIN32 and not NETFX_CORE solution files
IF (HAVE_WINDESKTOP_X86 OR HAVE_WINDESKTOP_X64 OR HAVE_WINDESKTOP_ARM64)
INSTALL(
DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}/Solution
DESTINATION .
COMPONENT emgucv_source
FILES_MATCHING
PATTERN "Emgu.CV.sln"
PATTERN "Emgu.CV.DebuggerVisualizers.sln"
PATTERN ".git" EXCLUDE
PATTERN "bin" EXCLUDE
PATTERN "Android" EXCLUDE
PATTERN "iOS" EXCLUDE
PATTERN "CrossPlatform" EXCLUDE
PATTERN "Mac" EXCLUDE
PATTERN "Windows.UWP" EXCLUDE
)
INSTALL(
DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}/Emgu.CV.WPF
DESTINATION .
COMPONENT emgucv_example_source
FILES_MATCHING
PATTERN "*.cs"
PATTERN ".git" EXCLUDE
)
INSTALL(
DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}/Solution
DESTINATION .
COMPONENT emgucv_example_source
FILES_MATCHING
PATTERN "Emgu.CV.Example.sln"
PATTERN ".git" EXCLUDE
PATTERN "bin" EXCLUDE
PATTERN "Android" EXCLUDE
PATTERN "iOS" EXCLUDE
PATTERN "Windows.UWP" EXCLUDE
PATTERN "CrossPlatform" EXCLUDE
PATTERN "Mac" EXCLUDE
)
# ----------------------------------------------------------------------------
# The example files
# ----------------------------------------------------------------------------
# INSTALL(
# DIRECTORY
# ${CMAKE_CURRENT_SOURCE_DIR}/Emgu.CV.Example
# DESTINATION .
# COMPONENT emgucv_example_source
# FILES_MATCHING
# PATTERN "*.cs"
# PATTERN "*.csproj"
# PATTERN "*.resx"
# PATTERN "*.h"
# PATTERN "*.cpp"
# PATTERN "*.resX"
# PATTERN "*.ico"
# PATTERN "*.rc"
# PATTERN "CPlusPlus/*.vcproj"
# PATTERN "CPlusPlus/*.vcxproj"
# PATTERN "*.vb"
# PATTERN "*.vbproj"
# PATTERN "*.aspx"
# PATTERN "*.dll"
# PATTERN "*.txt"
# PATTERN "*.xml"
# PATTERN "*.xaml"
# PATTERN "*.jpg"
# PATTERN "*.png"
# PATTERN "*.svg"
# PATTERN "*.settings"
# PATTERN "*.config"
# PATTERN "tessdata/*"
# PATTERN ".git" EXCLUDE
# PATTERN "obj" EXCLUDE
# PATTERN "CMake*" EXCLUDE
# PATTERN "Release" EXCLUDE
# PATTERN "Debug" EXCLUDE
# PATTERN "RelWithDebInfo" EXCLUDE
# PATTERN "*.dir" EXCLUDE
# PATTERN "Android" EXCLUDE
# PATTERN "iOS" EXCLUDE
# PATTERN "Mac" EXCLUDE
# PATTERN "WindowsStore" EXCLUDE
# PATTERN "WindowsPhoneApp" EXCLUDE
# PATTERN "WindowsStoreCameraApp" EXCLUDE
# )
ENDIF()
INSTALL(
FILES
"${OPENCV_SUBFOLDER}/data/haarcascades/haarcascade_frontalface_default.xml"
"${OPENCV_SUBFOLDER}/data/haarcascades/haarcascade_eye.xml"
DESTINATION opencv/data/haarcascades
COMPONENT emgucv_example_source
)
INSTALL(
FILES
"${OPENCV_CONTRIB_SUBFOLDER}/modules/text/samples/trained_classifierNM1.xml"
"${OPENCV_CONTRIB_SUBFOLDER}/modules/text/samples/trained_classifierNM2.xml"
"${OPENCV_CONTRIB_SUBFOLDER}/modules/text/samples/trained_classifier_erGrouping.xml"
DESTINATION opencv_contrib/modules/text/samples/
COMPONENT emgucv_example_source
)
# ----------------------------------------------------------------------------
# Build the package
# ----------------------------------------------------------------------------
set(CPACK_COMPONENTS_ALL
libs #opencv components
emgucv_binary
emgucv_source
emgucv_example_source
)
set(CPACK_PACKAGE_EXECUTABLES "" "") #http://public.kitware.com/Bug/view.php?id=7828
SET(CPACK_NSIS_CONTACT "support@emgu.com")
# Define MUI_TEMP that will be used for uninstalling menulinks
SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}\n !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP")
# ----------------------------------------------------------------------------
# Add menu link for documentations
# ----------------------------------------------------------------------------
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}\nCreateDirectory \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Documentation\\\" ")
#SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}\nCreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Documentation\\\\Open CV Documentation.lnk\\\" \\\"$INSTDIR\\\\doc\\\\opencv2refman.pdf\\\" ")
#SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}\n Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Documentation\\\\Open CV Documentation.lnk\\\" ")
IF(EMGU_CV_DOCUMENTATION_BUILD)
LIST(APPEND CPACK_COMPONENTS_ALL emgucv_document)
set(CPACK_COMPONENT_EMGUCV_DOCUMENT_DISPLAY_NAME "Emgu CV Documentation")
set(CPACK_COMPONENT_EMGUCV_DOCUMENT_DEPENDS emgucv_binary)
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}\nCreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Documentation\\\\Emgu CV Documentation.lnk\\\" \\\"$INSTDIR\\\\Emgu.CV.Documentation.chm\\\" ")
SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}\n Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Documentation\\\\Emgu CV Documentation.lnk\\\" ")
ENDIF()
SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}\nRMDir \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Documentation\\\" ")
# ----------------------------------------------------------------------------
# Add menu link for web sites
# ----------------------------------------------------------------------------
LIST(APPEND CPACK_NSIS_MENU_LINKS "https://www.emgu.com" "Emgu CV wiki")
LIST(APPEND CPACK_NSIS_MENU_LINKS "https://github.com/emgucv/emgucv/discussions" "Discussions")
LIST(APPEND CPACK_NSIS_MENU_LINKS "https://github.com/emgucv/emgucv/issues" "Issues Tracking")
# ----------------------------------------------------------------------------
# Add menu link for Visual Studio solutions
# ----------------------------------------------------------------------------
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}\nCreateDirectory \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Visual Studio Solution\\\" ")
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}\nCreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Visual Studio Solution\\\\Visual Studio 2017 - 2022 Examples.lnk\\\" \\\"$INSTDIR\\\\Solution\\\\Windows.Desktop\\\\Emgu.CV.Example.sln\\\" ")
SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}\n Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Visual Studio Solution\\\\Visual Studio 2017 - 2022 Examples.lnk\\\" ")
SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}\nRMDir \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\Visual Studio Solution\\\" ")
# ----------------------------------------------------------------------------
# Add menu link for Licenses
# ----------------------------------------------------------------------------
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}\nCreateDirectory \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\License\\\" ")
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}\nCreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\License\\\\Emgu CV License.lnk\\\" \\\"$INSTDIR\\\\${LICENSE_FILE_NAME}\\\" ")
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}\nCreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\License\\\\Open CV License.lnk\\\" \\\"$INSTDIR\\\\lib\\\\opencv.license.txt\\\" ")
IF(EMGU_CV_WITH_TESSERACT)
SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}\nCreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\License\\\\Tesseract OCR License.lnk\\\" \\\"$INSTDIR\\\\lib\\\\tesseract-ocr.license.txt\\\" ")
ENDIF()
#SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}\nCreateShortCut \\\"$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\License\\\\CvBlob License.lnk\\\" \\\"$INSTDIR\\\\lib\\\\3rdParty\\\\cvblob.license.txt\\\" ")
SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}\n Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\License\\\\Emgu CV License.lnk\\\" ")
SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}\n Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\License\\\\Open CV License.lnk\\\" ")
IF(EMGU_CV_WITH_TESSERACT)
SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}\n Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\License\\\\Tesseract OCR License.lnk\\\" ")
ENDIF()
#SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}\n Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\License\\\\CvBlob License.lnk\\\" ")
SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "${CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS}\nRMDir \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\License\\\" ")
#IF(EMGU_CV_EXAMPLE_BUILD AND NOT NETFX_CORE)
# LIST(APPEND CPACK_COMPONENTS_ALL emgucv_example_binary)
# SET(CPACK_COMPONENT_EMGUCV_EXAMPLE_BINARY_DISPLAY_NAME "Emgu CV Examples (Binary)")
# SET(CPACK_COMPONENT_EMGUCV_EXAMPLE_BINARY_DEPENDS emgucv_binary)
#ENDIF()
set(CPACK_COMPONENT_MAIN_DISPLAY_NAME "OpenCV Native Binary")
set(CPACK_COMPONENT_MAIN_REQUIRED ON)
set(CPACK_COMPONENT_EMGUCV_BINARY_DISPLAY_NAME "Emgu CV (Binary)")
set(CPACK_COMPONENT_EMGUCV_BINARY_REQUIRED ON)
set(CPACK_COMPONENT_EMGUCV_BINARY_DEPENDS libs)
set(CPACK_COMPONENT_EMGUCV_SOURCE_DISPLAY_NAME "Emgu CV (Source)")
set(CPACK_COMPONENT_EMGUCV_SOURCE_DEPENDS libs)
set(CPACK_COMPONENT_EMGUCV_EXAMPLE_SOURCE_DISPLAY_NAME "Emgu CV Examples (Source)")
set(CPACK_COMPONENT_EMGUCV_EXAMPLE_SOURCE_DEPENDS emgucv_source)
IF (${CMAKE_VERSION} VERSION_GREATER "3.19.0" AND WIN32)
STRING(REGEX REPLACE "/" "\\\\\\\\" WIN_CMAKE_COMMAND "${CMAKE_COMMAND}" )
IF(EMGU_SIGN_FOUND)
#Sign the windows installer (.exe)
SET(NSIS_PACKAGE_FILE ${CMAKE_BINARY_DIR}/lib${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.exe)
#MESSAGE(STATUS "CPACK_PACKAGE_FILES: ${NSIS_PACKAGE_FILE}")
STRING(REGEX REPLACE "/" "\\\\\\\\" WIN_EMGU_SIGN_EXECUTABLE "${EMGU_SIGN_EXECUTABLE}")
STRING(REGEX REPLACE "/" "\\\\\\\\" WIN_PACKAGE_FILE "${CMAKE_BINARY_DIR}/lib${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.exe")
STRING(REGEX REPLACE "/" "\\\\\\\\" WIN_PACKAGE_FOLDER "${CMAKE_BINARY_DIR}/signed")
STRING(REGEX REPLACE "/" "\\\\\\\\" WIN_SIGNTOOL_EXECUTABLE "${SIGNTOOL_EXECUTABLE}")
#FILE(WRITE "${CMAKE_BINARY_DIR}/sign_package.txt" "add_custom_command(OUTPUT ${WIN_PACKAGE_FOLDER}/lib${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.exe\n")
FILE(WRITE "${CMAKE_BINARY_DIR}/sign_package.cmake" "IF(EXISTS \"${CMAKE_BINARY_DIR}/lib${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.exe\")\n")
FILE(APPEND "${CMAKE_BINARY_DIR}/sign_package.cmake" " EXECUTE_PROCESS(COMMAND \"${WIN_CMAKE_COMMAND}\" -E make_directory \"${CMAKE_BINARY_DIR}/signed\")\n")
FILE(APPEND "${CMAKE_BINARY_DIR}/sign_package.cmake" " EXECUTE_PROCESS(COMMAND \"${WIN_EMGU_SIGN_EXECUTABLE}\" \"${WIN_PACKAGE_FILE}\" \"${WIN_PACKAGE_FOLDER}\" \"${WIN_SIGNTOOL_EXECUTABLE}\")\n")
FILE(APPEND "${CMAKE_BINARY_DIR}/sign_package.cmake" "ENDIF()\n")
LIST(APPEND CPACK_POST_BUILD_SCRIPTS "${CMAKE_BINARY_DIR}/sign_package.cmake")
#LIST(APPEND CPACK_POST_BUILD_SCRIPTS "${WIN_EMGU_SIGN_EXECUTABLE} ${CMAKE_BINARY_DIR}/lib${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.exe ${CMAKE_BINARY_DIR}/signed")
ENDIF()
IF (WITH_CUDA)
FIND_PROGRAM (SEVEN_ZIP_EXECUTABLE
NAMES 7z
PATHS
$ENV{programfiles}/7-Zip
CMAKE_FIND_ROOT_PATH_BOTH
)
IF (SEVEN_ZIP_EXECUTABLE)
MESSAGE(STATUS "Found 7z.exe: ${SEVEN_ZIP_EXECUTABLE}")
STRING(REGEX REPLACE "/" "\\\\\\\\" WIN_PACKAGE_ZIP_FILE "${CMAKE_BINARY_DIR}/lib${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.zip")
STRING(REGEX REPLACE "/" "\\\\\\\\" WIN_SEVEN_ZIP_EXECUTABLE "${SEVEN_ZIP_EXECUTABLE}")
FILE(WRITE "${CMAKE_BINARY_DIR}/convert_to_7zip.cmake" "EXECUTE_PROCESS(COMMAND echo \\\\${CPACK_PACKAGE_FILES})\n")
FILE(APPEND "${CMAKE_BINARY_DIR}/convert_to_7zip.cmake" "IF (EXISTS \"${CMAKE_BINARY_DIR}/lib${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.zip\")\n")
FILE(APPEND "${CMAKE_BINARY_DIR}/convert_to_7zip.cmake" " EXECUTE_PROCESS(COMMAND \"${WIN_CMAKE_COMMAND}\" -E rm -rf \"${CMAKE_BINARY_DIR}/lib${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}\")\n")
FILE(APPEND "${CMAKE_BINARY_DIR}/convert_to_7zip.cmake" " EXECUTE_PROCESS(COMMAND \"${WIN_CMAKE_COMMAND}\" -E rm -f \"${WIN_PACKAGE_ZIP_FILE}.selfextract.exe\")\n")
FILE(APPEND "${CMAKE_BINARY_DIR}/convert_to_7zip.cmake" " EXECUTE_PROCESS(COMMAND \"${WIN_CMAKE_COMMAND}\" -E make_directory \"${CMAKE_BINARY_DIR}/lib${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}\")\n")
FILE(APPEND "${CMAKE_BINARY_DIR}/convert_to_7zip.cmake" " EXECUTE_PROCESS(COMMAND \"${WIN_SEVEN_ZIP_EXECUTABLE}\" x \"${WIN_PACKAGE_ZIP_FILE}\" -olib${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION} -y)\n")
FILE(APPEND "${CMAKE_BINARY_DIR}/convert_to_7zip.cmake" " EXECUTE_PROCESS(COMMAND \"${WIN_SEVEN_ZIP_EXECUTABLE}\" a -sfx7z.sfx \"${WIN_PACKAGE_ZIP_FILE}.selfextract.exe\" lib${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION} -mx=9 -m0=LZMA2 -mmt=off -md=512m )\n")
IF (EMGU_SIGN_FOUND)
FILE(APPEND "${CMAKE_BINARY_DIR}/convert_to_7zip.cmake" " EXECUTE_PROCESS(COMMAND \"${WIN_EMGU_SIGN_EXECUTABLE}\" \"${WIN_PACKAGE_ZIP_FILE}.selfextract.exe\" \"${WIN_PACKAGE_FOLDER}\" \"${WIN_SIGNTOOL_EXECUTABLE}\")\n")
ENDIF()
FILE(APPEND "${CMAKE_BINARY_DIR}/convert_to_7zip.cmake" "ENDIF()\n")
LIST(APPEND CPACK_POST_BUILD_SCRIPTS "${CMAKE_BINARY_DIR}/convert_to_7zip.cmake")
ENDIF()
ENDIF()
ENDIF()
ELSEIF (APPLE)
SET(CPACK_GENERATOR ZIP)
SET(CPACK_BUNDLE_NAME ${CPACK_PACKAGE_NAME})
SET(CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/platforms/macos/icons.icns")
IF (IOS)
SET(CPACK_ARCHIVE_COMPONENT_INSTALL ON) #enable components install for zip
IF(CPACK_GENERATOR MATCHES "ZIP")
SET(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1)
ENDIF()
set(CPACK_COMPONENTS_ALL emgucv_binary emgucv_source emgucv_example_source)
ENDIF()
# ----------------------------------------------------------------------------
# The source files
# ----------------------------------------------------------------------------
INSTALL(
DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}/lib
DESTINATION .
COMPONENT emgucv_source
FILES_MATCHING
PATTERN "*.dll"
PATTERN "*.txt"
PATTERN "*.xml"
PATTERN ".git" EXCLUDE
PATTERN "obj" EXCLUDE
PATTERN "CMake*" EXCLUDE
PATTERN "Release" EXCLUDE
PATTERN "${PROJECT_NAME}.dir" EXCLUDE
)
# ----------------------------------------------------------------------------
# The example files
# ----------------------------------------------------------------------------
INSTALL(
DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}/Emgu.CV.Example
DESTINATION .
COMPONENT emgucv_example_source
FILES_MATCHING
PATTERN "*.cs"
PATTERN "*.csproj"
PATTERN "*.resx"
PATTERN "*.h"
PATTERN "*.cpp"
PATTERN "*.resX"
PATTERN "*.ico"
PATTERN "*.rc"
PATTERN "CPlusPlus/*.vcproj"
PATTERN "CPlusPlus/*.vcxproj"
PATTERN "*.vb"
PATTERN "*.vbproj"
PATTERN "*.aspx"
PATTERN "*.dll"
PATTERN "*.txt"
PATTERN "*.xml"
PATTERN "*.xaml"
PATTERN "*.jpg"
PATTERN "*.png"
PATTERN "*.settings"
PATTERN "*.config"
PATTERN "tessdata/*"
PATTERN ".git" EXCLUDE
PATTERN "obj" EXCLUDE
PATTERN "CMake*" EXCLUDE
PATTERN "Release" EXCLUDE
PATTERN "Debug" EXCLUDE
PATTERN "*.dir" EXCLUDE
PATTERN "Android" EXCLUDE
PATTERN "iOS" EXCLUDE
)
INSTALL(
FILES
"${OPENCV_SUBFOLDER}/data/haarcascades/haarcascade_frontalface_default.xml"
"${OPENCV_SUBFOLDER}/data/haarcascades/haarcascade_eye.xml"
DESTINATION opencv/data/haarcascades
COMPONENT emgucv_example_source
)
INSTALL(
FILES
"${OPENCV_CONTRIB_SUBFOLDER}/modules/text/samples/trained_classifierNM1.xml"
"${OPENCV_CONTRIB_SUBFOLDER}/modules/text/samples/trained_classifierNM2.xml"
"${OPENCV_CONTRIB_SUBFOLDER}/modules/text/samples/trained_classifier_erGrouping.xml"
DESTINATION opencv_contrib/modules/text/samples/
COMPONENT emgucv_example_source
)
# ----------------------------------------------------------------------------
# Generate required common assembly file for Emgu CV project
# ----------------------------------------------------------------------------
SET(CPACK_BUNDLE_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos/Info.plist)
FILE(WRITE ${CPACK_BUNDLE_PLIST}
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
<plist version=\"1.0\">
<dict>
<key>CFBundleIdentifier</key>
<string>com.emgu.cv</string>
<key>CFBundleName</key>
<string>${CPACK_BUNDLE_NAME}</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>10.6</string>
</dict>
</plist>")
ELSE() #LINUX
SET(MONO_GACUTIL_EXEC "gacutil")
#SET(LINUX_CONTROL_FILE_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/cmake/linux")
SET(EMGUCV_MANAGED_DLLS "Emgu.CV.Platform.NetStandard" "Emgu.CV.Platform.NetCore")
#SET(CLIFILELIST_CONTENT "")
#FOREACH(MANAGED_DLL ${EMGUCV_MANAGED_DLLS})
# SET(CLIFILELIST_CONTENT "${CLIFILELIST_CONTENT}/usr/${CPACK_PACKAGE_CLI_FOLDER}/${MANAGED_DLL}.dll\n")
#ENDFOREACH()
#FILE(WRITE ${LINUX_CONTROL_FILE_FOLDER}/clifilelist.txt ${CLIFILELIST_CONTENT})
#INSTALL(
# FILES
# ${LINUX_CONTROL_FILE_FOLDER}/clifilelist.txt
# DESTINATION ${CPACK_PACKAGE_CLI_FOLDER}
# COMPONENT emgucv_binary)
#creating the pkg-config file
#SET(PACKAGE_CFG_REF_CONTENT "")
#FOREACH(MANAGED_DLL ${EMGUCV_MANAGED_DLLS})
# SET(PACKAGE_CFG_REF_CONTENT "${PACKAGE_CFG_REF_CONTENT} -r:\${libdir}/${MANAGED_DLL}.dll")
#ENDFOREACH()
#FILE(WRITE ${LINUX_CONTROL_FILE_FOLDER}/${CPACK_PACKAGE_NAME}.pc
# "prefix=/usr\nexec_prefix=\${prefix}\nlibdir=\${exec_prefix}/${CPACK_PACKAGE_CLI_FOLDER}\napidir=\${exec_prefix}/${CPACK_PACKAGE_CLI_FOLDER}\n\nName: ${CPACK_PACKAGE_NAME}\nDescription: ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}\nVersion: ${CPACK_PACKAGE_VERSION}\nLibs: ${PACKAGE_CFG_REF_CONTENT}\n")
#INSTALL(
# FILES
# ${LINUX_CONTROL_FILE_FOLDER}/${CPACK_PACKAGE_NAME}.pc
# DESTINATION /usr/lib/pkgconfig
# COMPONENT emgucv_binary)
#SET(REMOVE_EMGU_FROM_GAC_SCRIPT "")
#FOREACH(MANAGED_DLL ${EMGUCV_MANAGED_DLLS})
# SET(REMOVE_EMGU_FROM_GAC_SCRIPT "${REMOVE_EMGU_FROM_GAC_SCRIPT} ${MANAGED_DLL}")
#ENDFOREACH()
#SET(REMOVE_EMGU_FROM_GAC_SCRIPT "for dll in${REMOVE_EMGU_FROM_GAC_SCRIPT}; do ${MONO_GACUTIL_EXEC} -u $dll; done")
#SET(CPACK_STRIP_FILES "")
IF(NOT CPACK_GENERATOR)
MESSAGE(STATUS "Checking for CPACK build type...")
FIND_PROGRAM(ZIP_CMD zip)
IF (ZIP_CMD)
# ----------------------------------------------------------------------------
# Building .deb package for Debian
# ----------------------------------------------------------------------------
MESSAGE(STATUS "FOUND zip: ${ZIP_CMD}")
LIST(APPEND CPACK_GENERATOR ZIP)
ENDIF()
#FIND_PROGRAM(DPKG_CMD dpkg)
#IF (DPKG_CMD)
# ----------------------------------------------------------------------------
# Building .deb package for Debian
# ----------------------------------------------------------------------------
# MESSAGE(STATUS "FOUND dpkg: ${DPKG_CMD}")
# LIST(APPEND CPACK_GENERATOR DEB)
#ENDIF()
#FIND_PROGRAM(RPMBUILD_CMD rpmbuild)
#IF(RPMBUILD_CMD)
# ----------------------------------------------------------------------------
# Building .rpm package
# ----------------------------------------------------------------------------
# MESSAGE(STATUS "FOUND rpmbuild: ${RPMBUILD_CMD}")
# LIST(APPEND CPACK_GENERATOR RPM)
#ENDIF()
ENDIF()
#SET(PREINST_SCRIPT "#!/bin/sh\nmkdir -p /usr/lib/pkgconfig /usr/${CPACK_PACKAGE_CLI_FOLDER} /usr/share/opencv/haarcascades /usr/share/opencv/lbpcascades /usr/share/opencv/doc \n")
#LIST(FIND CPACK_GENERATOR "DEB" TEMP)
#IF(NOT (${TEMP} EQUAL -1))
# SET(DEBIAN_CONTROL_FILE_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/cmake/debian")
# FILE(WRITE ${DEBIAN_CONTROL_FILE_FOLDER}/preinst ${PREINST_SCRIPT})
# FILE(WRITE ${DEBIAN_CONTROL_FILE_FOLDER}/postinst
# "#!/bin/sh\nset -e\nif [ \"$1\" = \"configure\" ]; then\n ldconfig\n ${MONO_GACUTIL_EXEC} -il /usr/${CPACK_PACKAGE_CLI_FOLDER}/clifilelist.txt -package ${CPACK_PACKAGE_NAME}\nfi\n")
# FILE(WRITE ${DEBIAN_CONTROL_FILE_FOLDER}/prerm
# "#!/bin/sh\nset -e\nif [ \"$1\" = \"remove\" ] || [ \"$1\" = \"upgrade\" ] && [ -x /usr/share/cli-common/gac-package-remove ]; then\n${REMOVE_EMGU_FROM_GAC_SCRIPT}\nfi\n")
# SET(DEBIAN_PACKAGE_PRIORITY "optional")
# SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${DEBIAN_CONTROL_FILE_FOLDER}/preinst;${DEBIAN_CONTROL_FILE_FOLDER}/postinst;${DEBIAN_CONTROL_FILE_FOLDER}/prerm;${DEBIAN_CONTROL_FILE_FOLDER}/postrm")
# SET(CPACK_DEBIAN_PACKAGE_DEPENDS "mono-runtime (>> 2.4.2), mono-2.0-gac, libtiff5, libgeotiff2, libgtk-3-0, libgstreamer1.0-0, libavcodec54, libswscale2, libavformat54, libopenexr6, libjasper1, libdc1394-22, libv4l-0, libqt4-opengl")
# IF(EMGU_CV_WITH_TESSERACT)
# SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libtesseract3")
# ENDIF()
# IF(WITH_TBB)
# SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libtbb2")
# ENDIF()
#ENDIF()
#LIST(FIND CPACK_GENERATOR "RPM" TEMP)
#IF(NOT (${TEMP} EQUAL -1))
# SET(CPACK_RPM_PACKAGE_LICENSE "GPL v3")
# SET(CPACK_RPM_PACKAGE_REQUIRES "mono-core >= 2.6, mono-wcf, jasper, libgeotiff, gtk2, OpenEXR, libv4l, libdc1394, qt")
# IF (WITH_TBB)
# SET(CPACK_RPM_PACKAGE_REQUIRES ", tbb")
# ENDIF()
# IF(EMGUCV_WITH_TESSERACT AND TESSERACT_FOUND)
# SET(CPACK_RPM_PACKAGE_REQUIRES ", tesseract")
# ENDIF()
# SET(RPM_CONTROL_FILE_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/cmake/rpm")
# FILE(WRITE ${RPM_CONTROL_FILE_FOLDER}/preinst ${PREINST_SCRIPT})
# FILE(WRITE ${RPM_CONTROL_FILE_FOLDER}/postinst
# "ldconfig\n${MONO_GACUTIL_EXEC} -il /usr/${CPACK_PACKAGE_CLI_FOLDER}/clifilelist.txt -package ${CPACK_PACKAGE_NAME}\n")
# FILE(WRITE ${RPM_CONTROL_FILE_FOLDER}/prerm
# "${REMOVE_EMGU_FROM_GAC_SCRIPT}\n")
# SET(CPACK_RPM_PRE_INSTALL_SCRIPT_FILE "${RPM_CONTROL_FILE_FOLDER}/preinst")
# SET(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${RPM_CONTROL_FILE_FOLDER}/postinst")
# SET(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE "${RPM_CONTROL_FILE_FOLDER}/prerm")
# SET(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${RPM_CONTROL_FILE_FOLDER}/postrm")
#ENDIF()
ENDIF()
MESSAGE(STATUS "CPACK_GENERATOR: ${CPACK_GENERATOR}")
INCLUDE (CPack)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/qiuqianquan/emgucv.git
git@gitee.com:qiuqianquan/emgucv.git
qiuqianquan
emgucv
emgucv
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385