[OpendTect_Developers] CMake Help

Kristofer Tingdahl kristofer.tingdahl at dgbes.com
Thu Apr 19 07:59:04 CEST 2012


Dear OpendTect coders!

Following our new development release, I got the question how one can
add dependencies to external libs. The question was about flexlm and
QT.


1. With QT, you can do a couple of things. Our cmake macros has
support to include them, and the easiest way to do that is to set the
variable:

SET( OD_USEQT Gui ) before running the OD_INIT_MODULE() macro. The
possible values of the OD_USEQT variable are: Core Sql Gui and OpenGL.

This will probably generate an error initially, as qt cannot be found.
This is then done by setting the QTDIR parameter, for example
c:\qt-win-opensource-src-4.5.3. This is easiest done in the cmake-gui,
where you search for the QTDIR parameter and set it.

2. FLEXLM

If you want to integrate external libraries, you can either use
CMake's internal things, such as find_package and so forth. For most,
it will be possible to do the following in before the OD_INIT_MODULE()
macro call:

SET ( OD_MODULE_EXTERNAL_LIBS c:\PATH\TO\flexlm.lib )

and

SET ( OD_MODULE_INCLUDEPATH c:\path\to\flexlm\inlude\files )

These two settings will make the compiler include the library in the
dependency list of your library or your executable (only if there is
no library) and add the include-path to the compilation so the header
files will be found.



As this is a pre-release, we want to have your input on what's not
working, or simple things that will make your life easier in our new
make system. Let us know at support at opendtect.org. General discussions
can be held on the developers' mailing list.



Happy coding.


-- 
Kristofer Tingdahl, Ph. D.
CEO
dGB Earth Sciences
http://www.dgbes.com





More information about the Developers mailing list