Hi again,

CMake does not seem to like me today. I've set up my
KDEGamesConfig.cmake files, and tried to compile a test application
against the installed library. I'm attaching the CMakeLists.txt for
the test application at the end of the mail for reference (after the
scissor line).

As explained on [1], I'm now installing four new files from the
libkdegames tree (according to install_manifest.txt):

    ${DATA_INSTALL_DIR}/cmake/modules/KDEGamesConfig.cmake
    ${DATA_INSTALL_DIR}/cmake/modules/KDEGamesConfigVersion.cmake
    ${DATA_INSTALL_DIR}/cmake/modules/KDEGamesLibraryDepends.cmake
    
${DATA_INSTALL_DIR}/cmake/modules/KDEGamesLibraryDepends-relwithdebinfo.cmake

Now when I'm compiling the test application, it seems to find the
KDEGames package, but it gets the include paths completely wrong:

    KDEGAMES_INCLUDE_DIR =
/home/tmp/build/home/stefan/Code/kde/git-kdegames/libkdegames/../../../../../include

That's right. It's looking in the build directory of libkdegames. How
can it possibly know about this directory?!? Why should a build
directory be included in any search paths? I have double-checked it;
the CMake run for the test application picks up the CMake config file
at

    
/home/tmp/build/home/stefan/Code/kde/git-kdegames/libkdegames/KDEGamesConfig.cmake

instead of

    /usr/share/kde4/apps/cmake/modules/KDEGamesConfig.cmake

although nothing in the installed CMake files references the build
directory. What the heck?

Greetings
Stefan

[1] 
http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file

------8<------8<------8<------8<------8<------8<------8<------8<------8<------8<------8<------8<------

project(kdegames-thirdparty-buildsystem)

find_package(KDE4 REQUIRED)
include(KDE4Defaults)
find_package(KDEGames REQUIRED)

message(STATUS "CMAKE_MODULE_PATH = ${CMAKE_MODULE_PATH}")
message(STATUS "KDEGAMES_CMAKE_DIR = ${KDEGAMES_CMAKE_DIR}")
message(STATUS "KDEGAMES_INCLUDE_DIRS = ${KDEGAMES_INCLUDE_DIRS}")
add_definitions(${QT4_DEFINITIONS} ${KDE4_DEFINITIONS})
include_directories(${KDE4_INCLUDES} ${KDEGAMES_INCLUDE_DIRS})

kde4_add_executable(myexecutable main.cpp)
target_link_libraries(myexecutable ${KDEGAMES_LIBRARY})

install(TARGETS myexecutable ${INSTALL_TARGETS_DEFAULT_ARGS})

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

Reply via email to