From f561852233d5f445fa190e1af5cd7df8b7e568f5 Mon Sep 17 00:00:00 2001 From: Srivatsan Iyer Date: Wed, 18 Nov 2020 21:24:35 +0530 Subject: [PATCH 1/2] Rename CMake target: example -> basic_example. --- examples/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 1beab17c6..505a8a691 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -26,12 +26,12 @@ add_custom_command(OUTPUT ws.html ) add_custom_target(example_ws_copy ALL DEPENDS ws.html) -add_executable(example example.cpp) -target_link_libraries(example ${Boost_LIBRARIES}) -target_link_libraries(example ${CMAKE_THREAD_LIBS_INIT}) +add_executable(basic_example example.cpp) +target_link_libraries(basic_example ${Boost_LIBRARIES}) +target_link_libraries(basic_example ${CMAKE_THREAD_LIBS_INIT}) if (Tcmalloc_FOUND) - target_link_libraries(example ${Tcmalloc_LIBRARIES}) + target_link_libraries(basic_example ${Tcmalloc_LIBRARIES}) endif(Tcmalloc_FOUND) add_executable(example_with_all example_with_all.cpp) From 267694dbbce38921f0a988e6b56bef7b2c71f089 Mon Sep 17 00:00:00 2001 From: Srivatsan Iyer Date: Wed, 18 Nov 2020 22:08:04 +0530 Subject: [PATCH 2/2] Fix #include for example_with_all. Using relative directories like "../build/crow_all.h" might not work in all settings. --- CMakeLists.txt | 1 + examples/example_with_all.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09deeb5cf..b6eae887f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,6 +41,7 @@ set(PROJECT_INCLUDE_DIR include_directories("${PROJECT_INCLUDE_DIR}") include_directories("${PROJECT_SOURCE_DIR}") +include_directories("${CMAKE_CURRENT_BINARY_DIR}") # To include crow_all.h add_subdirectory(examples) diff --git a/examples/example_with_all.cpp b/examples/example_with_all.cpp index b0c917ae5..9661e7546 100644 --- a/examples/example_with_all.cpp +++ b/examples/example_with_all.cpp @@ -1,4 +1,4 @@ -#include "../build/crow_all.h" +#include "crow_all.h" #include