Sorting out CMake and SLD2
This commit is contained in:
19
CMakeLists.txt
Normal file
19
CMakeLists.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
# version
|
||||
cmake_minimum_required(VERSION 3.9)
|
||||
|
||||
project(crumpet-engine)
|
||||
set(crumpet-engine_VERSION_MAJOR 1)
|
||||
set(crumpet-engine_VERSION_MINOR 0)
|
||||
|
||||
set(EXEName crumpet-engine.o)
|
||||
set(BuildDIR ./bin)
|
||||
set(SrcDIR ./src)
|
||||
set(IncludeDIR ${SrcDIR}/include)
|
||||
|
||||
find_package(SDL2 REQUIRED)
|
||||
include_directories(${SLD_INCLUDE_DIRS})
|
||||
|
||||
include_directories(${IncludeDIR})
|
||||
|
||||
add_executable(${BuildDIR}/${EXEName} ${SrcDIR}/main.cpp)
|
||||
target_link_libraries(${BuildDIR}/${EXEName} ${SDL2_LIBRARIES})
|
||||
178
Makefile
Normal file
178
Makefile
Normal file
@@ -0,0 +1,178 @@
|
||||
# CMAKE generated file: DO NOT EDIT!
|
||||
# Generated by "Unix Makefiles" Generator, CMake Version 3.12
|
||||
|
||||
# Default target executed when no arguments are given to make.
|
||||
default_target: all
|
||||
|
||||
.PHONY : default_target
|
||||
|
||||
# Allow only one "make -f Makefile2" at a time, but pass parallelism.
|
||||
.NOTPARALLEL:
|
||||
|
||||
|
||||
#=============================================================================
|
||||
# Special targets provided by cmake.
|
||||
|
||||
# Disable implicit rules so canonical targets will work.
|
||||
.SUFFIXES:
|
||||
|
||||
|
||||
# Remove some rules from gmake that .SUFFIXES does not remove.
|
||||
SUFFIXES =
|
||||
|
||||
.SUFFIXES: .hpux_make_needs_suffix_list
|
||||
|
||||
|
||||
# Suppress display of executed commands.
|
||||
$(VERBOSE).SILENT:
|
||||
|
||||
|
||||
# A target that is always out of date.
|
||||
cmake_force:
|
||||
|
||||
.PHONY : cmake_force
|
||||
|
||||
#=============================================================================
|
||||
# Set environment variables for the build.
|
||||
|
||||
# The shell in which to execute make rules.
|
||||
SHELL = /bin/sh
|
||||
|
||||
# The CMake executable.
|
||||
CMAKE_COMMAND = /usr/bin/cmake
|
||||
|
||||
# The command to remove a file.
|
||||
RM = /usr/bin/cmake -E remove -f
|
||||
|
||||
# Escaping for special characters.
|
||||
EQUALS = =
|
||||
|
||||
# The top-level source directory on which CMake was run.
|
||||
CMAKE_SOURCE_DIR = /home/ben/Programming/crumpet-engine
|
||||
|
||||
# The top-level build directory on which CMake was run.
|
||||
CMAKE_BINARY_DIR = /home/ben/Programming/crumpet-engine
|
||||
|
||||
#=============================================================================
|
||||
# Targets provided globally by CMake.
|
||||
|
||||
# Special rule for the target rebuild_cache
|
||||
rebuild_cache:
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
|
||||
/usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
|
||||
.PHONY : rebuild_cache
|
||||
|
||||
# Special rule for the target rebuild_cache
|
||||
rebuild_cache/fast: rebuild_cache
|
||||
|
||||
.PHONY : rebuild_cache/fast
|
||||
|
||||
# Special rule for the target edit_cache
|
||||
edit_cache:
|
||||
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..."
|
||||
/usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available.
|
||||
.PHONY : edit_cache
|
||||
|
||||
# Special rule for the target edit_cache
|
||||
edit_cache/fast: edit_cache
|
||||
|
||||
.PHONY : edit_cache/fast
|
||||
|
||||
# The main all target
|
||||
all: cmake_check_build_system
|
||||
$(CMAKE_COMMAND) -E cmake_progress_start /home/ben/Programming/crumpet-engine/CMakeFiles /home/ben/Programming/crumpet-engine/CMakeFiles/progress.marks
|
||||
$(MAKE) -f CMakeFiles/Makefile2 all
|
||||
$(CMAKE_COMMAND) -E cmake_progress_start /home/ben/Programming/crumpet-engine/CMakeFiles 0
|
||||
.PHONY : all
|
||||
|
||||
# The main clean target
|
||||
clean:
|
||||
$(MAKE) -f CMakeFiles/Makefile2 clean
|
||||
.PHONY : clean
|
||||
|
||||
# The main clean target
|
||||
clean/fast: clean
|
||||
|
||||
.PHONY : clean/fast
|
||||
|
||||
# Prepare targets for installation.
|
||||
preinstall: all
|
||||
$(MAKE) -f CMakeFiles/Makefile2 preinstall
|
||||
.PHONY : preinstall
|
||||
|
||||
# Prepare targets for installation.
|
||||
preinstall/fast:
|
||||
$(MAKE) -f CMakeFiles/Makefile2 preinstall
|
||||
.PHONY : preinstall/fast
|
||||
|
||||
# clear depends
|
||||
depend:
|
||||
$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
|
||||
.PHONY : depend
|
||||
|
||||
#=============================================================================
|
||||
# Target rules for targets named ./bin/crumpet-engine.o
|
||||
|
||||
# Build rule for target.
|
||||
./bin/crumpet-engine.o: cmake_check_build_system
|
||||
$(MAKE) -f CMakeFiles/Makefile2 ./bin/crumpet-engine.o
|
||||
.PHONY : ./bin/crumpet-engine.o
|
||||
|
||||
# fast build rule for target.
|
||||
./bin/crumpet-engine.o/fast:
|
||||
$(MAKE) -f CMakeFiles/./bin/crumpet-engine.o.dir/build.make CMakeFiles/./bin/crumpet-engine.o.dir/build
|
||||
.PHONY : ./bin/crumpet-engine.o/fast
|
||||
|
||||
src/main.o: src/main.cpp.o
|
||||
|
||||
.PHONY : src/main.o
|
||||
|
||||
# target to build an object file
|
||||
src/main.cpp.o:
|
||||
$(MAKE) -f CMakeFiles/./bin/crumpet-engine.o.dir/build.make CMakeFiles/./bin/crumpet-engine.o.dir/src/main.cpp.o
|
||||
.PHONY : src/main.cpp.o
|
||||
|
||||
src/main.i: src/main.cpp.i
|
||||
|
||||
.PHONY : src/main.i
|
||||
|
||||
# target to preprocess a source file
|
||||
src/main.cpp.i:
|
||||
$(MAKE) -f CMakeFiles/./bin/crumpet-engine.o.dir/build.make CMakeFiles/./bin/crumpet-engine.o.dir/src/main.cpp.i
|
||||
.PHONY : src/main.cpp.i
|
||||
|
||||
src/main.s: src/main.cpp.s
|
||||
|
||||
.PHONY : src/main.s
|
||||
|
||||
# target to generate assembly for a file
|
||||
src/main.cpp.s:
|
||||
$(MAKE) -f CMakeFiles/./bin/crumpet-engine.o.dir/build.make CMakeFiles/./bin/crumpet-engine.o.dir/src/main.cpp.s
|
||||
.PHONY : src/main.cpp.s
|
||||
|
||||
# Help Target
|
||||
help:
|
||||
@echo "The following are some of the valid targets for this Makefile:"
|
||||
@echo "... all (the default if no target is provided)"
|
||||
@echo "... clean"
|
||||
@echo "... depend"
|
||||
@echo "... rebuild_cache"
|
||||
@echo "... ./bin/crumpet-engine.o"
|
||||
@echo "... edit_cache"
|
||||
@echo "... src/main.o"
|
||||
@echo "... src/main.i"
|
||||
@echo "... src/main.s"
|
||||
.PHONY : help
|
||||
|
||||
|
||||
|
||||
#=============================================================================
|
||||
# Special targets to cleanup operation of make.
|
||||
|
||||
# Special rule to run CMake to check the build system integrity.
|
||||
# No rule that depends on this can have commands that come from listfiles
|
||||
# because they might be regenerated.
|
||||
cmake_check_build_system:
|
||||
$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
|
||||
.PHONY : cmake_check_build_system
|
||||
|
||||
BIN
bin/crumpet-engine.o
Executable file
BIN
bin/crumpet-engine.o
Executable file
Binary file not shown.
6
src/header.h
Normal file
6
src/header.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
inline static void HelloWorld() {
|
||||
std::cout << "Hello, world" << std::endl;
|
||||
}
|
||||
8
src/include/include.h
Normal file
8
src/include/include.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
class XD {
|
||||
public:
|
||||
void write(char* i) {
|
||||
std::cout << i << std::endl;
|
||||
}
|
||||
};
|
||||
10
src/main.cpp
Normal file
10
src/main.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#include <iostream>
|
||||
#include <include.h>
|
||||
#include "header.h"
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
XD waattttt;
|
||||
waattttt.write("Hellllooooooo guys");
|
||||
|
||||
HelloWorld();
|
||||
}
|
||||
Reference in New Issue
Block a user