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

cmake question

Tags: None
(comma "," separated)
yours3lf
Registered Member
Posts
3
Karma
0

cmake question

Fri Jun 29, 2012 12:58 pm
Hi,

I want to use some command line options with cmake. I'm following the gtkmm 3 tutorial:
http://developer.gnome.org/gtkmm-tutorial/3.3/gtkmm-tutorial.html

how can I do this in cmake?
g++ simple.cc -o simple `pkg-config gtkmm-3.0 --cflags --libs`
yours3lf
Registered Member
Posts
3
Karma
0

Re: cmake question

Fri Jun 29, 2012 2:42 pm
ok, kinda solved it, with this CMakeLists.txt it compiles, but it still crashes with this message:
(gtkpractice:5849): GLib-GIO-CRITICAL **: g_application_list_actions: assertion `application->priv->is_registered' failed


code:
Code: Select all
#include <gtkmm.h>

int main( int argc, char* argv[] )
{
  Glib::RefPtr<Gtk::Application> app =
    Gtk::Application::create( argc, argv,
                              "org.gtkmm.examples.base" );

  Gtk::ApplicationWindow window;

  return app->run( window );
}


cmake:
Code: Select all
#cmake ver req
cmake_minimum_required(VERSION 2.6)

set(project_name gtkpractice)

#project name
project(${project_name})

#so that it talks to us
set(CMAKE_VERBOSE_MAKEFILE ON)
add_definitions( "-Wall -Wno-long-long -ansi -pedantic" )

if(${CMAKE_BUILD_TYPE} STREQUAL Debug)
  add_definitions("-DDebug")
  message("Debug mode")
endif(${CMAKE_BUILD_TYPE} STREQUAL Debug)

if(${CMAKE_BUILD_TYPE} STREQUAL Release)
  add_definitions("-DRelease")
  message("Release mode")
endif(${CMAKE_BUILD_TYPE} STREQUAL Release)

add_definitions(`pkg-config gtkmm-3.0 --cflags --libs`)

set(${project_name}_external_libs glademm-2.4 gtkmm-3.0 glade-2.0 glibmm-2.4)

#adding the project's exe
add_executable(${project_name} main)

target_link_libraries(${project_name} ${${project_name}_external_libs})
yours3lf
Registered Member
Posts
3
Karma
0


Bookmarks



Who is online

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