I would like to create a self contained project that can generate makefiles, and compile itself. I am using CMake to generate the make files, and MingGW (G++) to compile. It doesn't seem as though CMake was designed to be portable, but I could have done things very incorrectly.
In order to make these programs portable, I merely copied the program folders for both MinGW and CMake to my project. I then use the GUI to point the CMAKE_CXX_COMPILER to the mingw32-g++.exe in the project and the CMAKE_C_COMPILER to mingw32-gcc, and the CMAKE_MAKE_PROGRAM to the mingw32-make.exe.
When I try to hit configure, it says that cc1.exe, and cc1plus.exe is not able to find libmpfr-6.dll, libgmp-10.dll, libmpc-3.dll, etc. All of these files are located in the same folder as the CMAKE_CXX_COMPILER. It seems as though it assumes the needed programs are installed in the system, and that the path to them is defined.
Is there a way to tell CMake where all of these programs are installed? Also if there is any other configuration that needs to be done to make CMake portable.
Have I done anything wrong, and are there better tools to use instead of CMAKE/MinGW.
CMAKE FILE:
cmake_minimum_required(VERSION 3.17)
# set the project name
project(BSharpInterpretter VERSION 1.0)
#configure file for version info
configure_file(BSharpInterpretter_Config.h.in BSharpInterpretter_Config.h)
#add include directories
target_include_directories(BSharpInterpetter PUBLIC
"${PROJECT_BINARY_DIR}")
#specify C++ standard
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
#specify compiler location
#set(rootDir ..\\..)
#set(CMAKE_CXX_COMPILER ${rootDir}\\MingGW\\g++)
# add the executable
add_executable(BSharpInterpetter BSharpInterpretter.cpp)
Other Programs
MinGW with the mingw32-gcc-g++-bin, and mingw32-make-bin packages