To use on Linux, do the following:
- In the root directory, create a "build" directory and
cd
into it. - Execute this command:
ccmake ..
. - A dialog should appear with various options, type
c
; this should configure our files for us. - Once returned to the main dialog, type
c
once more. - Type
g
to generate the makefiles. - Once returned to the main terminal interface, type
make
. - A message should appear reading:
Built target TinyTerm
. cd
into "src", and enter:./TinyTerm
.
To compile and use this project on Windows, and Visual Studio, you will need CMake installed. Visit cmake.org and download the appropriate version.
To build using CMake:
- Once Cmake is install and added to the path, open your environment variables.
- Under "System Variables" add a new variable titled "CMAKE_GENERATOR".
- The value of this variable, for me, is:
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\Hostx64\x64\bscmake
. This may differ depending on your version. Before, when attempting to run CMake with an inappropriate generator, it simply used its default configurations to build the project. I believe the important thing here is to define the variable and set it to something that reasonably makes sense. - Clone the repository, then open it in your favorite editor.
- Note the
CMakeLists.txt
files in theroot
andsrc
directories, these contain the specific instructions for CMake the properly build our project. - Open a terminal (command prompt), and enter the following:
mkdir build && cd build
. - Once the
/build
directory has been created and the terminal directory has been changed, run this command:cmake .. -G "Visual Studio 16 2019" -A x64
- CMake should successfully build the project; open a file explorer and navigate to the build directory.
- A
sln
solution file should be displayed in the directory; this file should be named "TinyTerm". Open this file using Visual Studio. - Visual Studio should successfully launch the project, displaying the header and source files within the respective directories.
- If you run the Debugger in Visual Studio and get an "Access Denied" error, it is most likely due to Visual Studio attempting to run the
ALL_BUILD
solution instead ofTinyTerm
. To fix this, do the following:
- Right click on the "Solution 'Tiny Term'" at the top of the Solution Explorer.
- Select "Set Startup Projects..."
- A dialog window should appear; make sue "Startup Project" is selected under "Common Properties" on the left hand selection menu.
- There are 3 radio buttons that appear, select "Single startup project" if not selected.
- From the dropdown menu, select "TinyTerm" instead of "ALL_BUILD".
- Apply changes and close the window; select the "Local Windows Debugger" once again to run the program.
- A terminal interface should appear displaying to program.
Curses is a Unix-specific library. To get around this, we can use Microsoft's vcpkg
utility, found here: vcpkg.
To use this, do the following:
- Using the link above, clone the git repository to anywhere you'd like.
- Navigate to the
vcpkg
directory and type:./bootstrap-vcpkg.bat
. - Add this directory to your Windows system/user path.
- To integrate with Visual Studio, type the following:
vcpkg integrate install
. - Open the project in Visual Studio, and navigate to
engine.hpp
. - Most likely, the include statement for:
curses.h
. - Open the terminal and type the following:
vcpkg install pdcurses:x64-windows
. - After that is installed, type
vcpkg integrate project
. - Navigate back to Visual studio, then go to the top bar and do the following: Tools->NuGet Package Manager->Package Manager Console.
- This will open a console at the bottom of the screen; within it, enter:
Install-Package vcpkg.C.vclib.vcpkg -Source "C:\vclib\vcpkg\scripts\buildsystems"
whereC:\vclib\vcpkg
is the installation directory forvcpkg
, i.e. the place where you cloned it from Github. - Return to
engine.hpp
; the include statement for Curses should no longer be red. - Attempt to build and run; if successful, the program should display!
If the an error occurs when attempting to launch the program indicating that the pdcurses.dll
could not be found; do the following:
- Right click on the TinyTerm solution and select Properties.
- In the TinyTerm Property Pages dialog, select Linker from the right hand navigation menu.
- Under the Linker dropdown, select Input.
- Within the Input menu, add
pdcurses.lib
to the Additonal Dependencies line, and then apply the changes.