LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   cmake (https://www.linuxquestions.org/questions/linux-software-2/cmake-4175590504/)

Mike Davies 09-30-2016 01:57 PM

cmake
 
I HATE cmake. I have never liked it in the 20 odd years I've been mucking about with Linux, and try to avoid it like the plague. I can NEVER make it do anything I want.

Simply, my problem today is how can I make it generate the Makefile again ?

The story so far.

I have downloaded a source from github, but that source assumes my compile is /bin/gcc. So I feed the cmake with a define to give it the proper compiler, and I get output like ...
Code:

-- The C compiler identification is GNU 4.9.3
-- The CXX compiler identification is GNU 4.9.3
-- Check for working C compiler: /home/mike/work/pi/buildroot/output/host/usr/bin/arm-buildroot-linux-gnueabihf-gcc
-- Check for working C compiler: /home/mike/work/pi/buildroot/output/host/usr/bin/arm-buildroot-linux-gnueabihf-gcc -- 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: /home/mike/work/pi/buildroot/output/host/usr/bin/arm-buildroot-linux-gnueabihf-g++
-- Check for working CXX compiler: /home/mike/work/pi/buildroot/output/host/usr/bin/arm-buildroot-linux-gnueabihf-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM compiler identification is GNU
-- Found assembler: /bin/gcc
-- Configuring done
You have changed variables that require your cache to be deleted.
Configure will be re-run and you may have to reset some variables.
The following variables have changed:
CMAKE_C_COMPILER= /home/mike/work/pi/buildroot/output/host/usr/bin/arm-linux-gcc
CMAKE_CXX_COMPILER= /home/mike/work/pi/buildroot/output/host/usr/bin/arm-linux-g++

-- The C compiler identification is GNU 4.9.3
-- The CXX compiler identification is GNU 4.9.3
-- Check for working C compiler: /home/mike/work/pi/buildroot/output/host/usr/bin/arm-linux-gcc
-- Check for working C compiler: /home/mike/work/pi/buildroot/output/host/usr/bin/arm-linux-gcc -- 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: /home/mike/work/pi/buildroot/output/host/usr/bin/arm-linux-g++
-- Check for working CXX compiler: /home/mike/work/pi/buildroot/output/host/usr/bin/arm-linux-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM compiler identification is GNU
-- Found assembler: /bin/gcc
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

You will notice it has picked up my compiler OK instead of /bin/gcc, but then some nonsense somewhere in what I have downloaded from github overwrites that compiler choice with /bin/gcc

So I find this nonsense in a file called CMakeLists.txt and comment it out, removing all references to /bin/gcc.

How then do I generate the Makefile again ??

If I simply say
[mike@ceri motion-mmal-mmal-test]$ cmake .
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mike/work/pi/buildroot/output/build/motion-mmal-mmal-test
[mike@ceri motion-mmal-mmal-test]$

and it has not done anything useful like creating a new Makefile with the proper compiler.

What have I got to do to make cmake generate a Makefile from scratch again. ?

rtmistler 09-30-2016 02:03 PM

I'm sorry but I'm chuckling. :)

I've never used cmake, suggest you stop that!

Qt has qmake and that works for when you have a Qt project.

I've always just used make and I create my own Makefiles drawing from my own examples over the years.

Oddly enough, now that I think of it, the two things I've kept over 25-30 years of involvement with Unix/Linux are:
  1. My .emacs file
  2. Scripts and Makefiles that were big deals for me to get done, so I keep them as examples.
:D

Mike Davies 10-01-2016 05:49 AM

Hmmm, well about the only thing I have kept from the "old days" is a password I used to use on a George 4 MOP terminal.

But none of this reminiscing is helping with my problems with cmake.

I'm giving up and will do what I normally do and write my own Makefile


All times are GMT -5. The time now is 06:32 PM.