Bug 28137 - find_package(Gettext) does not set GETTEXT_FOUND nor Gettext_FOUND
: find_package(Gettext) does not set GETTEXT_FOUND nor Gettext_FOUND
Status: CLOSED FIXED
: Sisyphus
(All bugs in Sisyphus/cmake-modules)
: unstable
: all Linux
: P3 normal
Assigned To:
:
:
:
:
:
  Show dependency tree
 
Reported: 2012-11-28 00:22 by
Modified: 2013-11-07 14:34 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2012-11-28 00:22:29
Комментарий в /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 From 2013-11-07 14:34:32 -------
Вроде в 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