Skip to content

CMake options for custom local OPENCV_SRC_DIR#170

Closed
birarda wants to merge 8 commits into
thp:masterfrom
highfidelity:ext-proj-fixes
Closed

CMake options for custom local OPENCV_SRC_DIR#170
birarda wants to merge 8 commits into
thp:masterfrom
highfidelity:ext-proj-fixes

Conversation

@birarda
Copy link
Copy Markdown
Contributor

@birarda birarda commented Apr 21, 2015

These are a couple of changes we needed to more easily use PSMoveAPI as an external project with CMake.

The OpenCV changes should not affect any existing builds - they allow a caller to specify OPENCV_SRC_DIR to have the PSMoveAPI CMakeLists.txt look elsewhere for OpenCV. You can also specify is OpenCV was built using an in-source build using OPENCV_BUILT_IN_SOURCE.

Comment thread CMakeLists.txt Outdated
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you expose this variable so that an interactive ccmake/cmake-gui shows these options?

http://stackoverflow.com/questions/8709877/cmake-string-options

Should be enough to add something like this to the top of the file (untested):

set(OPENCV_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/opencv" CACHE STRING "Directory where the OpenCV sources are")

@thp
Copy link
Copy Markdown
Owner

thp commented Apr 22, 2015

Basically I'm happy to take this in, but see the two comments to make it easier to discover and set these options via ccmake/cmake-gui.

@birarda
Copy link
Copy Markdown
Contributor Author

birarda commented Apr 22, 2015

I need to double check that the cache set of OPENCV_SRC_DIR can still be overriden - think I may be running into issues now

@birarda birarda changed the title CMake options for custom local OPENCV_SRC_DIR, set of INSTALL_NAME_DIR CMake options for custom local OPENCV_SRC_DIR, Apr 22, 2015
@birarda birarda changed the title CMake options for custom local OPENCV_SRC_DIR, CMake options for custom local OPENCV_SRC_DIR Apr 22, 2015
install OpenCV headers when using local OpenCV
@thp
Copy link
Copy Markdown
Owner

thp commented Apr 23, 2015

Ok, let me know when you have verified that it works for you. Also you might need rebasing, as I just merged #171 from you which touches some lines that this one touches too.

@birarda
Copy link
Copy Markdown
Contributor Author

birarda commented Apr 23, 2015

I may have rebased this wrong - but the diff is right. Let me know if something looks off.

@cboulay
Copy link
Copy Markdown
Contributor

cboulay commented Jun 15, 2015

@thp , if you have time, can you please take a look at this and merge it if appropriate? I need it merged in before I can rebase for my MSVC2013 changes.

@thp thp closed this in 4a3f20c Jun 15, 2015
@thp
Copy link
Copy Markdown
Owner

thp commented Jun 15, 2015

I've squashed the commits and merged it now.

@cboulay
Copy link
Copy Markdown
Contributor

cboulay commented Jul 12, 2015

Edit: Tag @birarda

Sorry to revive this old PR, but what do you mean by 'in-source build'? From the changes you made to CMakeLists.txt, it seems like 'in-source build' just means that you built into the root folder, not a build folder, even though using a build directory is recommended by the OpenCV docs. Should 'in-source-build' really be supported?

I bring this up again because I'm reworking the CMakeLists files and I wanted to know the reason for including this in the first place. I understand you want to re-use an OpenCV that you already have, but why did you build in source?

@birarda
Copy link
Copy Markdown
Contributor Author

birarda commented Jul 22, 2015

Hey @cboulay sorry for my delayed reply to this - we're actually not using psmoveapi anymore so this isn't very fresh in my mind, but I believe this made it possible to more easily setup psmoveapi as a CMake external project.

I was building OpenCV below the psmoveapi external project and getting the psmoveapi external project to find it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants