Article #834: Using CMake to build an FLTK application

GitHub FLTK Project   FLTK News RSS Feed  
  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 05:36 Aug 10, 2008 by engelsman

Last modified at 11:56 Mar 08, 2021

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]

  • Disclaimer: These articles are outdated. Please refer to README.CMake.txt.

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})

Listing ]


Comments

Submit Comment ]

From engelsman, 02:32 Dec 30, 2020 (score=3)

The original article at http://www.cmake.org/Wiki/CMakeForFLTK has been moved, unchanged,
to https://gitlab.kitware.com/cmake/community/-/wikis/doc/tutorials/ForFLTK

You will find more up-to-date information in the README.CMake.txt file in FLTK-1.4.x

.
Reply ]

From SamuelMarks, 00:23 Apr 12, 2021 (score=3)

For a simple vcpkg example see https://github.com/microsoft/vcpkg/issues/17053
Reply ]

 
 

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