-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathCMakeLists.txt
45 lines (30 loc) · 2.21 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 2.8)
project(lightq_project)
SET( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -m64 -DDEBUG -std=c++11 -DPICOJSON_USE_INT64 -O0 -g " )
SET( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -m64 -DNDEBUG -std=c++11 -Wall -Wextra -Wfloat-equal -Wundef -Wcast-align -Wwrite-strings -Wlogical-op -Wmissing-declarations -Wredundant-decls -Wshadow -Woverloaded-virtual -Wformat=2 -DPICOJSON_USE_INT64 -O3 -g " )
include_directories(/usr/local/include include include/thirdparty /opt/zeromq/include)
link_directories( /opt/zeromq/lib /usr/local/opt/zlib/lib)
add_library(lightq SHARED src/lightq_api.cpp)
TARGET_LINK_LIBRARIES(lightq zmq)
install(TARGETS lightq DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/examples/lib)
install(TARGETS lightq DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/bin)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/lightq_api.h DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/examples/include)
add_executable(lightq-test examples/lightq-test.cpp)
target_link_libraries(lightq-test zmq z)
install(TARGETS lightq-test DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/bin)
SET( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -m64 -DDEBUG -std=c11 -O0 -g " )
SET( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -m64 -DNDEBUG -std=c11 -Wall -Wextra -Wfloat-equal -Wundef -Wcast-align -Wwrite-strings -Wlogical-op -Wmissing-declarations -Wredundant-decls -Wshadow -Wformat=2 -O3 -g " )
find_package (Threads)
link_directories( ${PROJECT_BINARY_DIR}/lib )
add_executable(lightq-broker examples/lightq-broker.c)
target_link_libraries(lightq-broker lightq zmq pthread )
install(TARGETS lightq-broker DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/bin)
add_executable(lightq-consumer examples/lightq-consumer.c)
target_link_libraries(lightq-consumer lightq zmq pthread)
install(TARGETS lightq-consumer DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/bin)
add_executable(lightq-producer examples/lightq-producer.c)
target_link_libraries(lightq-producer lightq zmq pthread)
install(TARGETS lightq-producer DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/bin)
add_executable(lightq-topic examples/lightq-topic.c)
target_link_libraries(lightq-topic lightq zmq pthread)
install(TARGETS lightq-topic DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/bin)