1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0030702: Configuration, CMake - error for iOS build due to searching macos frameworks

Look for UIKit+OpenGLES on iOS instead of AppKit+OpenGL.
This commit is contained in:
kgv 2019-05-24 11:00:35 +03:00 committed by bugmaster
parent f6973d9054
commit 48ba181118
3 changed files with 31 additions and 14 deletions

View File

@ -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()

View File

@ -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

View File

@ -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 {