I'm trying to write a CMakelist.txt for my project but it doesn't seem to find the CSV file that my program reads in. This is what I've tried so far:
# this can be much lower
cmake_minimum_required(VERSION 3.17)
project(monte_carlo)
add_executable(monte_carlo)
file(GLOB_RECURSE ALL_FILES src/*.cpp include/*.h ${CMAKE_CURRENT_SOURCE_DIR}/*.csv)
target_sources(monte_carlo
PRIVATE
${ALL_FILES}
)
target_include_directories(monte_carlo
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/include
)
target_compile_features(monte_carlo
PRIVATE
cxx_std_17
)
target_compile_options(monte_carlo
PRIVATE
$<$<CXX_COMPILER_ID:GNU>:-Wall -Wextra -Wpedantic -ffast-math>
$<$<CXX_COMPILER_ID:Clang>:-Wall -Wpedantic -ffast-math>
$<$<CXX_COMPILER_ID:MSVC>:/W4>
)
where I've added ${CMAKE_CURRENT_SOURCE_DIR}/*.csv
in an attempt to let the make file find my csv file but this doesn't seem to work. I'm not too keen on how CMAKE works (most of the above I've copy pasted from other places) so if there's something else I'm missing (or something I don't need or should change, or if you just want to explain what I'm actually doing) please feel free to let me know. This is the repo I'm working on:
https://github.com/OscarUngsgard/Cpp-Monte-Carlo-Value-at-Risk-Engine
Where the file I'm trying to read in the main file of my program is riskFactorsnew.csv
in the root directory.