Which "FIND_PACKAGE" sets that variable? 

Inside of the Top level CMakeLists.txt file I have this now.

OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" OFF)
set(H5_BUILT_AS_DYNAMIC_LIB 0)
set(H5_BUILT_AS_STATIC_LIB 1)
SET (LIB_TYPE STATIC)
SET (H5_ENABLE_SHARED_LIB NO)
SET (H5_ENABLE_STATIC_LIB NO)
IF (BUILD_SHARED_LIBS)
  SET (LIB_TYPE SHARED)
  ADD_DEFINITIONS (-DH5_BUILT_AS_DYNAMIC_LIB)
  set(H5_BUILT_AS_DYNAMIC_LIB 1)
  set(H5_BUILT_AS_STATIC_LIB 0)
  SET (H5_ENABLE_SHARED_LIB YES)
ELSE (BUILD_SHARED_LIBS)
  ADD_DEFINITIONS (-DH5_BUILT_AS_STATIC_LIB)
  set(H5_BUILT_AS_DYNAMIC_LIB 0)
  set(H5_BUILT_AS_STATIC_LIB 1)
  SET (H5_ENABLE_STATIC_LIB YES)
  IF (NOT WIN32)
    # should this be a user setting : Everyone uses it anyway ?
    ADD_DEFINITIONS (-DPIC)
  ENDIF (NOT WIN32)
ENDIF (BUILD_SHARED_LIBS)


Then in config/cmake/H5pubconf.h.in I added the following:

/* Defined if HDF5 was built with CMake AND build as a shared library */
#cmakedefine H5_BUILT_AS_DYNAMIC_LIB @H5_BUILT_AS_DYNAMIC_LIB@

/* Defined if HDF5 was built with CMake AND build as a static library */
#cmakedefine H5_BUILT_AS_STATIC_LIB @H5_BUILT_AS_STATIC_LIB@

Which now allows everything to work. I am still confused why the change was 
needed for Debug/Release? Ironically enough I'm the original person to put the 
H5_BUILT_AS_DYNAMIC_LIB flag in the header file because when on windows and 
using CMake in another project that includes HDF5 I needed to be able to better 
figure out how the libraries were built so I could make decisions on what needs 
to be copied into my deployment package.

___________________________________________________________
Mike Jackson                    Principal Software Engineer
BlueQuartz Software                            Dayton, Ohio
[email protected]              www.bluequartz.net

On Nov 20, 2012, at 2:36 PM, Allen D Byrne wrote:

> The problem was that I attempted to allow multiple installs (debug/release, 
> static/dynamic) of hdf5. Everything works great with cmake, because the value 
> is set by the FIND_PACKAGE command. However, I failed to account for the non-
> cmake process. I wanted to eliminate the duplicate include folders that would 
> result from multiple installs.
> 
> What to do with that definition is the issue!
> 
> Allen
> 
> On Tuesday, November 20, 2012 02:04:21 PM Michael Jackson wrote:
>> Hmm
>>  Looking at the H5pubconf.h for the 1.8.9 and 1.8.10 builds it would seem
>> that there were some merge issues maybe? Otherwise why was that definition
>> removed? Not that I run the tests much (I assume if HDF5 is release then
>> all the tests are passing but how would any of the tests run if nothing to
>> can correctly? Odd. Let me take a look. Can we get this into the first
>> patch release if I figure out what went wrong?
>> ___________________________________________________________
>> Mike Jackson                    Principal Software Engineer
>> BlueQuartz Software                            Dayton, Ohio
>> [email protected]              www.bluequartz.net
>> 
>> On Nov 20, 2012, at 1:56 PM, Allen D Byrne wrote:
>>> Mike,
>>> 
>>> Are you using CMake to create the hdf5 library? There is an issue with a
>>> definition that needs to be solved for the next release (the pre-built
>>> binaries have this define in the H5pubconf.h).
>>> Add
>>> 
>>>                   #define H5_BUILT_AS_DYNAMIC_LIB 1
>>> 
>>> in your H5pubconf.h file after building HDF5.
>>> 
>>> Allen
>>> 
>>> On Tuesday, November 20, 2012 10:57:01 AM Michael Jackson wrote:
>>>> Just updated to 1.8.10 by building HDf5 myself with VS2010 as dynamic
>>>> libraries. When compiling my own application against this new build i
>>>> 
>>>> am getting the following errors:
>>>> libDREAM3DLib.lib(StatsData.obj) : error LNK2001: unresolved external
>>>> 
>>>> symbol H5T_NATIVE_UINT16_g
>>>> [C:\Users\mjackson\Workspace\DREAM3D\x64\Tools\H5VoxelToVtk .vcxproj]
>>>> 
>>>> When i switch back to my 1.8.9 build I do not get these errors. is
>>>> there something that needs to get updated in projects that link
>>>> against hdf5 1.8.10 versus 1.8.9?
>>>> 
>>>> thanks for any help
>>>> _________________________________________________________
>>>> Mike Jackson                  [email protected]
>>>> BlueQuartz Software                    www.bluequartz.net
>>>> Principal Software Engineer                  Dayton, Ohio
>>>> 
>>>> _______________________________________________
>>>> Hdf-forum is for HDF software users discussion.
>>>> [email protected]
>>>> http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org


_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Reply via email to