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()
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
IF(Intl_FOUND AND Intl_LIBRARIES)
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()
CHECK_CXX_SOURCE_COMPILES("
${LIBINTL_INCLUDE}
@ -40,3 +40,4 @@ int main () {
}
"
HAVE__NL_MSG_CAT_CNTR)
CMAKE_POP_CHECK_STATE()