tpaviot / oce

OpenCASCADE Community Edition (OCE): a community driven fork of the Open CASCADE library.
http://groups.google.com/group/oce-dev
GNU Lesser General Public License v2.1
808 stars 284 forks source link

cmake oce on Mac Catalina missing freetype libraries #719

Open petersktang opened 4 years ago

petersktang commented 4 years ago

I git cloned the repo into local directory "oce" on Mac Catalina, created "build" subdirectory, ran "cmake --build ../build" within the "build" subdirectory, and encountered the below:

Undefined symbols for architecture x86_64:
  "_FT_Done_Face", referenced from:
      Font_FTFont::Release() in Font_FTFont.o
      checkFont(Handle_Font_FTLibrary const&, char const*) in Font_FontMgr.o
  "_FT_Done_FreeType", referenced from:
      Font_FTLibrary::~Font_FTLibrary() in Font_FTLibrary.o
  "_FT_Get_Kerning", referenced from:
      Font_FTFont::AdvanceX(unsigned int) in Font_FTFont.o
      Font_FTFont::AdvanceY(unsigned int) in Font_FTFont.o
  "_FT_Init_FreeType", referenced from:
      Font_FTLibrary::Font_FTLibrary() in Font_FTLibrary.o
  "_FT_Load_Char", referenced from:
      Font_FTFont::loadGlyph(unsigned int) in Font_FTFont.o
      Font_FTFont::RenderGlyph(unsigned int) in Font_FTFont.o
  "_FT_New_Face", referenced from:
      Font_FTFont::Init(NCollection_UtfString<char> const&, unsigned int, unsigned int) in Font_FTFont.o
      checkFont(Handle_Font_FTLibrary const&, char const*) in Font_FontMgr.o
  "_FT_Select_Charmap", referenced from:
      Font_FTFont::Init(NCollection_UtfString<char> const&, unsigned int, unsigned int) in Font_FTFont.o
      checkFont(Handle_Font_FTLibrary const&, char const*) in Font_FontMgr.o
  "_FT_Set_Char_Size", referenced from:
      Font_FTFont::Init(NCollection_UtfString<char> const&, unsigned int, unsigned int) in Font_FTFont.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

It seems include_directories(${FREETYPE_INCLUDE_DIRS}) and target_link_libraries(mycad ${FREETYPE_LIBRARIES}) are not effective.

"cmake -LA --build ../build .. | grep FREETYPE" returns

FREETYPE_INCLUDE_DIR_freetype2:PATH=/usr/local/include/freetype2
FREETYPE_INCLUDE_DIR_ft2build:PATH=/Library/Frameworks/Mono.framework/Headers
FREETYPE_LIBRARY_DEBUG:FILEPATH=FREETYPE_LIBRARY_DEBUG-NOTFOUND
FREETYPE_LIBRARY_RELEASE:FILEPATH=/usr/local/lib/libfreetype.dylib