StephanTLavavej / mingw-distro

MinGW distro build scripts.
494 stars 55 forks source link

Consider copying make.exe to mingw32-make.exe #15

Closed StephanTLavavej closed 8 years ago

StephanTLavavej commented 8 years ago

CMake is reportedly unhappy without this.

LB-- commented 8 years ago

I always do this manually with a symlink every time I install this distro, +1

StephanTLavavej commented 8 years ago

@LB-- , if you could provide a CMake file and command line for a Hello World C++ file, that would help me validate this. I know how to obtain CMake binaries (which I used to have to do while building the distro), but I know nothing about writing stuff for CMake, and I want to read as little of its documentation as possible (just figuring out how to pass compiler options through it for libjpeg-turbo was excruciating).

LB-- commented 8 years ago

Create this CMakeLists.txt in a directory with a file named hello.cpp:

cmake_minimum_required(VERSION 3.1)

project(nuwen-hello)

add_executable(hello hello.cpp)
set_property(TARGET hello PROPERTY CXX_STANDARD 14)

After a clean install of the distro:

>cmake -G "MinGW Makefiles" .
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

Delete any files that got created. After symlinking or copying make.exe to mingw32-make.exe:

>cmake -G "MinGW Makefiles" .
-- The C compiler identification is GNU 5.2.0
-- The CXX compiler identification is GNU 5.2.0
-- Check for working C compiler: C:/MinGW/bin/gcc.exe
-- Check for working C compiler: C:/MinGW/bin/gcc.exe -- 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: C:/MinGW/bin/g++.exe
-- Check for working CXX compiler: C:/MinGW/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/blah

After that you may run cmake --build . to build the program.

StephanTLavavej commented 8 years ago

Thank you, @LB-- , that was extremely helpful.