patch for CMakeLists.txt (Feature #644)


Added by stathis -- over 14 years ago. Updated over 14 years ago.


Status:Done Start date:
Priority:High Due date:
Assignee:- % Done:

0%

Category:build/install
Target version:-
Difficulty: Pull request:

Description

I have fixed a few issues in the main CMakeLists.txt. My platform is Win XP and Win7 with Visual Studio 2010 (and I have not tested it with other generators, although it should work without a problem). I tend to do out-of-source builds, so I can keep everything clean.

The install functionality of OpenCV I think should be able to create a clean minimal directory structure without any of extraneous files. Most of that works, but there are a few things the attached patch addresses:

(a) the exec_program that creates the win-install and unix-install need not output an error if they already exist.

(b) line 1073 has a typo that prevents from ${THIS_OPENCV_CONFIG_PATH} being properly set (the $ is not escaped as it should be)

(c) The patch properly configures the OpenCVConfig.cmake file into the install destination. It also copies the videoInput library files into the install destination, as well as cvconfig.h into the include/ directory.

This patch is create against r3864.

It would be great if these changes are added to the trunk, it would make life so much easier.

Another improvement that I would consider doing next is to handle the other 3rdparty libraries, which are not copied.


CMakeLists.txt.patch (3.5 kB) stathis --, 2010-11-04 02:35 pm

OpenCVConfig.cmake.in.patch (1.4 kB) stathis --, 2010-11-04 02:35 pm

CMakeLists.txt.2.patch (1.1 kB) stathis --, 2010-11-30 12:53 am


Associated revisions

Revision 0cab986e
Added by Vadim Pisarevsky over 14 years ago

applied patches by sigma (ticket #644)

Revision 1d626194
Added by Marina Kolpakova almost 12 years ago

Merge pull request #644 from jet47:gpu-debayer-mht

History

Updated by stathis -- over 14 years ago

I added a second patch that addresses a double-quoted string variable problem in OpenCVConfig.cmake.in

The approach i took was to allow the variable to be fully configurable outside the .in file, consistent with how the rest of OpenCVConfig.cmake.in is authored.

Updated by stathis -- over 14 years ago

added support for 3rdparty libraries at the install folder. In general I think it would be better to just rewrite and cleanup all that section, and allow proper configuration and copy of files both at in-source builds, as well as installations.

Is it my impression or most of the unix-install/win-install and related parts of the build system are from the older opencv 1.0 version which used to be slightly different?

any comments on the patches, especially problems would be much appreciated, I would really like to get the build system improved.

Updated by Vadim Pisarevsky over 14 years ago

thanks! your patches have been integrated in r4127.
Let Windows users evaluate how well it works :)

  • Status changed from Open to Done
  • (deleted custom field) set to fixed

Updated by stathis -- over 14 years ago

I just attached a second patch that slightly fixes/changes the way OpenCVConfig.cmake is installed. Previously the .in file was configured in the CMAKE_INSTALL_PREFIX the user provided, at configure time. This is wrong conceptually, as installing is a post-build step. It had the side-effect of failing to copy/create OpenCVConfig.cmake in the install dir, if that dir did not exist, which is the case when a user wants to install in a directory that does not already exist.

This patch addresses this problem.

  • Status changed from Done to Cancelled
  • (deleted custom field) deleted (fixed)

Updated by Anatoly Baksheev over 14 years ago

Windows users are not happy with the change. Vote for revert!!

This breask the followin steps:
1) SVN checkout dir to "d:/opecv_svn".
2) Cmake configure & generate to "e:\opencv_build".
3) Build opencv there
4) Open project that uses find_package( OpenCV REQUIRED ) and generate solution.

For the "customer" project, includes are set to "E:\opencv_build\modules\calib3d\include", which is incorrect! Should be
d:\opencv_svn\modules\calib3d\include.

Another warning: CMake automatically finds OpenCVCOnfig.cmake file is the latest location it generated it.

Updated by Anatoly Baksheev over 14 years ago

I checked in the second patch. Steps above work (because the patch fixes rewrite of OpenCVConfig.cmake)

Updated by Vadim Pisarevsky over 14 years ago

the second patch has been committed with some additions in r4280

  • Status changed from Cancelled to Done
  • (deleted custom field) set to fixed

Also available in: Atom PDF