cmake: use the check state stack for __nl_msg_cat_cntr checks

This commit is contained in:
David Adam 2019-02-19 21:20:31 +08:00
parent 59955391ad
commit d44308388f

View file

@ -23,12 +23,12 @@ IF(GETTEXT_FOUND)
ENDFOREACH() ENDFOREACH()
ENDIF() ENDIF()
CMAKE_PUSH_CHECK_STATE()
SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${Intl_INCLUDE_DIR})
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${Intl_LIBRARIES})
# libintl.h can be compiled into the stdlib on some GLibC systems # libintl.h can be compiled into the stdlib on some GLibC systems
IF(Intl_FOUND AND Intl_LIBRARIES) IF(Intl_FOUND AND Intl_LIBRARIES)
SET(LIBINTL_INCLUDE "#include <libintl.h>") SET(LIBINTL_INCLUDE "#include <libintl.h>")
SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${Intl_INCLUDE_DIR})
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${Intl_LIBRARIES})
ENDIF() ENDIF()
CHECK_CXX_SOURCE_COMPILES(" CHECK_CXX_SOURCE_COMPILES("
${LIBINTL_INCLUDE} ${LIBINTL_INCLUDE}
@ -40,3 +40,4 @@ int main () {
} }
" "
HAVE__NL_MSG_CAT_CNTR) HAVE__NL_MSG_CAT_CNTR)
CMAKE_POP_CHECK_STATE()