1 CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
4 SET(STINGER_VERSION_MAJOR 2013)
5 SET(STINGER_VERSION_MINOR 06)
7 SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
8 SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
9 SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
11 FIND_PACKAGE( OpenMP )
13 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
14 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
15 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
21 # Apple doesn't support librt, using CoreServices instead
22 LINK_LIBRARIES(/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices)
24 # Not sure what to do here as far as librt...?
33 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in
34 ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
36 ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
37 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
38 COMMENT "Generating API documentation with Doxygen" VERBATIM
42 # Custom protobuf to use STINGER distributed version
43 function(CUST_PROTOBUF_GENERATE_CPP SUBDIR SRCS HDRS)
45 message(SEND_ERROR "Error: PROTOBUF_GENERATE_CPP() called without any proto files")
52 get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
53 get_filename_component(FIL_WE ${FIL} NAME_WE)
55 list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${SUBDIR}/proto/${FIL_WE}.pb.cc")
56 list(APPEND ${HDRS} "${CMAKE_CURRENT_BINARY_DIR}/${SUBDIR}/proto/${FIL_WE}.pb.h")
59 OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${SUBDIR}/proto/${FIL_WE}.pb.cc"
60 "${CMAKE_CURRENT_BINARY_DIR}/${SUBDIR}/proto/${FIL_WE}.pb.h"
61 COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/protoc
62 ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} --proto_path ${CMAKE_CURRENT_SOURCE_DIR} ${ABS_FIL}
64 COMMENT "Running C++ protocol buffer compiler on ${FIL}"
68 set_source_files_properties(${${SRCS}} ${${HDRS}} PROPERTIES GENERATED TRUE)
69 set(${SRCS} ${${SRCS}} PARENT_SCOPE)
70 set(${HDRS} ${${HDRS}} PARENT_SCOPE)
73 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu9x")
75 INCLUDE_DIRECTORIES("${CMAKE_BINARY_DIR}/include")