This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Inconsistant CMake Behavior on the same machine

Tags: None
(comma "," separated)
RyanMcCoskrie
Registered Member
Posts
39
Karma
0
OS
Here is one to frustrate all of the CMake gurus out there.

I'm working on three KDE programs that all use CMake as their build system but only one of them picks up the KDE4 settings properly. The CMake file for the program that works reads as follows:

Code: Select all
project(visualshell)

find_package(KDE4 REQUIRED)
if(NOT UNIX)
   message(FATAL_ERROR "Visual Shell only runs in unix like environments")
endif(NOT UNIX)

include_directories(${KDE4_INCLUDES} .)
include("${PROJECT_SOURCE_DIR}/datatypes")
include("${PROJECT_SOURCE_DIR}/widgets")
include("${PROJECT_SOURCE_DIR}/categories")
include("${PROJECT_SOURCE_DIR}/commbuilder")

set(src main.cpp application.cpp)
set(mod datatypes widgets)

add_subdirectory(datatypes)
add_subdirectory(widgets)
add_subdirectory(categories)
add_subdirectory(commbuilder)

option(INSTALL_COMMBUILDER "Install Command Builder" ON)
if(${INSTALL_COMMBUILDER})
   add_definitions(-DCOMMBUIDLER)
endif(${INSTALL_COMMBUILDER})

kde4_add_executable(visualshell ${src})
add_definitions(-DDEBUG)
set_target_properties(visualshell PROPERTIES COMPILE_FLAGS "-fexceptions")
target_link_libraries(visualshell ${mod} ${KDE_UI_LIBS} ${KDE4_KFILE_LIBS})
install(TARGETS visualshell ${INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES visualshell.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
install(FILES visualshell.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps)


(Yes I know it is horrid).

One that is not working reads:

Code: Select all
project(catbuilder)

find_package(KDE4 REQUIRED)

include_directories(${KDE4_INCLUDES} .)

add_subdirectory(widgets)

set(src main.cpp)
set(mod widgets)

kde4_add_executable(catbuilder ${src})
target_link_libraries(catbuilder ${mod} ${KDE4_UI_LIBS})


The problem is that ${KDE4_UI_LIBS} does not have a value. Further
in KDevelop the
Code: Select all
find_package(KDE4 REQUIRED)
line is highlited
as expected for the VisualShell project but not for CatBuilder.

For my third program I have resorted to manually specifying all Qt and KDE
libraries.


Thanks in advance.
pinotree
KDE Developer
Posts
222
Karma
7
OS
RyanMcCoskrie wrote:The problem is that ${KDE4_UI_LIBS} does not have a value.

Yes, because it is the wrong name; the correct name is KDE4_KDEUI_LIBS (given the library is libkdeui.so).


Pino Toscano


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell