help with cmake macro

Farkas Levente lfarkas at lfarkas.org
Wed Jun 22 22:47:03 UTC 2011


hi,
i try to package opencv for mingw which use cmake. when i try to build
it i need to add a few params, but i can't do it, because:
%mingw_cmake "-DENABLE_OPENMP=1"
but during the build it runs:
 /usr/bin/cmake -DCMAKE_VERBOSE_MAKEFILE=ON
-DCMAKE_INSTALL_PREFIX:PATH=/usr/i686-w64-mingw32/sys-root/mingw
-DCMAKE_INSTALL_LIBDIR:PATH=/usr/i686-w64-mingw32/sys-root/mingw/lib
-DINCLUDE_INSTALL_DIR:PATH=/usr/i686-w64-mingw32/sys-root/mingw/include
-DLIB_INSTALL_DIR:PATH=/usr/i686-w64-mingw32/sys-root/mingw/lib
-DSYSCONF_INSTALL_DIR:PATH=/usr/i686-w64-mingw32/sys-root/mingw/etc
-DSHARE_INSTALL_PREFIX:PATH=/usr/i686-w64-mingw32/sys-root/mingw/share
-DCMAKE_SKIP_RPATH:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON
-DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/toolchain-mingw32.cmake ..
-DENABLE_OPENMP=1

as you can see the path is NOT the last param which cause problems:-)
actually i don't understand it since mingw32_cmake defined as:

%mingw32_cmake() %{mingw32_env} ; \
  __mingw32_topdir=.; if ! test -f CMakeLists.txt; then
__mingw32_topdir=..; fi; \\\
  %__cmake \\\
        -DCMAKE_VERBOSE_MAKEFILE=ON \\\
        -DCMAKE_INSTALL_PREFIX:PATH=%{mingw32_prefix} \\\
        -DCMAKE_INSTALL_LIBDIR:PATH=%{mingw32_libdir} \\\
        -DINCLUDE_INSTALL_DIR:PATH=%{mingw32_includedir} \\\
        -DLIB_INSTALL_DIR:PATH=%{mingw32_libdir} \\\
        -DSYSCONF_INSTALL_DIR:PATH=%{mingw32_sysconfdir} \\\
        -DSHARE_INSTALL_PREFIX:PATH=%{mingw32_datadir} \\\
        %{?_cmake_skip_rpath} \\\
        -DBUILD_SHARED_LIBS:BOOL=ON \\\
        -DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/toolchain-mingw32.cmake \\\
        $* $__mingw32_topdir

where the __mingw32_topdir is the last param so when it's called why not
the last param?

any help would be useful.
thanks.

-- 
  Levente                               "Si vis pacem para bellum!"


More information about the mingw mailing list