Skip to content

Commit d2bd60f

Browse files
committed
Fix building demo file
1 parent 230c848 commit d2bd60f

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

tests/demo/CMakeLists.txt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
# Licence: 3-Clause BSD licence
88
#############################################################################
99

10-
PROJECT(TEDemo)
10+
project(TEDemo)
1111

12-
CMAKE_MINIMUM_REQUIRED(VERSION 3.12)
13-
SET(CMAKE_CXX_STANDARD 17)
14-
SET(CMAKE_CXX_STANDARD_REQUIRED True)
12+
cmake_minimum_required(VERSION 3.12)
13+
set(CMAKE_CXX_STANDARD 17)
14+
set(CMAKE_CXX_STANDARD_REQUIRED True)
1515

16-
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
17-
18-
ADD_EXECUTABLE(${CMAKE_PROJECT_NAME} tinyexpr.cpp tedemo.cpp)
16+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
1917

18+
add_executable(${CMAKE_PROJECT_NAME} ../../tinyexpr.cpp tedemo.cpp)

tests/demo/tedemo.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
// This is mostly used as a CMake project used for code analysis.
22

3-
#include "tinyexpr.h"
3+
#include "../../tinyexpr.h"
44
#include <iostream>
55

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

0 commit comments

Comments
 (0)