From f31398e3da191688c2585d3460829d1c6753f6ce Mon Sep 17 00:00:00 2001 From: Jeremy Paul Whiting Date: Thu, 10 Feb 2011 04:19:37 +0000 Subject: [PATCH] make libkdeedu build by itself and install LibKdeEduConfig.cmake to help applications find it, thanks to Niko Sams for the patch svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=1219669 --- CMakeLists.txt | 23 ++++++++++++++- LibKdeEduConfig.cmake.in | 44 ++++++++++++++++++++++++++++ keduvocdocument/CMakeLists.txt | 4 ++- keduvocdocument/tests/CMakeLists.txt | 2 +- 4 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 LibKdeEduConfig.cmake.in diff --git a/CMakeLists.txt b/CMakeLists.txt index a63bc25..9cf71d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,29 @@ -project(libkdeedu) +project(LibKdeEdu) #add_definitions( -Wall -fprofile-arcs -ftest-coverage ) +find_package(KDE4 REQUIRED) +include(KDE4Defaults) +include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES}) + add_subdirectory(keduvocdocument) #add_subdirectory(widgets) add_subdirectory(qtmmlwidget) add_subdirectory(icons) + + +configure_file( "${LibKdeEdu_SOURCE_DIR}/LibKdeEduConfig.cmake.in" "${LibKdeEdu_BINARY_DIR}/LibKdeEduConfig.cmake" @ONLY ) + +if(KDE4_USE_COMMON_CMAKE_PACKAGE_CONFIG_DIR) + set(_LibKdeEdu_CONFIG_DEST "${LIB_INSTALL_DIR}/cmake/libkdeedu") +else(KDE4_USE_COMMON_CMAKE_PACKAGE_CONFIG_DIR) + set(_LibKdeEdu_CONFIG_DEST "${LIB_INSTALL_DIR}/libkdeedu") +endif(KDE4_USE_COMMON_CMAKE_PACKAGE_CONFIG_DIR) + +install( FILES + "${LibKdeEdu_BINARY_DIR}/LibKdeEduConfig.cmake" + DESTINATION "${_LibKdeEdu_CONFIG_DEST}" ) +install( EXPORT LibKdeEduTargets + DESTINATION "${_LibKdeEdu_CONFIG_DEST}" + NAMESPACE LibKdeEduImport__ + FILE LibKdeEduTargets.cmake ) diff --git a/LibKdeEduConfig.cmake.in b/LibKdeEduConfig.cmake.in new file mode 100644 index 0000000..f9f62e4 --- /dev/null +++ b/LibKdeEduConfig.cmake.in @@ -0,0 +1,44 @@ +######################################################################### +# +# LibKdeEdu Configuration File +# +# This file sets various CMake Variables +# +# LIBKDEEDU_INCLUDE_DIR - The Include Directory for all LIBKDEEDU libraries +# LIBKDEEDU_KEDUVOCDOCUMENT_LIBRARIES - the keduvocdocument library +# LIBKDEEDU_KDEEDUUI_LIBRARIES - the kdeeduui library +# +# Copyright 2008 Andreas Pakulat +# Copyright 2010 Niko Sams +# Redistribution and use is allowed according to the terms of the BSD license. +###################################################################### + +get_filename_component(_LIBKDEEDU_CURRENT_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) + +if(NOT WIN32) +# This is needed on non-win32 platforms, as lib-install-dir might be in a +# totally different prefix than include-install-dir. So instead hardcode the +# absolute path during buildtime +set( LIBKDEEDU_INCLUDE_DIR "@INCLUDE_INSTALL_DIR@/libkdeedu" ) + +else(NOT WIN32) + +set( LIBKDEEDU_INCLUDE_DIR "${_LIBKDEEDU_CURRENT_DIR}/../../../include/libkdeedu" ) + +endif(NOT WIN32) + +if( NOT TARGET LibKdeEduImport__keduvocdocument ) + include("${_LIBKDEEDU_CURRENT_DIR}/LibKdeEduTargets.cmake") +endif( NOT TARGET LibKdeEduImport__keduvocdocument ) + +macro( _libkdeedu_set_lib_vars _prefix _lib ) + set( LIBKDEEDU_${_prefix}_LIBRARIES LibKdeEduImport__${_lib} ) +endmacro( _libkdeedu_set_lib_vars ) + +_libkdeedu_set_lib_vars( KEDUVOCDOCUMENT keduvocdocument ) +_libkdeedu_set_lib_vars( KDEEDUUI kdeeduui ) + + +mark_as_advanced( + KEDUVOCDOCUMENT +) diff --git a/keduvocdocument/CMakeLists.txt b/keduvocdocument/CMakeLists.txt index df9c5d7..97ead8c 100644 --- a/keduvocdocument/CMakeLists.txt +++ b/keduvocdocument/CMakeLists.txt @@ -46,7 +46,7 @@ set_target_properties(keduvocdocument # SOVERSION ${LIB_KEDUVOCDOCUMENT_SOVERSION} #) -install(TARGETS keduvocdocument ${INSTALL_TARGETS_DEFAULT_ARGS}) +install(TARGETS keduvocdocument EXPORT LibKdeEduTargets ${INSTALL_TARGETS_DEFAULT_ARGS}) ########### install files ############### @@ -68,5 +68,7 @@ install(FILES keduvocwordtype.h keduvocpersonalpronoun.h sharedkvtmlfiles.h + keduvocdeclension.h + keduvockvtml2writer.h DESTINATION ${INCLUDE_INSTALL_DIR}/libkdeedu COMPONENT Devel ) diff --git a/keduvocdocument/tests/CMakeLists.txt b/keduvocdocument/tests/CMakeLists.txt index da4064f..f05b787 100644 --- a/keduvocdocument/tests/CMakeLists.txt +++ b/keduvocdocument/tests/CMakeLists.txt @@ -9,7 +9,7 @@ target_link_libraries(keduvocdocumentvalidatortest keduvocdocument # CONVERTER: -include_directories( ${CMAKE_SOURCE_DIR}/libkdeedu/keduvocdocument/ ) +include_directories( .. ) ########### next target ############### -- 2.47.3