
Hello,
I've uploaded the full tarball of libsmi late july 2009 + CMake build system to my website. It's not just one CMakeLists.txt but a few CMakeLists.txt and a few parametrized .cmake files, similar to the .in files for autotools. The "TODOs" at the top of the main CMakeLists.txt are probably outdated.
To build it:
1. Download and install CMake form http://www.cmake.org or your favorite distribution 2. Download $ wget http://elpauer.org/tmp/libsmi-latejuly09-cmake.tar.bz2 3. Untar $ tar xf libsmi-latejuly09-cmake.tar.bz2 4. Create build directory for out-of-source build $ mkdir build $ cd build 5. Configure $ cmake ../libsmi-latejuly09-cmake 6. Build $ make
You can change options using "ccmake ." (on Unix-based systems) or "cmake-gui ." (on Unix-based systems and Windows). I implemented the very same options that were available at the time with autotools:
OPTION( BACKEND_SMI "SMIv1/v2 parser support" ON ) OPTION( BACKEND_SMING "SMIng parser support" OFF ) SET( MIBDIR "${CMAKE_INSTALL_PREFIX}/share/mibs" CACHE PATH "Where to install libsmi MIB modules [MIBDIR/mibs]" ) SET( PIBDIR "${CMAKE_INSTALL_PREFIX}/share/pibs" CACHE PATH "Where to install libsmi PIB modules [PIBDIR/pibs]" ) SET( DEFAULT_ERRORLEVEL 3 CACHE STRING "Default error level at libsmi initialization" ) SET( DEFAULT_GLOBALCONFIG "${CMAKE_INSTALL_PREFIX}/smi.conf" CACHE STRING "Full pathname of the global configuration file" ) SET( DEFAULT_SMIPATH "${MIBDIR}/ietf;${MIBDIR}/iana;${MIBDIR}/irtf;${MIBDIR}/site:${MIBDIR}/tubs:${PIBDIR}/ietf:${PIBDIR}/site:${PIBDIR}/tubs" CACHE STRING "Default search path to lookup SMI module files" ) SET( DEFAULT_USERCONFIG ".smirc" CACHE STRING "Basename of the per-user configuration file searched in $HOME" ) IF( WIN32 ) SET( _PATH_SEPARATOR ";" ) ELSE( WIN32 ) SET( _PATH_SEPARATOR ":" ) ENDIF( WIN32 ) SET( PATH_SEPARATOR "${_PATH_SEPARATOR}" CACHE STRING "Default path separator character" )
SET( MAX_LEX_DEPTH 30 CACHE STRING "Maximum module import recursion depth" )
Of course you can also set the value for an option directly on CMake invocation:
$ cmake -DBACKEND_SMI:BOOL=OFF -DBACKEND_SMING:BOOL=ON -DDEFAULT_ERRORLEVEL=2 -DMAX_LEX_DEPTH=20 ../libsmi-latejuly09-cmake
etc
On Tue, Dec 29, 2009 at 11:42 AM, Claus Klein claus.klein@arcormail.de wrote:
Hi,
I would be interested to use CMake. I have bin started with CMake a view years ago and we use it for our project to. If you send me the CMakeLists.txt files, I will check it on MAC, cygwin and MSVC the next week.
If WIN32 is a Target too, in my experience, CMAKE are better than GNU autotools.
PS: I used the c:\usr prefix because the net-snmp WIN32 binary distribution use this prefix too.
//claus
On 28.12.2009, at 22:04, Pau Garcia i Quiles wrote:
On Mon, Dec 28, 2009 at 8:56 PM, Juergen Schoenwaelder j.schoenwaelder@jacobs-university.de wrote:
On Sat, Dec 26, 2009 at 12:10:53PM +0100, Claus Klein wrote:
I had to build libsmi with MSVC 2005 and had some little problems to build it from last released distribution.
I have tried to incorporate the changes as far as I understood them. The change of the installation target from c:\smi to a more Unix style c:\usr installation setup I think first needs agreement by the Windows users on this list. So any comments on the suggested change below?
config.nmake change default install path and add missing install dir:
MIBROOT = c:/usr/share/smi/mibs PIBROOT = c:/usr/share/smi/pibs INSTROOT = c:\usr INCDIR = $(INSTROOT)\include
I also might have missed something else; please check and send me a unified context diff.
Somewhat related to this: I have a CMake build system for libsmi, which works on Linux and Windows. It should work on other platforms, too, but I have not tried.
Instead of maintaining two build systems (one for Unix, one for Windows), only one (the CMake one) would have to be maintained. See http://www.elpauer.org/stuff/learning_cmake.pdf if you don't know CMake (slide 10 shows the workflow with CMake).
It's a bit outdated (I developed it in late-July) but I could update it if you are interested in replacing autotools + NMake with CMake.
-- Pau Garcia i Quiles http://www.elpauer.org (Due to my workload, I may need 10 days to answer)
-- !! This message is brought to you via the `libsmi' mailing list. !! Please do not reply to this message to unsubscribe. To unsubscribe or adjust !! your settings, send a mail message to libsmi-request@ibr.cs.tu-bs.de !! or look at https://mail.ibr.cs.tu-bs.de/mailman/listinfo/libsmi.