Yoshi
Yoshi

Reputation: 691

Telling CMake where to find z.lib in Windows

Disclaimer: I'm no software engineer or programmer. I just know enough to get myself in trouble. Please forgive any misused or inaccurate terms.

I'm currently trying to test my HDF5 installation using the in-built Example test scripts. These are organised by CMake and compiled by gcc (MinGW and MinGW-w64). When I go to execute the test script:

ctest -S HDF518_Examples.cmake -C Release -V -O test.log

I'm met with pages and pages of errors, the core of these being:

mingw32-make.exe[2]: *** No rule to make target 'C:/aroot/stage/Library/lib/z.lib', needed by 'bin/h5ex_d_compact.exe'.  Stop.

From my hours of trying to fix this on my own, I've been able to work out that z.lib is a library file part of the ZLIB library, ubiquitous these days. I also know that I have at least one copy of this particular file in my Anaconda directory under /Library/lib/.

I have two questions:

1) How can I get CMake or MinGW to recognize where this file is, and hence stop this error? Is there an environment variable I can set, or a config file I can modify?

2) As an aside, where did this path come from? There is no C:/aroot/ directory on my computer. I've also been unable to find any generators for this path in any of the CMake, HDF5, or MinGW files. So why is CMake pointing to this faux-directory?

Any help would be appreciated.

Upvotes: 0

Views: 463

Answers (1)

arun
arun

Reputation: 72

I use ENVIRONMENT PATH in set_tests_properties to specify the dependent external libraries.

set_tests_properties(${Testname} PROPERTIES  ENVIRONMENT             
                      PATH=${/your/zlib/location} 
                      WORKING_DIRECTORY "${/your/working/directory}/") 

Upvotes: 1

Related Questions