I've not had a problem with this before, but I'm having an odd issue where cmake is finding libpng when it doesn't exist on an OSX machine.<div><br></div><div>I'm using Findlibpng.cmake:</div><div><br></div>
<div><div> include(LibFindMacros)</div><div><br></div><div> find_path(LIBPNG_INCLUDE_DIR NAMES png.h PATHS ${LIBPNG_PKGCONF_INCLUDE_DIRS})</div><div><br></div><div> find_library(LIBPNG_LIBRARY NAMES png PATHS ${LIBPNG_PKGCONF_LIBRARY_DIRS})</div>
<div><br></div><div> set(LIBPNG_PROCESS_INCLUDES LIBPNG_INCLUDE_DIR)</div><div> set(LIBPNG_PROCESS_LIBS LIBPNG_LIBRARY LIBPNG_LIBRARIES)</div><div><br></div><div> libfind_process(LIBPNG)</div></div><div><br></div><div>
And in my cmake file:</div><div><br></div><div> FIND_PACKAGE(libpng REQUIRED)</div><div><br></div><div>When I run cmake it says it found LIBPNG (cmake-gui doesn't request I search for the path manually) and when compile it's erroring:</div>
<div><br></div><div> [ 74%] Built target test_sethandler</div><div> make[2]: *** No rule to make target `/usr/local/lib/libpng.dylib', needed by `tests/na/common/test_common'. Stop.</div><div> make[1]: *** [tests/na/common/CMakeFiles/test_common.dir/all] Error 2</div>
<div><br></div><div>The obvious reason is that /usr/local/lib/libpng.dylib doesn't exist:</div><div><br></div><div> arc:mbuild douglasl$ ls /usr/local/lib/ | grep png</div><div> arc:mbuild douglasl$ </div><div><br></div>
<div>But my cmake cache shows:</div><div><br></div><div> LIBPNG_INCLUDE_DIR:PATH=/Library/Frameworks/Mono.framework/Headers</div><div> LIBPNG_LIBRARY:FILEPATH=/usr/local/lib/libpng.dylib</div><div> //ADVANCED property for variable: LIBPNG_INCLUDE_DIR</div>
<div> LIBPNG_INCLUDE_DIR-ADVANCED:INTERNAL=1</div><div> //ADVANCED property for variable: LIBPNG_LIBRARY</div><div> LIBPNG_LIBRARY-ADVANCED:INTERNAL=1</div><div><br></div><div>Can someone shed some light on how cmake is finding that module?</div>
<div><br></div><div>Sounds like the machine config is broken, but I'm not sure exactly how to fix it.</div><div><br></div><div>Cheers,</div><div>Doug.</div>