Skip to content

Commit 88201db

Browse files
committed
Added CMakeLists.
1 parent 5295356 commit 88201db

4 files changed

Lines changed: 100 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
### Configuration
2+
cmake_minimum_required (VERSION 2.6)
3+
4+
project (CppReact)
5+
6+
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
7+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
8+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
9+
10+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wpedantic")
11+
12+
include_directories ("${PROJECT_SOURCE_DIR}/include")
13+
14+
### CppReact
15+
add_library(CppReact
16+
src/engine/PulsecountEngine.cpp
17+
src/engine/SubtreeEngine.cpp
18+
src/engine/ToposortEngine.cpp
19+
src/logging/EventLog.cpp
20+
src/logging/EventRecords.cpp)
21+
22+
target_link_libraries(CppReact tbb)
23+
24+
### examples/
25+
option(build_examples "Build examples?" ON)
26+
if(build_examples)
27+
add_subdirectory(examples)
28+
endif()
29+
30+
### benchmarks/
31+
option(build_benchmarks "Build benchmarks?" OFF)
32+
if(build_benchmarks)
33+
add_subdirectory(benchmarks)
34+
endif()
35+
36+
### tests/
37+
option(build_tests "Build unit tests?" OFF)
38+
if(build_tests)
39+
add_subdirectory(tests)
40+
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()

benchmarks/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
### CppReactBenchmark
2+
3+
add_executable(CppReactBenchmark src/Main.cpp)
4+
target_link_libraries(CppReactBenchmark CppReact tbbmalloc_proxy)

examples/CMakeLists.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
### Example_BasicAlgorithms
2+
add_executable(Example_BasicAlgorithms src/BasicAlgorithms.cpp)
3+
target_link_libraries(Example_BasicAlgorithms CppReact)
4+
5+
### Example_BasicComposition
6+
add_executable(Example_BasicComposition src/BasicComposition.cpp)
7+
target_link_libraries(Example_BasicComposition CppReact)
8+
9+
### Example_BasicEvents
10+
add_executable(Example_BasicEvents src/BasicEvents.cpp)
11+
target_link_libraries(Example_BasicEvents CppReact)
12+
13+
### Example_BasicObservers
14+
add_executable(Example_BasicObservers src/BasicObservers.cpp)
15+
target_link_libraries(Example_BasicObservers CppReact)
16+
17+
### Example_BasicReactors
18+
#add_executable(Example_BasicReactors src/BasicReactors.cpp)
19+
#target_link_libraries(Example_BasicReactors CppReact)
20+
21+
### Example_BasicSignals
22+
add_executable(Example_BasicSignals src/BasicSignals.cpp)
23+
target_link_libraries(Example_BasicSignals CppReact)
24+
25+
### Example_BasicSynchronization
26+
add_executable(Example_BasicSynchronization src/BasicSynchronization.cpp)
27+
target_link_libraries(Example_BasicSynchronization CppReact)
28+
29+
### Example_Sandbox
30+
add_executable(Example_Sandbox src/Main.cpp)
31+
target_link_libraries(Example_Sandbox CppReact)

tests/CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
### CppReactTest
2+
add_executable(CppReactTest
3+
src/EventStreamTest.cpp
4+
src/EventStreamTestQ.cpp
5+
src/MoveTest.cpp
6+
src/ObserverTest.cpp
7+
src/ObserverTestQ.cpp
8+
src/OperationsTest.cpp
9+
src/OperationsTestQ.cpp
10+
src/SignalTest.cpp
11+
src/SignalTestQ.cpp
12+
src/TransactionTest.cpp)
13+
14+
target_link_libraries(CppReactTest CppReact gtest gtest_main)

0 commit comments

Comments
 (0)