That get_filename_component thing seems quite fragile and hacky to me but he is the expert :-) CCMAIL: neundorf@kde.org svn path=/trunk/KDE/kdegraphics/cmake/modules/; revision=1179984remotes/origin/KDE/4.6
parent
a86bbe9053
commit
64063fe996
4 changed files with 25 additions and 39 deletions
@ -0,0 +1,17 @@ |
||||
# get from the full path to OkularConfig.cmake up to the base dir dir: |
||||
get_filename_component( _okularBaseDir ${CMAKE_CURRENT_LIST_FILE} PATH) |
||||
get_filename_component( _okularBaseDir ${_okularBaseDir} PATH) |
||||
get_filename_component( _okularBaseDir ${_okularBaseDir} PATH) |
||||
get_filename_component( _okularBaseDir ${_okularBaseDir} PATH) |
||||
|
||||
|
||||
# find the full paths to the library and the includes: |
||||
find_path(OKULAR_INCLUDE_DIR okular/core/document.h |
||||
HINTS ${_okularBaseDir}/include |
||||
NO_DEFAULT_PATH) |
||||
|
||||
find_library(OKULAR_CORE_LIBRARY okularcore |
||||
HINTS ${_okularBaseDir}/lib |
||||
NO_DEFAULT_PATH) |
||||
|
||||
set(OKULAR_LIBRARIES ${OKULAR_CORE_LIBRARY}) |
||||
@ -1,38 +0,0 @@ |
||||
# - Find Okular |
||||
# Find the Okular core library |
||||
# |
||||
# This module defines |
||||
# OKULAR_FOUND - whether the Okular core library was found |
||||
# OKULAR_LIBRARIES - the Okular core library |
||||
# OKULAR_INCLUDE_DIR - the include path of the Okular core library |
||||
# |
||||
|
||||
if (OKULAR_INCLUDE_DIR AND OKULAR_LIBRARIES) |
||||
|
||||
# Already in cache |
||||
set (OKULAR_FOUND TRUE) |
||||
|
||||
else (OKULAR_INCLUDE_DIR AND OKULAR_LIBRARIES) |
||||
|
||||
find_library (OKULAR_LIBRARIES |
||||
NAMES |
||||
okularcore |
||||
PATHS |
||||
${LIB_INSTALL_DIR} |
||||
${KDE4_LIB_DIR} |
||||
) |
||||
|
||||
find_path (OKULAR_INCLUDE_DIR |
||||
NAMES |
||||
okular/core/document.h |
||||
PATHS |
||||
${INCLUDE_INSTALL_DIR} |
||||
${KDE4_INCLUDE_DIR} |
||||
) |
||||
|
||||
include(FindPackageHandleStandardArgs) |
||||
find_package_handle_standard_args(Okular DEFAULT_MSG OKULAR_LIBRARIES OKULAR_INCLUDE_DIR) |
||||
|
||||
endif (OKULAR_INCLUDE_DIR AND OKULAR_LIBRARIES) |
||||
|
||||
mark_as_advanced(OKULAR_INCLUDE_DIR OKULAR_LIBRARIES) |
||||
Loading…
Reference in new issue