Skip to content

Commit 0741199

Browse files
committed
Improved build scripts, enabled Example_BasicReactors.
1 parent d1a773b commit 0741199

3 files changed

Lines changed: 18 additions & 12 deletions

File tree

CMakeLists.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,3 @@ option(build_tests "Build unit tests?" OFF)
3838
if(build_tests)
3939
add_subdirectory(tests)
4040
endif()
41-
42-
# cmake -Dbuild_tests=BOOL:ON
43-
if(build_tests)
44-
if(DEFINED ENV{GTEST_DIR})
45-
message("Using gtest found in $ENV{GTEST_DIR}.")
46-
else()
47-
message("GTEST_DIR is not defined. You must tell CMake where to find the gtest source.")
48-
return()
49-
endif()
50-
add_subdirectory($ENV{GTEST_DIR} ${CMAKE_CURRENT_BINARY_DIR}/gtest)
51-
endif()

examples/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@ add_executable(Example_BasicObservers src/BasicObservers.cpp)
1515
target_link_libraries(Example_BasicObservers CppReact)
1616

1717
### Example_BasicReactors
18-
#add_executable(Example_BasicReactors src/BasicReactors.cpp)
18+
find_package(Boost 1.55 COMPONENTS coroutine context system)
19+
if(Boost_FOUND)
20+
include_directories(${Boost_INCLUDE_DIRS})
21+
add_executable(Example_BasicReactors src/BasicReactors.cpp)
22+
target_link_libraries(Example_BasicReactors CppReact ${Boost_LIBRARIES})
23+
else()
24+
message("boost::coroutine not found. Skipping build of Example_BasicReactors.")
25+
endif()
26+
#add_exyecutable(Example_BasicReactors src/BasicReactors.cpp)
1927
#target_link_libraries(Example_BasicReactors CppReact)
2028

2129
### Example_BasicSignals

tests/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
### Configuration
2+
if(DEFINED ENV{GTEST_DIR})
3+
message("Using gtest found in $ENV{GTEST_DIR}.")
4+
else()
5+
message("GTEST_DIR is not defined. You must tell CMake where to find the gtest source.")
6+
return()
7+
endif()
8+
add_subdirectory($ENV{GTEST_DIR} ${CMAKE_CURRENT_BINARY_DIR}/gtest)
9+
110
### CppReactTest
211
add_executable(CppReactTest
312
src/EventStreamTest.cpp

0 commit comments

Comments
 (0)