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

CMake error when testing plasmoid

Tags: None
(comma "," separated)
User avatar
Vistaus
Registered Member
Posts
109
Karma
0
OS

CMake error when testing plasmoid

Wed Dec 30, 2009 6:25 pm
So I followed the tutorial for writing plasmoids in C++ to fix the broken Train Clock in kdeplayground. I thought I fixed most of it, but now I get this error:

Code: Select all
CMake Error at CMakeLists.txt:20 (kde4_add_plugin):
  KDE4_ADD_PLUGIN Macro invoked with incorrect arguments for macro named:
  KDE4_ADD_PLUGIN


CMake Error at CMakeLists.txt:21 (target_link_libraries):
  Cannot specify link libraries for target "train-clock" which is not built
  by this project.


-- Configuring incomplete, errors occurred!


What to do about it?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: CMake error when testing plasmoid

Wed Dec 30, 2009 10:42 pm
Code: Select all
SET( icon_mode_srcs
     IconMode.cpp
     CategoryDrawer.cpp
     CategorizedView.cpp
)

KDE4_ADD_PLUGIN(icon_mode ${icon_mode_srcs})


Part of the CMakeLists.txt file will look like this. Can you please post that section?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
Vistaus
Registered Member
Posts
109
Karma
0
OS
This is the whole CMakeLists.txt:

Code: Select all
# Project Needs a name ofcourse
project(train-clock)
 
# Find the required Libaries
find_package(KDE4 REQUIRED)
include(KDE4Defaults)
 
add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
include_directories(
   ${CMAKE_SOURCE_DIR}
   ${CMAKE_BINARY_DIR}
   ${KDE4_INCLUDES}
   )
 
# We add our source code here
set(trainclock_SRCS clock.cpp)
set(trainclock_SRCS clocknumber.cpp)
 
# Now make sure all files get to the right place
kde4_add_plugin(train-clock ${trainclock1_SRCS})
target_link_libraries(train-clock
                      ${KDE4_PLASMA_LIBS} ${KDE4_KDEUI_LIBS})
 
install(TARGETS plasma_applet_train_clock
        DESTINATION ${PLUGIN_INSTALL_DIR})
 
install(FILES plasma-applet-trainclock.desktop
        DESTINATION ${SERVICES_INSTALL_DIR})
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Change these lines to the following:

Code: Select all
set(trainclock_SRCS clock.cpp)
set(trainclock_SRCS clocknumber.cpp)

# Now make sure all files get to the right place
kde4_add_plugin(train-clock ${trainclock1_SRCS})


Will become:
Code: Select all
set(trainclock_SRCS clock.cpp clocknumber.cpp)

# Now make sure all files get to the right place
kde4_add_plugin(train-clock ${trainclock_SRCS})


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
Vistaus
Registered Member
Posts
109
Karma
0
OS

Re: CMake error when testing plasmoid

Fri Jan 01, 2010 10:41 am
Thanks that worked :)
It passes cmake now, but still not make. Have to look into that further.


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]