Geant4 Cross Reference |
1 # - G4FreetypeShim 2 # 3 # Geant4's Geant4Config.cmake file aims to support CMake 3.8 and newer 4 # The Freetype dependency is located through CMake's builtin FindFreetype 5 # module and linked through the Freetype::Freetype imported target. 6 # This target is however only available from CMake 3.10, so recreate 7 # Freetype::Freetype target if it does not exist 8 if(Freetype_FOUND) 9 if(NOT TARGET Freetype::Freetype) 10 add_library(Freetype::Freetype UNKNOWN IMPORTED) 11 set_target_properties(Freetype::Freetype PROPERTIES 12 INTERFACE_INCLUDE_DIRECTORIES "${FREETYPE_INCLUDE_DIRS}") 13 14 if(FREETYPE_LIBRARY_RELEASE) 15 set_property(TARGET Freetype::Freetype APPEND PROPERTY 16 IMPORTED_CONFIGURATIONS RELEASE) 17 set_target_properties(Freetype::Freetype PROPERTIES 18 IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C" 19 IMPORTED_LOCATION_RELEASE "${FREETYPE_LIBRARY_RELEASE}") 20 endif() 21 22 if(FREETYPE_LIBRARY_DEBUG) 23 set_property(TARGET Freetype::Freetype APPEND PROPERTY 24 IMPORTED_CONFIGURATIONS DEBUG) 25 set_target_properties(Freetype::Freetype PROPERTIES 26 IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C" 27 IMPORTED_LOCATION_DEBUG "${FREETYPE_LIBRARY_DEBUG}") 28 endif() 29 30 if(NOT FREETYPE_LIBRARY_RELEASE AND NOT FREETYPE_LIBRARY_DEBUG) 31 set_target_properties(Freetype::Freetype PROPERTIES 32 IMPORTED_LINK_INTERFACE_LANGUAGES "C" 33 IMPORTED_LOCATION "${FREETYPE_LIBRARY}") 34 endif() 35 endif() 36 endif() 37