2006-06-11 11:57:25 +00:00
# - Try to find ASPELL
# Once done this will define
#
2006-06-15 15:11:25 +00:00
# ASPELL_FOUND - system has ASPELL
# ASPELL_INCLUDE_DIR - the ASPELL include directory
# ASPELL_LIBRARY - The libraries needed to use ASPELL
# ASPELL_DEFINITIONS - Compiler switches required for using ASPELL
2006-06-11 11:57:25 +00:00
#
2006-06-15 15:11:25 +00:00
if ( WIN32 )
file ( TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _program_FILES_DIR )
endif ( WIN32 )
if ( ASPELL_INCLUDE_DIR AND ASPELL_LIBRARY )
# Already in cache, be silent
set ( ASPELL_FIND_QUIETLY TRUE )
endif ( ASPELL_INCLUDE_DIR AND ASPELL_LIBRARY )
2006-06-11 11:57:25 +00:00
FIND_PATH ( ASPELL_INCLUDE_DIR aspell.h
2006-06-15 15:11:25 +00:00
/ u s r / i n c l u d e
/ u s r / l o c a l / i n c l u d e
/ u s r / l o c a l / i n c l u d e / a s p e l l
$ { _ p r o g r a m _ F I L E S _ D I R } / g n u w i n 3 2 / i n c l u d e
2006-06-11 11:57:25 +00:00
)
2006-06-15 15:11:25 +00:00
FIND_LIBRARY ( ASPELL_LIBRARY_RELEASE NAMES aspell aspell-15
P A T H S
/ u s r / l i b
/ u s r / l o c a l / l i b
2006-06-11 11:57:25 +00:00
)
2006-06-15 15:11:25 +00:00
# msvc makes a difference between debug and release
if ( MSVC )
find_library ( ASPELL_LIBRARY_DEBUG NAMES aspelld
P A T H S
$ { _ p r o g r a m _ F I L E S _ D I R } / k d e w i n 3 2 / l i b )
if ( MSVC_IDE )
if ( NOT ASPELL_LIBRARY_DEBUG OR NOT ASPELL_LIBRARY_RELEASE )
SET ( ASPELL_LIBRARY )
else ( NOT ASPELL_LIBRARY_DEBUG OR NOT ASPELL_LIBRARY_RELEASE )
SET ( ASPELL_LIBRARY optimized ${ ASPELL_LIBRARY_RELEASE } debug ${ ASPELL_LIBRARY_DEBUG } )
endif ( NOT ASPELL_LIBRARY_DEBUG OR NOT ASPELL_LIBRARY_RELEASE )
else ( MSVC_IDE )
string ( TOLOWER ${ CMAKE_BUILD_TYPE } CMAKE_BUILD_TYPE_TOLOWER )
if ( CMAKE_BUILD_TYPE_TOLOWER MATCHES debug )
set ( ASPELL_LIBRARY ${ ASPELL_LIBRARY_DEBUG } )
else ( CMAKE_BUILD_TYPE_TOLOWER MATCHES debug )
set ( ASPELL_LIBRARY ${ ASPELL_LIBRARY_RELEASE } )
endif ( CMAKE_BUILD_TYPE_TOLOWER MATCHES debug )
endif ( MSVC_IDE )
else ( MSVC )
set ( ASPELL_LIBRARY ${ ASPELL_LIBRARY_RELEASE } )
endif ( MSVC )
2006-06-11 11:57:25 +00:00
2006-06-15 15:11:25 +00:00
if ( ASPELL_INCLUDE_DIR AND ASPELL_LIBRARY )
set ( ASPELL_FOUND TRUE )
endif ( ASPELL_INCLUDE_DIR AND ASPELL_LIBRARY )
2006-06-11 11:57:25 +00:00
if ( ASPELL_FOUND )
2006-06-15 15:11:25 +00:00
if ( NOT ASPELL_FIND_QUIETLY )
message ( STATUS "Found ASPELL: ${ASPELL_LIBRARY}" )
endif ( NOT ASPELL_FIND_QUIETLY )
2006-06-11 11:57:25 +00:00
else ( ASPELL_FOUND )
2006-06-15 15:11:25 +00:00
if ( ASPELL_FIND_REQUIRED )
message ( "aspell header : ${ASPELL_INCLUDE_DIR}" )
message ( "aspell lib release : ${ASPELL_LIBRARY_RELEASE}" )
message ( "aspell lib debug : ${ASPELL_LIBRARY_DEBUG}" )
if ( MSVC_IDE )
# the ide needs the debug and release version
if ( NOT ASPELL_LIBRARY_DEBUG OR NOT ASPELL_LIBRARY_RELEASE )
message ( FATAL_ERROR "\nCould NOT find the debug AND release version of the aspell library.\nYou need to have both to use MSVC projects.\nPlease build and install both kdelibs/win/ libraries first.\n" )
endif ( NOT ASPELL_LIBRARY_DEBUG OR NOT ASPELL_LIBRARY_RELEASE )
endif ( MSVC_IDE )
message ( FATAL_ERROR "Could NOT find ASPELL" )
endif ( ASPELL_FIND_REQUIRED )
2006-06-11 11:57:25 +00:00
endif ( ASPELL_FOUND )
2006-06-15 15:11:25 +00:00
MARK_AS_ADVANCED ( ASPELL_INCLUDE_DIR ASPELL_LIBRARY )