Build fails - missing MSGFMTConfig.cmake

159 views
Skip to first unread message

Zupino

unread,
Feb 26, 2021, 2:44:40 PM2/26/21
to hugin and other free panoramic software

Good evening everyone,
I recently learned about Hugin and I am trying to build 2020.0 from the tar.bz2 source files from sourceforge http://sourceforge.net/projects/hugin/files/hugin/.

after creating a my-build dir and running cmake ../src from there, I get an error

```
CMake Error at translations/CMakeLists.txt:7 (find_package):
  By not providing "FindMSGFMT.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "MSGFMT", but
  CMake did not find one.
```

From the error, I understand that cmake cannot find MSGFMTConfig.cmake, and that this is related with gettext and translation files.

I am not familiar with cmake, but I can confirm that gettext is installed on my system, as the gettext command executes from the command line.

Could you give me a direction to solve this issue, or maybe build hugin to only generates the command line scripts, since I do not need the GUI for my project?

I am running on Ubuntu 20.04.

Thank you!

T. Modes

unread,
Feb 26, 2021, 3:13:21 PM2/26/21
to hugin and other free panoramic software
Zupino schrieb am Freitag, 26. Februar 2021 um 20:44:40 UTC+1:
after creating a my-build dir and running cmake ../src from there, I get an error

```
CMake Error at translations/CMakeLists.txt:7 (find_package):
  By not providing "FindMSGFMT.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "MSGFMT", but
  CMake did not find one.
```

The source archive contains a file CMakeModules/FindMSGFMT.cmake which should be picked up by CMake.
Could you check if the file is correctly unzipped? (All other libraries have apparently found - so this means that CMAKE_MODULE_PATH is probably set correctly up.) So I don't know why the error pops up

Zupino

unread,
Feb 27, 2021, 3:35:50 AM2/27/21
to hugin and other free panoramic software
CMakeModules/FindMSGFMT.cmake is present in the uncompressed dir.

What I noticed is that I do not have CMAKE_MODULE_PATH set, so I set it with export CMAKE_MODULE_PATH='/home/<user/hugin-2020.0.0/CMakeModules>' and run again cmake, but still same error.

I also noticed that FindMSGFMT.cmake contains a check on the MSGFMT_EXECUTABLE var, which was also not set. I set to the value returned by `/usr/bin/msgfmt`, which is installed in my system.

Is CMake having any sort of cache I should clean before running it again with the environment variable set?

T. Modes

unread,
Feb 27, 2021, 8:17:26 AM2/27/21
to hugin and other free panoramic software
Zupino schrieb am Samstag, 27. Februar 2021 um 09:35:50 UTC+1:
What I noticed is that I do not have CMAKE_MODULE_PATH set, so I set it with export CMAKE_MODULE_PATH='/home/<user/hugin-2020.0.0/CMakeModules>' and run again cmake, but still same error.
CMAKE_MODULE_PATH is a variable inside the CMake build system, not an environment variable. It is (probably) correctly set, otherwise CMake should have complained earlier about other missing search module (e.g. libpano)
 
I also noticed that FindMSGFMT.cmake contains a check on the MSGFMT_EXECUTABLE var, which was also not set. I set to the value returned by `/usr/bin/msgfmt`, which is installed in my system.
Here the same. These are internal CMake variables which are picked up when running. The problem the log mentions is that CMake does not found the file - it does not even started to look after it. So you don't need to set an environment variable with that name.

Is CMake having any sort of cache I should clean before running it again with the environment variable set?
The cache is stored in the build directory. Simply clean up the build directory and retry. But I fear it won't change much - because the mentioned enviroment variables are not used by CMake.

Gunter Königsmann

unread,
Feb 27, 2021, 8:51:16 AM2/27/21
to T. Modes, hugin and other free panoramic software
You can pass variable values to cmake via -D switches...
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

Zupino

unread,
Feb 27, 2021, 11:11:26 AM2/27/21
to hugin and other free panoramic software
Thank you guys, appreciate your support even if this are more cmake questions rather than hugin.

Below the complete output of cmake command, I noticed now that the first error is

CMake Error at celeste/CMakeLists.txt:71 (set_target_properties):
  set_target_properties called with incorrect number of arguments.

And line 71 in celeste/CMakeList.txt

    set_target_properties(celeste PROPERTIES VERSION ${HUGIN_LIB_VERSION})

s



$ cmake ../src
CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- 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
-- Detecting C compile features
-- Detecting C compile features - 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
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at celeste/CMakeLists.txt:71 (set_target_properties):
  set_target_properties called with incorrect number of arguments.



CMake Error at translations/CMakeLists.txt:7 (find_package):
  By not providing "FindMSGFMT.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "MSGFMT", but
  CMake did not find one.

  Could not find a package configuration file provided by "MSGFMT" with any
  of the following names:

    MSGFMTConfig.cmake
    msgfmt-config.cmake

  Add the installation prefix of "MSGFMT" to CMAKE_PREFIX_PATH or set
  "MSGFMT_DIR" to a directory containing one of the above files.  If "MSGFMT"
  provides a separate development package or SDK, be sure it has been
  installed.


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.16)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!

Zupino

unread,
Feb 27, 2021, 11:15:23 AM2/27/21
to hugin and other free panoramic software
Sorry, message sent before completing, again complete:

Thank you guys, appreciate your support even if this are more cmake questions rather than hugin.

Below the complete output of cmake command, I noticed now that the first error is

CMake Error at celeste/CMakeLists.txt:71 (set_target_properties):
  set_target_properties called with incorrect number of arguments.

And line 71 in celeste/CMakeList.txt

    set_target_properties(celeste PROPERTIES VERSION ${HUGIN_LIB_VERSION})

Is it possible that PROPERTIES is not set correctly? Where is this value set?

I am interested in building the script and not the GUI, is there a build target that can skip the GUI (and hopefully these build errors?)

cmake output

T. Modes

unread,
Feb 27, 2021, 12:19:19 PM2/27/21
to hugin and other free panoramic software
Zupino schrieb am Samstag, 27. Februar 2021 um 17:11:26 UTC+1:
$ cmake ../src
CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

From the full log I have an idea: You must pass the path to main source folder as parameter to CMake, not to src subfolder.
So it should be
cmake ..
and not
cmake ../src

(So you skip a big part of the build system which then results in all the error messages.)

Gunter Königsmann

unread,
Feb 27, 2021, 12:28:34 PM2/27/21
to Zupino, hugin and other free panoramic software
If cmake fails often the only problem is too old an cmake. Which cmake version do you use?

Marco Zunino

unread,
Feb 28, 2021, 2:55:57 AM2/28/21
to hugi...@googlegroups.com
Thank you Thomas,
passing the path to main source dir instead of ../src does work. I do get another error with missing wxWidgets, still have to look into that.

-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- 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
-- Detecting C compile features
-- Detecting C compile features - 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
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Current HG revision is 2f576e5d5b4a
-- Assuming this is a tarball (release) build for 2020.0.0
-- Looking for log1p
-- Looking for log1p - found
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
  Could NOT find wxWidgets (missing: wxWidgets_LIBRARIES
  wxWidgets_INCLUDE_DIRS)
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.16/Modules/FindwxWidgets.cmake:1008 (find_package_handle_standard_args)
  CMakeLists.txt:166 (FIND_PACKAGE)


--
A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ
---
You received this message because you are subscribed to a topic in the Google Groups "hugin and other free panoramic software" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/hugin-ptx/VPIfrhqJDzQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hugin-ptx+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hugin-ptx/2d2e364b-9f3e-4150-b9cc-7742dc7df3e6n%40googlegroups.com.

T. Modes

unread,
Feb 28, 2021, 3:38:48 AM2/28/21
to hugin and other free panoramic software
Hi Zupino

Zupino schrieb am Sonntag, 28. Februar 2021 um 08:55:57 UTC+1:
Thank you Thomas,
passing the path to main source dir instead of ../src does work. I do get another error with missing wxWidgets, still have to look into that.

you need to install the wxWidgets dev package (on Ubuntu it is probably called wxgtk-xxx-dev).

See file INSTALL_cmake for all required dependencies. You need probably some more packages before it compiles.

Reply all
Reply to author
Forward
0 new messages