From 48ba181118ec22a4cc0f12a0732c16049e8c602e Mon Sep 17 00:00:00 2001 From: kgv Date: Fri, 24 May 2019 11:00:35 +0300 Subject: [PATCH] 0030702: Configuration, CMake - error for iOS build due to searching macos frameworks Look for UIKit+OpenGLES on iOS instead of AppKit+OpenGL. --- adm/cmake/occt_csf.cmake | 19 +++++++++++++------ adm/genproj.tcl | 17 +++++++++++------ adm/qmake/OccToolkit.pri | 9 +++++++-- 3 files changed, 31 insertions(+), 14 deletions(-) diff --git a/adm/cmake/occt_csf.cmake b/adm/cmake/occt_csf.cmake index 2946b0d686..025499a807 100644 --- a/adm/cmake/occt_csf.cmake +++ b/adm/cmake/occt_csf.cmake @@ -79,22 +79,29 @@ if (WIN32) set (CSF_objc "objc") # frameworks - find_library (Appkit_LIB NAMES AppKit) - set (CSF_Appkit ${Appkit_LIB}) + if (IOS) + find_library (Appkit_LIB NAMES UIKit) + set (CSF_Appkit ${Appkit_LIB}) + else() + find_library (Appkit_LIB NAMES AppKit) + set (CSF_Appkit ${Appkit_LIB}) + endif() + OCCT_CHECK_AND_UNSET (Appkit_LIB) find_library (IOKit_LIB NAMES IOKit) set (CSF_IOKit ${IOKit_LIB}) - - OCCT_CHECK_AND_UNSET (Appkit_LIB) OCCT_CHECK_AND_UNSET (IOKit_LIB) - if (USE_GLX) + if (IOS) + find_library (OpenGlLibs_LIB NAMES OpenGLES) + set (CSF_OpenGlLibs ${OpenGlLibs_LIB}) + OCCT_CHECK_AND_UNSET (OpenGlLibs_LIB) + elseif (USE_GLX) set (CSF_OpenGlLibs GL) set (CSF_XwLibs "X11 Xext Xmu Xi") else() find_library (OpenGlLibs_LIB NAMES OpenGL) set (CSF_OpenGlLibs ${OpenGlLibs_LIB}) - OCCT_CHECK_AND_UNSET (OpenGlLibs_LIB) endif() diff --git a/adm/genproj.tcl b/adm/genproj.tcl index 147f0fb0e2..0612e47cec 100644 --- a/adm/genproj.tcl +++ b/adm/genproj.tcl @@ -1377,11 +1377,16 @@ proc osutils:csfList { theOS theCsfLibsMap theCsfFrmsMap } { set aLibsMap(CSF_TBB) "" } else { set aLibsMap(CSF_dl) "dl" - if { "$theOS" == "mac" } { + if { "$theOS" == "mac" || "$theOS" == "ios" } { set aLibsMap(CSF_objc) "objc" - set aFrmsMap(CSF_Appkit) "AppKit" + if { "$theOS" == "ios" } { + set aFrmsMap(CSF_Appkit) "UIKit" + set aFrmsMap(CSF_OpenGlLibs) "OpenGLES" + } else { + set aFrmsMap(CSF_Appkit) "AppKit" + set aFrmsMap(CSF_OpenGlLibs) "OpenGL" + } set aFrmsMap(CSF_IOKit) "IOKit" - set aFrmsMap(CSF_OpenGlLibs) "OpenGL" set aFrmsMap(CSF_TclLibs) "Tcl" set aLibsMap(CSF_TclLibs) "" set aFrmsMap(CSF_TclTkLibs) "Tk" @@ -2670,7 +2675,7 @@ proc OS:xcodeproj { theModules theOutDir theGuidsMap theLibType thePlatform} { } # Generates dependencies section for Xcode project files. -proc osutils:xcdtk:deps {theToolKit theTargetType theGuidsMap theFileRefSection theDepsGuids theDepsRefGuids theIsStatic} { +proc osutils:xcdtk:deps {theToolKit theTargetType theGuidsMap theFileRefSection theDepsGuids theDepsRefGuids thePlatform theIsStatic} { upvar $theGuidsMap aGuidsMap upvar $theFileRefSection aFileRefSection upvar $theDepsGuids aDepsGuids @@ -2694,7 +2699,7 @@ proc osutils:xcdtk:deps {theToolKit theTargetType theGuidsMap theFileRefSection } } - osutils:usedOsLibs $theToolKit "mac" aLibs aFrameworks + osutils:usedOsLibs $theToolKit $thePlatform aLibs aFrameworks set aUsedLibs [concat $aUsedLibs $aLibs] set aUsedLibs [concat $aUsedLibs $aFrameworks] foreach tkx $aUsedLibs { @@ -2909,7 +2914,7 @@ proc osutils:xcdtk { theOutDir theToolKit theGuidsMap theIsStatic thePlatform {t } puts $aPbxprojFile [osutils:xcdtk:sources $theToolKit $theTargetType aSrcFileRefSection aGroupSection aPackagesGuids aSrcFileGuids aGuidsMap anIncPaths] - puts $aPbxprojFile [osutils:xcdtk:deps $theToolKit $theTargetType aGuidsMap aDepsFileRefSection aDepsGuids aDepsRefGuids $theIsStatic] + puts $aPbxprojFile [osutils:xcdtk:deps $theToolKit $theTargetType aGuidsMap aDepsFileRefSection aDepsGuids aDepsRefGuids $thePlatform $theIsStatic] # End PBXBuildFile section # Begin PBXFileReference section diff --git a/adm/qmake/OccToolkit.pri b/adm/qmake/OccToolkit.pri index 95391b3a00..385b77d8dd 100644 --- a/adm/qmake/OccToolkit.pri +++ b/adm/qmake/OccToolkit.pri @@ -46,9 +46,14 @@ win32 { } else:mac { CSF_dl = -ldl CSF_objc = -lobjc - CSF_Appkit = -framework AppKit + iphoneos { + CSF_Appkit = -framework UIKit + CSF_OpenGlLibs = -framework OpenGLES + } else { + CSF_Appkit = -framework AppKit + CSF_OpenGlLibs = -framework OpenGL + } CSF_IOKit = -framework IOKit - CSF_OpenGlLibs = -framework OpenGL CSF_TclLibs = -framework Tcl CSF_TclTkLibs = -framework Tk } else { -- 2.20.1