Bug 28137

Summary: find_package(Gettext) does not set GETTEXT_FOUND nor Gettext_FOUND
Product: Sisyphus Reporter: Ivan A. Melnikov <iv>
Component: cmake-modulesAssignee: Vitaly Lipatov <lav>
Status: CLOSED FIXED QA Contact: qa-sisyphus
Severity: normal    
Priority: P3 CC: lav, zerg
Version: unstable   
Hardware: all   
OS: Linux   

Description Ivan A. Melnikov 2012-11-28 00:22:29 MSK
Комментарий в /usr/share/CMake/Modules/FindGettext.cmake говорит, что в случае, если gettext найден, выставляется переменная GETTEXT_FOUND, и многие проекты на это рассчитывают. Однако ни эта переменная, ни ожидаемая Gettext_FOUND, не выставляются. Тестировал, например, так:

$ cat ../CMakeLists.txt

cmake_minimum_required(VERSION 2.6.0)
find_package(Gettext REQUIRED)

if (GETTEXT_FOUND)
message("found")
else (GETTEXT_FOUND)
message("not found")
endif (GETTEXT_FOUND)

$ cmake ..
-- The C compiler identification is GNU 4.7.2
-- The CXX compiler identification is GNU 4.7.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found Gettext: /usr/bin/msgmerge (found version "0.18.1") 
not found
-- Configuring done
-- Generating done


Проблему можно решить, например, закомментировав строку

set(GETTEXT_FOUND ${Gettext_FOUND})

в конце /usr/share/CMake/Modules/FindGettext.cmake
Comment 1 Slava Dubrovskiy 2013-11-07 14:34:32 MSK
Вроде в cmake-2.8.11-alt1 работает

[slava@dubrwork BUILD]$ cmake ..
-- The C compiler identification is GNU 4.7.2
-- The CXX compiler identification is GNU 4.7.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found Gettext: /usr/bin/msgmerge (found version "0.18.3") 
found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/slava/work/cmake4/BUILD