GithubHelp home page GithubHelp logo

ofxcmake's People

Contributors

avilleret avatar jalevine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ofxcmake's Issues

Internal AddOn libraries not linked

Seems not to link the pre-compiled OF libs correctly for the following addOns:
ofxKinect, ofxOpenCV, ofxAssimpModelLoader

make[3]: *** No rule to make target /Users/sonneundasche/programming/of/addons/ofxOpenCv/libs/opencv/lib/opencv.a', needed by/Users/sonneundasche/programming/of/examples/addons/opencvExample/bin/OpenCvExample.app/Contents/MacOS/OpenCvExample'. Stop.

installation path need to be clarified

from the Readme.md :

  1. Create there a subfolder CMake
  2. Clone or extract the git files and folders into this folder.

But if I'm doing :

$ cd of
$ mkdir CMake 
$ cd CMake 
$ git clone https://github.com/BildPeter/ofxCMake.git

I will have this folder structure :

CMake/
└── ofxCMake
    ├── addOns
    │   ...
    ├── libs
    │   ...
    ├── modules
    │   ...
    ├── ofxCMake_Logo.jpg
    ├── project
    │   └── CMakeLists.txt
    └── README.md

while this seems to be expected by CMakelists.txt :

CMake/
├── addOns
│   ...
├── libs
│   ...
├── modules
│   ...
├── ofxCMake_Logo.jpg
├── project
│   └── CMakeLists.txt
└── README.md

So the command line should be :

$ cd of
$ git clone https://github.com/BildPeter/ofxCMake.git CMake

That's all.

Maybe you can update the Readme.md ?
I don't know which tool your are using to clone.

Quicktime linking to wrong architecture

In ofxAssimpModelLoader, ofxOpenCV:

ld: warning: ignoring file /System/Library/Frameworks//QuickTime.framework/QuickTime, file was built for i386 which is not the architecture being linked (x86_64): /System/Library/Frameworks//QuickTime.framework/QuickTime

cmake config fails on windows

Thank you for this addon!
Just followed the readme steps and tried to compile a simple of example on Windows with:
cmake ..

output:
-- Building for: Visual Studio 14 2015
-- The C compiler identification is MSVC 19.0.24215.1
-- The CXX compiler identification is MSVC 19.0.24215.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at C:/openFrameworks/addons/ofxCMake/modules/openFrameworksWindows.cmake:39 (pkg_check_modules):
Unknown CMake command "pkg_check_modules".
Call Stack (most recent call first):
C:/openFrameworks/addons/ofxCMake/modules/main.cmake:35 (include)
CMakeLists.txt:44 (include)

macOS problem - app structure

Hello,

Thank you for your addon!
I hope this can help to improve it!

this error I get on macOS X when I run compiled application.

/Users/user/Projects/Cpp/myAppCM/MyAppCM/bin/ofApp.app/Contents/MacOS/ofApp
dyld: Library not loaded: @rpath/libopenFrameworksShared.dylib
Referenced from: /Users/user/Projects/Cpp/myAppCM/MyAppCM/bin/ofApp.app/Contents/MacOS/ofApp
Reason: image not found

This is structure of the build.

bin/
└── ofApp.app
    └── Contents
        ├── Frameworks
        │   └── libopenFrameworksShared.dylib
        ├── Info.plist
        └── MacOS
            ├── libfmodex.dylib
            └── ofApp

the same project but working and structure from Xcode build.

└── MyAppCMDebug.app
    └── Contents
        ├── Frameworks
        │   ├── GLUT.framework
        │   │   ├── GLUT -> Versions/Current/GLUT
        │   │   ├── Headers -> Versions/Current/Headers
        │   │   ├── Resources -> Versions/Current/Resources
        │   │   └── Versions
        │   │       ├── A
        │   │       │   ├── GLUT
        │   │       │   ├── Headers
        │   │       │   │   ├── copy.h
        │   │       │   │   ├── extrude.h
        │   │       │   │   ├── glsmap.h
        │   │       │   │   ├── glsmapint.h
        │   │       │   │   ├── glut.h
        │   │       │   │   ├── glutbitmap.h
        │   │       │   │   ├── glutf90.h
        │   │       │   │   ├── glutstroke.h
        │   │       │   │   ├── gutil.h
        │   │       │   │   ├── intersect.h
        │   │       │   │   ├── port.h
        │   │       │   │   ├── rot.h
        │   │       │   │   ├── segment.h
        │   │       │   │   ├── tube.h
        │   │       │   │   ├── tube_gc.h
        │   │       │   │   └── vvector.h
        │   │       │   └── Resources
        │   │       │       ├── Caution.tiff
        │   │       │       ├── English.lproj
        │   │       │       │   ├── GLUT.nib
        │   │       │       │   │   └── objects.nib
        │   │       │       │   ├── GLUTClipboard.nib
        │   │       │       │   │   └── objects.nib
        │   │       │       │   ├── GLUTPreferences.nib
        │   │       │       │   │   └── objects.nib
        │   │       │       │   ├── GLUTUI.strings
        │   │       │       │   └── InfoPlist.strings
        │   │       │       ├── Info.plist
        │   │       │       ├── blankCursor.tiff
        │   │       │       ├── bottomCursor.tiff
        │   │       │       ├── bottomleftCursor.tiff
        │   │       │       ├── bottomrightCursor.tiff
        │   │       │       ├── crossCursor.tiff
        │   │       │       ├── cycleCursor.tiff
        │   │       │       ├── destroyCursor.tiff
        │   │       │       ├── fingerCursor.tiff
        │   │       │       ├── helpCursor.tiff
        │   │       │       ├── leftCursor.tiff
        │   │       │       ├── leftRightCursor.tiff
        │   │       │       ├── rightArrowCursor.tiff
        │   │       │       ├── rightCursor.tiff
        │   │       │       ├── sprayCursor.tiff
        │   │       │       ├── topCursor.tiff
        │   │       │       ├── topleftCursor.tiff
        │   │       │       ├── toprightCursor.tiff
        │   │       │       ├── upDownCursor.tiff
        │   │       │       └── waitCursor.tiff
        │   │       └── Current -> A
        │   └── libfmodex.dylib
        ├── Info.plist
        ├── MacOS
        │   └── MyAppCMDebug
        ├── PkgInfo
        └── Resources
            └── icon-debug.icns

linux: Failure to link, POSITION_INDEPENDENT_CODE is not being recognised.

This is probably a duplicate of #12. I've had luck with using ofxCMake addon for the most part. Apart from the linking stage, even though there lines in configLinux.cmake

set_source_files_properties( ${OF_SOURCE_FILES} PROPERTIES COMPILE_FLAGS "-std=c++11 -Wall -fPIC" )
set_target_properties( of_shared PROPERTIES POSITION_INDEPENDENT_CODE TRUE )

The linker fails with the following errors along the lines of:

/path/to/lib.a: can not be used when making a shared object; recompile with -fPIC

I have additionally tried setting PIC using some options I found on stackoverflow

set(POSITION_INDEPENDENT_CODE ON)

But this made no difference. Any suggestions?

OF, CMake and OSX

Hi,
I would like to implement the CMake approach with OF. I am on OSX, using Vim. There are couple of resources lingering around, but most of them are too complicated and possibly outdated. I have seen your project and I am curios to know about your approach. I am new to OF and I am not very experienced with CMake but I am keen to get this working. Thanks.

Missing GLUT framework from OS X Bundle

Hi there

Thanks for the work on this, really appreciated. I've been trying to build a simple example using Leap Motion outside of the openFrameworks directory structure and worked all the way back to find that it (ofxLeapMotion) requires the GLUT framework. I eventually managed to fix this by adding the following to configApple.cmake:

ADD_CUSTOM_COMMAND(TARGET ${APP_NAME}
POST_BUILD
COMMAND rsync -av --exclude=Headers ${LIB_GLUT} ${PROJECT_SOURCE_DIR}/bin/${APP_NAME}.app/Contents/Frameworks
COMMENT "Custom command: Copying ${LIB_GLUT} to output App Frameworks directory"
)

GLUT is also used by the 3DPrimitivesExample, so built that externally as well. I thought I'd test it by stashing the above change, but got the following cryptic error:

dyld: Library not loaded: @rpath/libopenFrameworksShared.dylib
Referenced from: /Users/davidfee1/myprojects/ofTest/3DPrimitivesExample/bin/3DPrimitivesExample.app/Contents/MacOS/./3DPrimitivesExample
Reason: image not found
Abort trap: 6

Unstashing the changes fixes it and everything runs fine.
Just wondering if you'd encountered this and if there was any better workaround?

Thanks

CMake looking for nonexistent oF source file

Using this on linux leads to the following CMake build errors in CLion:

Cannot find source file:

    /home/jp/openFrameworks/libs/openFrameworks/graphics/ofPolyline.cpp

   Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
  .hxx .in .txx
   Call Stack (most recent call first):
  /home/jp/openFrameworks/addons/ofxCMake/modules/main.cmake:45 (include)
  CMakeLists.txt:44 (include)


CMake Error: Cannot determine link language for target "of_static".
CMake Error: CMake can not determine linker language for target: of_static
CMake Error: CMake can not determine linker language for target: of_shared
CMake Error: Cannot determine link language for target "of_shared".

According to the oF repository, there is no such file ofPolyline.cpp. There is only a header and it still cannot find it.

Not sure the reason for the other errors.

Relative OF_DIRECTORY

Making it possible, to just use the following code:

# ------------------------ OF Path -----------------------
#set( OF_DIRECTORY "../../.." )

In this case, the CMakeLists.txt can simply be copied into current OF file structure and no modification of the absolute path is needed.

Linker error now:
ld: library not found for -l../../../libs/glut/lib/osx/GLUT.framework

ofMesh source file camke error

When I create a new project with the project generator (without plugins) and add the CMakeLists.txt and then open it in clion, there is already an error because of the ofMesh library:

"/Users/cansik/Library/Application Support/JetBrains/Toolbox/apps/CLion/ch-0/181.5281.33/CLion.app/Contents/bin/cmake/bin/cmake" -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /Users/cansik/git/temp/ColorExperiments
-- The C compiler identification is AppleClang 7.3.0.7030029
-- The CXX compiler identification is AppleClang 7.3.0.7030029
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
CMake Error at /Users/cansik/git/libs/openFrameworks/addons/ofxCMake/modules/config.cmake:13 (add_library):
  Cannot find source file:

    /Users/cansik/git/libs/openFrameworks/libs/openFrameworks/3d/ofMesh.cpp

  Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
  .hxx .in .txx
Call Stack (most recent call first):
  /Users/cansik/git/libs/openFrameworks/addons/ofxCMake/modules/main.cmake:45 (include)
  CMakeLists.txt:44 (include)


CMake Error: CMake can not determine linker language for target: of_shared
CMake Error: Cannot determine link language for target "of_shared".
CMake Error: Cannot determine link language for target "of_static".
CMake Error: CMake can not determine linker language for target: of_static
-- Generating done
-- Build files have been written to: /Users/cansik/git/temp/ColorExperiments/cmake-build-debug
Unable to determine product file path for target of_shared. Running and debugging will be unavailable.
Unable to determine product file path for target of_static. Running and debugging will be unavailable.

[Failed to reload]

Windows support?

I'm curious if there is any Windows support for this anymore. I tried to get it working, but I keep getting stuck.

cmake configuration step fails on Linux

here are the steps :

$ cp CMake/project/CMakeLists.txt examples/empty/emptyExample/
$ cd examples/empty/emptyExample/   
$ ls
CMakeLists.txt  src
$ mkdir build
$ cd build/
$ cmake .. -G Ninja
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler using: Ninja
-- Check for working CXX compiler using: Ninja -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Checking for module 'gstreamer-1.0 >= '
--   Found gstreamer-1.0 , version 1.8.2
-- Checking for module 'gstreamer-base-1.0 >= '
--   Found gstreamer-base-1.0 , version 1.8.2
-- Checking for module 'gstreamer-app-1.0 >= '
--   Found gstreamer-app-1.0 , version 1.8.2
-- Checking for module 'gstreamer-audio-1.0 >= '
--   Found gstreamer-audio-1.0 , version 1.8.2
-- Checking for module 'gstreamer-fft-1.0 >= '
--   Found gstreamer-fft-1.0 , version 1.8.2
-- Checking for module 'gstreamer-gl-1.0>=1.5.0'
--   Found gstreamer-gl-1.0, version 1.8.2
-- Checking for module 'gstreamer-mpegts-1.0>=1.4.0'
--   Found gstreamer-mpegts-1.0, version 1.8.2
-- Checking for module 'gstreamer-pbutils-1.0 >= '
--   Found gstreamer-pbutils-1.0 , version 1.8.2
-- Checking for module 'gstreamer-tag-1.0 >= '
--   Found gstreamer-tag-1.0 , version 1.8.2
-- Checking for module 'gstreamer-video-1.0 >= '
--   Found gstreamer-video-1.0 , version 1.8.2
-- Found GStreamer: GSTREAMER_INCLUDE_DIRS;GSTREAMER_LIBRARIES;GSTREAMER_VERSION;GSTREAMER_BASE_INCLUDE_DIRS;GSTREAMER_BASE_LIBRARIES
-- Found OpenAL: /usr/lib/x86_64-linux-gnu/libopenal.so
-- Checking for one of the modules 'alsa'
-- Checking for one of the modules 'cairo'
CMake Error at /home/antoine/lib-src/ofnode/openFrameworks/CMake/modules/configLinux.cmake:10 (add_executable):
  add_executable called with incorrect number of arguments
Call Stack (most recent call first):
  /home/antoine/lib-src/ofnode/openFrameworks/CMake/modules/main.cmake:42 (include)
  CMakeLists.txt:44 (include)


CMake Error at /home/antoine/lib-src/ofnode/openFrameworks/CMake/modules/configLinux.cmake:13 (target_link_libraries):
  Cannot specify link libraries for target "ofApp" which is not built by this
  project.
Call Stack (most recent call first):
  /home/antoine/lib-src/ofnode/openFrameworks/CMake/modules/main.cmake:42 (include)
  CMakeLists.txt:44 (include)


-- Configuring incomplete, errors occurred!
See also "/home/antoine/lib-src/ofnode/openFrameworks/examples/empty/emptyExample/build/CMakeFiles/CMakeOutput.log".

line 10 of configLinux.cmake should be add_executable( ${APP_NAME} ${APP_NAME}_${SOURCE_FILES} ) instead of add_executable( ${APP_NAME} ${SOURCE_FILES} )

but after modifying this I still get an error :

$ cmake .. -G Ninja
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler using: Ninja
-- Check for working CXX compiler using: Ninja -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Checking for module 'gstreamer-1.0 >= '
--   Found gstreamer-1.0 , version 1.8.2
-- Checking for module 'gstreamer-base-1.0 >= '
--   Found gstreamer-base-1.0 , version 1.8.2
-- Checking for module 'gstreamer-app-1.0 >= '
--   Found gstreamer-app-1.0 , version 1.8.2
-- Checking for module 'gstreamer-audio-1.0 >= '
--   Found gstreamer-audio-1.0 , version 1.8.2
-- Checking for module 'gstreamer-fft-1.0 >= '
--   Found gstreamer-fft-1.0 , version 1.8.2
-- Checking for module 'gstreamer-gl-1.0>=1.5.0'
--   Found gstreamer-gl-1.0, version 1.8.2
-- Checking for module 'gstreamer-mpegts-1.0>=1.4.0'
--   Found gstreamer-mpegts-1.0, version 1.8.2
-- Checking for module 'gstreamer-pbutils-1.0 >= '
--   Found gstreamer-pbutils-1.0 , version 1.8.2
-- Checking for module 'gstreamer-tag-1.0 >= '
--   Found gstreamer-tag-1.0 , version 1.8.2
-- Checking for module 'gstreamer-video-1.0 >= '
--   Found gstreamer-video-1.0 , version 1.8.2
-- Found GStreamer: GSTREAMER_INCLUDE_DIRS;GSTREAMER_LIBRARIES;GSTREAMER_VERSION;GSTREAMER_BASE_INCLUDE_DIRS;GSTREAMER_BASE_LIBRARIES
-- Found OpenAL: /usr/lib/x86_64-linux-gnu/libopenal.so
-- Checking for one of the modules 'alsa'
-- Checking for one of the modules 'cairo'
CMake Error at /home/antoine/lib-src/ofnode/openFrameworks/CMake/modules/configLinux.cmake:10 (add_executable):
  add_executable called with incorrect number of arguments
Call Stack (most recent call first):
  /home/antoine/lib-src/ofnode/openFrameworks/CMake/modules/main.cmake:42 (include)
  CMakeLists.txt:44 (include)


CMake Error at /home/antoine/lib-src/ofnode/openFrameworks/CMake/modules/configLinux.cmake:13 (target_link_libraries):
  Cannot specify link libraries for target "ofApp" which is not built by this
  project.
Call Stack (most recent call first):
  /home/antoine/lib-src/ofnode/openFrameworks/CMake/modules/main.cmake:42 (include)
  CMakeLists.txt:44 (include)


-- Configuring incomplete, errors occurred!
See also "/home/antoine/lib-src/ofnode/openFrameworks/examples/empty/emptyExample/build/CMakeFiles/CMakeOutput.log".

cmake config fails on ubuntu

When I compile the project generated with projectGenerator using make it works just fine. But when I add the CMakeLists.txt and compile it based on the description of this project I get this error, I also get this error when I build it with CLion:

[ 95%] Linking CXX shared library ../bin/first1.app/Contents/Frameworks/libopenFrameworks.so
[ 95%] Built target static
/usr/bin/ld: /home/david/projects/OF/libs/poco/lib/linux64/libPocoFoundation.a(Thread.o): relocation R_X86_64_PC32 against symbol `_ZN4Poco10ThreadImpl20_currentThreadHolderE' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
CMakeFiles/of_shared.dir/build.make:222: recipe for target '../bin/first1.app/Contents/Frameworks/libopenFrameworks.so' failed
make[2]: *** [../bin/first1.app/Contents/Frameworks/libopenFrameworks.so] Error 1
CMakeFiles/Makefile2:178: recipe for target 'CMakeFiles/of_shared.dir/all' failed
make[1]: *** [CMakeFiles/of_shared.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

What is wrong? How can I make it work?

I am using CLion 2017.1.3 and OpenFrameworks 0.9.8

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.