-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathCmakeLists.txt
More file actions
44 lines (34 loc) · 1.11 KB
/
CmakeLists.txt
File metadata and controls
44 lines (34 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# code_test/multiprocessing/CMakeList.txt
# Copyright 2018/11/2 Robin.Rowe@CinePaint.org
# License open source MIT
project(ProducerConsumer)
cmake_minimum_required(VERSION 3.8)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
#add_definitions(-DMEM_SYS_V)
if(WIN32)
set(PLATFORM windows/SharedMemoryWin.h windows/Semaphore.h windows/Launcher.h)
else(WIN32)
set(PLATFORM unix/SharedMemoryBSD.h unix/SharedMemorySysV.h unix/Semaphore.h unix/Launcher.h)
endif(WIN32)
include_directories(.)
set(HEADERS
Launcher.h
MemoryPool.h
Product.h
RingQueue.h
Semaphore.h
SharedMemory.h
SystemError.h
${PLATFORM}
)
add_executable(test_file_to_string test/test_file_to_string.cpp)
add_executable(test_std_queue test/test_std_queue.cpp)
add_executable(test_ring_queue RingQueue.h test/test_ring_queue.cpp)
add_executable(test_producer ${HEADERS} test/Producer.h test/test_producer.cpp)
add_executable(test_consumer ${HEADERS} test/Consumer.h test/test_consumer.cpp)
if(NOT WIN32)
target_link_libraries(test_producer rt pthread)
target_link_libraries(test_consumer rt pthread)
endif(NOT WIN32)