Added check to rescan zlib and pthread on linux

unset ZLIB_LIBRARY and CMAKE_HAVE_PTHREAD_H to rescan those libs
when arch changes from 32 to 64 (and vis-versa). There may be a
better way to do this.
develop
David Seguin 2016-09-07 23:28:50 -04:00
parent 8f2cc5bc4d
commit 36b9ee5cf4
1 changed files with 10 additions and 0 deletions

@ -274,6 +274,16 @@ endif()
#### expose depends ####
# check for change in arch (32<->64)
if(UNIX)
GET_PROPERTY(DFHACK_CACHED_ARCH CACHE STRING PROPERTY DFHACK_BUILD_ARCH)
if("${DFHACK_BUILD_ARCH}" STREQUAL "${DFHACK_CACHED_ARCH}")
# no change
else()
unset(ZLIB_LIBRARY CACHE)
unset(CMAKE_HAVE_PTHREAD_H CACHE)
endif()
endif()
# find and make available libz
if(NOT UNIX) # Windows