Article #834: Using CMake to build an FLTK application

   
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

Return to Articles | Show Comments | Submit Comment ]

Article #834: Using CMake to build an FLTK application

Created at 08:36 Aug 10, 2008 by engelsman

Last modified at 11:54 Apr 19, 2014

The application is in src/foo.cxx, the user interface is defined in src/ui.fl and the callbacks are defined in src/callbacks.cxx.

CMakeLists.txt:

    CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

    PROJECT(example)

    FIND_PACKAGE(FLTK REQUIRED)
    FIND_PACKAGE(OpenGL REQUIRED)

    ADD_SUBDIRECTORY(src)

src/CMakeLists.txt:

    FLTK_WRAP_UI(Ui ui.fl)
    ADD_LIBRARY(Ui callbacks.cxx ${Ui_FLTK_UI_SRCS})

    ADD_EXECUTABLE(foo foo.cxx)
    ADD_DEPENDENCIES(foo Ui)
    TARGET_LINK_LIBRARIES(foo Ui)
    TARGET_LINK_LIBRARIES(foo ${FLTK_LIBRARIES})
    TARGET_LINK_LIBRARIES(foo ${OPENGL_LIBRARIES})

See Using CMake to build an FLTK application on the CMake Wiki for the original, much larger, article, that contains additional notes on the CMake constructs used. [This summary is only intended to provide a link from within the FLTK archives]

Listing ]


Comments

Submit Comment ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2012 by Bill Spitzak and others. This project is hosted by Seriss Corporation. Please report site problems to 'erco@seriss.com'.