From ebf0c4d987a5a2b265cd84335924435d80bc970a Mon Sep 17 00:00:00 2001 From: Roy Stogner Date: Wed, 1 Dec 2021 17:36:31 -0600 Subject: [PATCH 1/4] Rename testbed/testbed to testbed/p2t That's what README.md has been referencing as the executable name, and it's more meaningful. --- testbed/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testbed/CMakeLists.txt b/testbed/CMakeLists.txt index 385f01b..6ce1392 100644 --- a/testbed/CMakeLists.txt +++ b/testbed/CMakeLists.txt @@ -3,11 +3,11 @@ find_package(glfw3 3.3 REQUIRED) find_package(OpenGL REQUIRED) # Build testbed -add_executable(testbed +add_executable(p2t main.cc ) -target_link_libraries(testbed +target_link_libraries(p2t PRIVATE glfw OpenGL::GL From cbc025a6494ff5cbab97ee6c41b011a1ebcecabc Mon Sep 17 00:00:00 2001 From: Roy Stogner Date: Wed, 1 Dec 2021 17:37:18 -0600 Subject: [PATCH 2/4] Note unit test dependencies I already had most of Boost installed, but not enough. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 83eeac7..21dec88 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,9 @@ Core poly2tri lib: * Standard Template Library (STL) +Unit tests: +* Boost (filesystem, test framework) + Testbed: * OpenGL From 4fd0287f04c7fd30b50dbe115c30a5c6f764e800 Mon Sep 17 00:00:00 2001 From: Roy Stogner Date: Wed, 1 Dec 2021 17:38:23 -0600 Subject: [PATCH 3/4] Fix, clarify build instructions If we're in a build subdirectory, we need `..` to tell cmake where to find the source directory. --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 21dec88..478f818 100644 --- a/README.md +++ b/README.md @@ -38,28 +38,32 @@ Testbed: Build the library ----------------- +With the ninja build system installed: + ``` mkdir build && cd build -cmake -GNinja +cmake -GNinja .. cmake --build . ``` -Build and run the unit tests +Build and run with unit tests ---------------------------- +With the ninja build system: + ``` mkdir build && cd build -cmake -GNinja -DP2T_BUILD_TESTS=ON +cmake -GNinja -DP2T_BUILD_TESTS=ON .. cmake --build . ctest --output-on-failure ``` -Build the testbed +Build with the testbed ----------------- ``` mkdir build && cd build -cmake -GNinja -DP2T_BUILD_TESTBED=ON +cmake -GNinja -DP2T_BUILD_TESTBED=ON .. cmake --build . ``` From 4581f1fee8225ad454a496d96c2de0701e2152e9 Mon Sep 17 00:00:00 2001 From: Roy Stogner Date: Wed, 1 Dec 2021 17:38:53 -0600 Subject: [PATCH 4/4] Consistent executable path in README.md These commands run (from the source directory; would commands as run from the build directory be clearer?) for me as-is (after the testbed executable has been built) now. --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 478f818..b3af367 100644 --- a/README.md +++ b/README.md @@ -72,19 +72,19 @@ Running the Examples Load data points from a file: ``` -p2t +build/testbed/p2t ``` Random distribution of points inside a constrained box: ``` -p2t random +build/testbed/p2t random ``` Examples: ``` -./build/p2t testbed/data/dude.dat 300 500 2 -./build/p2t testbed/data/nazca_monkey.dat 0 0 9 +build/testbed/p2t testbed/data/dude.dat 300 500 2 +build/testbed/p2t testbed/data/nazca_monkey.dat 0 0 9 -./build/p2t random 10 100 5.0 -./build/p2t random 1000 20000 0.025 +build/testbed/p2t random 10 100 5.0 +build/testbed/p2t random 1000 20000 0.025 ``` References