Giter VIP home page Giter VIP logo

ofxcmake's Introduction

ofxCMake Logo

CMake for OpenFrameworks [Vers. 0.2]

ofxCMake enables you to easily compile OpenFrameworks projects using CMake. The primary goal for its creation was to enable the use of Jetbrains' CLion in OF application development, but it should work in any other IDE that supports CMake, as well as in the command line.

This fork was originally created to give almul0's fork of BuildPeter's ofxCMake compatibility with OpenFrameworks 0.10.0, but it has evolved to work in a slightly different way than both.

Tested on macOS 10.11, 10.13, OF "0.10.0" (the master branch as of January 2018).

Usage

Basics:

  1. Clone into [OF DIR]/addons/ofxCMake
  2. Create a project using OF's Project Generator
  3. Copy ofxCMake/project/CMakeLists.txt into your project's folder.
  4. In your copy of CMakeLists.txt:
  5. Verify path of your OF folder.
  6. Set the name of your app.
  7. Open with CLion or compile via terminal.
  • Any .cpp file that is in your project's src folder will automatically be added to the project.

Options

  • If you need to add your own static libraries add its path to the USER_LIBS list.
  • If you need to add your own include directories, use the CMake command include_directories

Addons

ofxCMake splits OF addons between Internal Addons (the ones that are distributed with OF) and External Addons (the ones that aren't).

Using Addons

  • Add the name of the addon you want to use to the OFX_ADDONS_ACTIVE list in CMakeLists.txt. All sources, headers, and libs will be automatically added to your project.

Making your own addons

  1. Create a .cmake file for your addon (e.g. ofxNAME.cmake). Check the supplied templates in ofxCMake/addOns for assistance.
  2. Copy the file into ofxCMake/addOns/external.
  3. Include your addon in ofxCMake/modules/addOnsExternal.cmake โ€“ e.g. include( ${OF_CMAKE_ADDONS}/external/ofxNAME.cmake
  4. You will now be able to use your addon in any OF project.

Using the CLion IDE

  1. Prepare your project as explained above.
  2. Choose via CLion in the 'Open File or Project' the CMakeLists.txt.
  • A prompt might ask, if you want to change the 'project root'. Ignore this.
  • The CLion project files will be saved in a '.idea' folder. If you want, you can ignore that in your git repo.

Development Philosophy

  • The project file CMakeLists.txt is simplified for readability.
  • Modular approach in which each OS has it's own .cmake files.
  • Having all ofxCMake files in the addons folder has the following advantages:
    • Can easily be installed
    • It works within OF's file structure, without having to change anything that isn't supposed to be modified. Thus, OF can be updated easily.

Compatibility

At the moment (Jan 2018) only Mac OS is fully tested.

The infrastructure for other OS's (Linux, Windows) is already set up.

Special Thanks

Avilleret

ofxcmake's People

Contributors

avilleret avatar bahorn avatar c-mendoza avatar d3cod3 avatar jalevine avatar mursisoy avatar saynono avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.