2
votes

I'm trying to follow these instructions to compile-install BASIS (CMake Build system And Software Implementation Standard) on MSYS2 using MinGW-w64 compilers. However, the ccmake .. step fails:

-bash: ccmake: command not found

I tried searching the MSYS2 packages by pacman -Ss ccmake with no results. So I thought I have to use commandline cmake instead:

cmake -DCMAKE_INSTALL_PREFIX:PATH=~/local -DBUILD_APPLICATIONS:BOOL=ON -DBUILD_EXAMPLE:BOOL=ON ..

which failed by:

CMake Error at src/cmake/modules/ProjectTools.cmake:876 (message):
  CMAKE_INSTALL_PREFIX must be an absolute path!
Call Stack (most recent call first):
  src/cmake/modules/ProjectTools.cmake:2525 (basis_installtree_asserts)
  src/cmake/modules/ProjectTools.cmake:2751 (basis_project_begin)
  CMakeLists.txt:69 (basis_project_impl)

as a workaround I changed the ~/local to /home/<userName>/local which seem to be working. However, I don't know where the MakeFile(s) are, cause when running the make . I get the error:

mingw32-make: *** No targets specified and no makefile found. Stop.

given that I have alias make='mingw32-make in the ~/.bashrc file. I would appreciate if you could help me know what is the problem and how I can solve it. I have the MSYS2-MinGW-w64 package mingw64/mingw-w64-x86_64-cmake installed. My Windows is version 1909, and MSYS_NT-10.0-18363 is my environment.

P.S.1. Looking at the CMake's output I now see that there is actually a warning:

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.

which is a bit ironic for this project, but I am not sure if this is the reason why the compiling fails.

P.S.2. I had the mingw64/mingw-w64-x86_64-cmake package installed, which doesn't have the ccmake tool. But the msys/cmake does. So:

  • pacman -R mingw-w64-x86_64-cmake
  • pacman -S msys/cmake

now ccmake is available.

1
If the last line of CMake output is "Build files have been written to ..." then CMake configuration completes successfully and given directory contains the configured project. But dependent on CMake settings, CMake may configure projects for different build systems. If build directory doesn't contain Makefile, then the project has been configured for other build system. You may explicitely specify build system (generator) using -G parameter. - Tsyvarev
For build with make under MSys use MSYS Makefiles generator. - Tsyvarev
pacman -S cmake should install it and which ccmake should yeild /usr/bin/ccmake - Gerhard
@Foad It is installed for me as part of cmake. - Gerhard
Re: need for "project()" command in top-level CMakeLists, this is a known "issue" introduced in more recent CMake versions (since when BASIS was created). See also github.com/cmake-basis/BASIS/issues/629 for reference. - Andreas Schuh

1 Answers

1
votes

OK, I think I found a temporary workaround by using the MSVC compilers:

  • cmake -DCMAKE_INSTALL_PREFIX:PATH=/home/<userName>/local -DBUILD_APPLICATIONS:BOOL=ON -DBUILD_EXAMPLE:BOOL=ON .. -G "Visual Studio 15 2017 Win64"
  • cmake --build . --config release --target install
  • the executable is ~/local/Bin/basisproject.cmd which has a bizzare file extention but seem to be working!