alembic/alembic — pull request #14 by jproccia (2014-11-26 17:14:33+00:00)
Title: Windows dll

Hi,

I'm Jean-Patrick Roccia from Isotropix.

I made some developments to handle cross-platform static/dynamic libraries build in Alembic.
The branch has been tested on :
-CentOS 6 x64 (GCC 4.8.2)
-Mac OS X 10.8.5 (GCC 4.2.1)
-Windows 7 x64 (Visual studio 2013)

For each system, Alembic has been built using CMake, in both static/dynamic libraries mode. I've been able to load and visualize our Alembic files with the simple viewer on all systems and configurations.

By default, Alembic is now built in dynamic libraries mode.
In order to switch mode, you have to set the CMake variable ALEMBIC_SHARED_LIBS.
Concretely, if ALEMBIC_SHARED_LIBS is true (default) you will obtain dynamic libraries(.so/.dylib/.dll), else static libraries (.a/.a/.lib).

I also made some adjustments on openexr link flags for windows (when using openexr dll), and other fixes to compile under windows.

Here are my CMake build commands by systems :
- Windows
cmake -G"Visual Studio 12 Win64" ../ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=F:/alembic/install_dir -DGLEW_INCLUDE_DIR=F:/glew-1.11.0/include -DGLEW_LIBRARY=F:/glew-1.11.0/lib/release/x64/glew32s.lib -DGLUT_INCLUDE_DIR=F:/freeglut-2.8.1/include -DGLUT_glut_LIBRARY=F:/freeglut-2.8.1/lib/x64/freeglut.lib -DZLIB_INCLUDE_DIR=F:/zlib-1.2.8/install_dir/include -DZLIB_LIBRARY=F:/zlib-1.2.8/install_dir/lib/zlibstatic.lib -DILMBASE_ROOT=F:/openexr/IlmBase/install_dir -DHDF5_C_LIBRARY=F:/hdf5-1.8.14/install_dir/lib/libhdf5.lib -DHDF5_DIR=F:/hdf5-1.8.14/install_dir/cmake/hdf5 -DBOOST_ROOT=F:/boost_1_55_0 -DALEMBIC_GLEW_LINK_STATIC=1 -DUSE_PRMAN=0 -DUSE_ARNOLD=0 -DUSE_MAYA=0 -DUSE_PYALEMBIC=0 -DALEMBIC_SHARED_LIBS=1

- Mac OS
cmake -G"Unix Makefiles" ../ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install_dir -DZLIB_INCLUDE_DIR=/Users/jproccia/3rdparty/zlib-1.2.8/install_dir/include -DZLIB_LIBRARY=/Users/jproccia/3rdparty/zlib-1.2.8/install_dir/lib/libz.a -DILMBASE_ROOT=/Users/jproccia/3rdparty/ilmbase-2.2.0/install_dir -DHDF5_DIR=/Users/jproccia/3rdparty/hdf5-1.8.14/install_dir/share/cmake/hdf5/ -DBOOST_ROOT=/Users/jproccia/3rdparty/boost_1_55_0/ -DALEMBIC_GLEW_LINK_STATIC=1 -DUSE_PRMAN=0 -DUSE_ARNOLD=0 -DUSE_MAYA=0 -DUSE_PYALEMBIC=0 -DALEMBIC_SHARED_LIBS=1

- Linux
cmake -G"Unix Makefiles" ../ -DCMAKE_INSTALL_PREFIX=/home/jproccia/Code/alembic/install_dir -DCMAKE_BUILD_TYPE=Release -DBOOST_ROOT=/home/jproccia/Code/boost_1_55_0 -DILMBASE_ROOT=/home/jproccia/Code/openexr/IlmBase/install_dir/ -DUSE_PRMAN=0 -DUSE_ARNOLD=0 -DUSE_MAYA=0 -DUSE_PYALEMBIC=0 -DALEMBIC_SHARED_LIBS=1

Hope this will help Alembic community :)