From c18243638e4ee58ed453154b86493e401d8b1696 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Mon, 10 Sep 2012 21:35:06 +0800 Subject: [PATCH] better searching for fontforge --- CMakeLists.txt | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index edb04eb..792b319 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,20 +21,14 @@ else() message(FATAL_ERROR "Error: cannot locate fontforge.h") endif() -if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") - set(FF_LIB_EXT ".so") -elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - set(FF_LIB_EXT ".dylib") -else() - message("Set FF_LIB_EXT for your platform!") -endif() +set(FF_LIB_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}fontforge${CMAKE_SHARED_LIBRARY_SUFFIX}) -find_library(FF_LIB libfontforge${FF_LIB_EXT}) +find_library(FF_LIB FF_LIB_NAME) if(FF_LIB) - message("Found libfontforge${FF_LIB_EXT}: ${FF_LIB}") + message("Found ${FF_LIB_NAME}: ${FF_LIB}") set(FONTFORGE_LIBRARIES ${FF_LIB}) else() - message(FATAL_ERROR "Error: cannot locate libfontforge${FF_LIB_EXT}") + message(FATAL_ERROR "Error: cannot locate ${FF_LIB_NAME}") endif() message("Looking for libraries of python, which is required by fontforge, if you can link fontforge without python, you may disable this")