Skip to content

Commit

Permalink
Argument management in separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
tihomirkonosic committed Dec 20, 2023
1 parent a1bdab0 commit 1b850ad
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,14 @@ target_include_directories(raven PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>)

add_executable(raven_exe
src/main.cpp)
src/main.cpp
)

target_link_libraries(raven_exe
raven)


target_compile_definitions(raven_exe PRIVATE VERSION="${PROJECT_VERSION}")
target_compile_definitions(raven PUBLIC RAVEN_VERSION="${PROJECT_VERSION}")
set_property(TARGET raven_exe PROPERTY OUTPUT_NAME raven)

install(TARGETS raven_exe DESTINATION ${CMAKE_INSTALL_BINDIR})
Expand Down
2 changes: 0 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ int main(int argc, char **argv) {
if (!ProcessParameters(argc, argv, param))
return 0;

std::cout << VERSION << std::endl;

if (optind >= argc && !param.skip_contruction) {
std::cerr << "[raven::] error: missing input file!" << std::endl;
return 1;
Expand Down
2 changes: 1 addition & 1 deletion src/option_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ int ProcessParameters(int argc, char **argv, Program_Parameters& param) {
param.num_threads = atoi(optarg);
break;
case 'v':
//std::cout << VERSION << std::endl;
std::cout << RAVEN_VERSION << std::endl;
return 0;
case 'h':
Help();
Expand Down

0 comments on commit 1b850ad

Please sign in to comment.