Working on CMake Stuff

This commit is contained in:
Samuel Walker 2024-09-01 17:57:51 -06:00
parent 23473885ea
commit f941e90f08
3 changed files with 13 additions and 4 deletions

View File

@ -1,3 +1,7 @@
cmake_minimum_required(VERSION 3.10)
project(Raycaster)
add_executable(raycaster src/main.cpp)
project(Raycaster VERSION 0.1)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
add_executable(raycaster src/main.cpp)
configure_file(src/RaycasterConfig.h.in RaycasterConfig.h)
target_include_directories(raycaster PUBLIC "${PROJECT_BINARY_DIR}")

4
src/RaycasterConfig.h.in Normal file
View File

@ -0,0 +1,4 @@
// the configured options and settings for Tutorial
#define Raycaster_VERSION_MAJOR @Raycaster_VERSION_MAJOR@
#define Raycaster_VERSION_MINOR @Raycaster_VERSION_MINOR@

View File

@ -1,6 +1,7 @@
#include <iostream>
#include "RaycasterConfig.h"
int main(){
std::cout << "test" << std::endl;
int main(int argc, char *argv[]){
std::cout << Raycaster_VERSION_MAJOR << "." << Raycaster_VERSION_MINOR << std::endl;
return 0;
}