Skip to content

Commit

Permalink
Fix building demo file
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake-Madden committed May 28, 2024
1 parent 230c848 commit d2bd60f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
13 changes: 6 additions & 7 deletions tests/demo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@
# Licence: 3-Clause BSD licence
#############################################################################

PROJECT(TEDemo)
project(TEDemo)

CMAKE_MINIMUM_REQUIRED(VERSION 3.12)
SET(CMAKE_CXX_STANDARD 17)
SET(CMAKE_CXX_STANDARD_REQUIRED True)
cmake_minimum_required(VERSION 3.12)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)

SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)

ADD_EXECUTABLE(${CMAKE_PROJECT_NAME} tinyexpr.cpp tedemo.cpp)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)

add_executable(${CMAKE_PROJECT_NAME} ../../tinyexpr.cpp tedemo.cpp)
9 changes: 4 additions & 5 deletions tests/demo/tedemo.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
// This is mostly used as a CMake project used for code analysis.

#include "tinyexpr.h"
#include "../../tinyexpr.h"
#include <iostream>

int main(int argc, char *argv[])
int main(int argc, char* argv[])
{
te_parser tep;
const char *c = "sqrt(5^2+7^2+11^2+(8-2)^2)";
const char* c = "sqrt(5^2+7^2+11^2+(8-2)^2)";
double r = tep.evaluate(c);
std::cout << "The expression:\n\t" <<
c << "\nevaluates to:\n\t" << r << "\n";
std::cout << "The expression:\n\t" << c << "\nevaluates to:\n\t" << r << "\n";
return EXIT_SUCCESS;
}

0 comments on commit d2bd60f

Please sign in to comment.