Update CMake environment and add new tool
[umurmur.git] / src / CMakeLists.txt
index f916d71052cc203dec77559d147b34695e9a9b2c..f7c967828118a4bc484a85df4bf9008e6bc0724b 100644 (file)
@@ -7,7 +7,6 @@ set(SOURCE_FILES
   ${CMAKE_CURRENT_SOURCE_DIR}/crypt.c
   ${CMAKE_CURRENT_SOURCE_DIR}/log.c
   ${CMAKE_CURRENT_SOURCE_DIR}/main.c
-  ${CMAKE_CURRENT_SOURCE_DIR}/sharedmemory.c
   ${CMAKE_CURRENT_SOURCE_DIR}/messagehandler.c
   ${CMAKE_CURRENT_SOURCE_DIR}/messages.c
   ${CMAKE_CURRENT_SOURCE_DIR}/pds.c
@@ -15,15 +14,40 @@ set(SOURCE_FILES
   ${CMAKE_CURRENT_SOURCE_DIR}/timer.c
   ${CMAKE_CURRENT_SOURCE_DIR}/util.c
   ${CMAKE_CURRENT_SOURCE_DIR}/voicetarget.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/memory.c
   )
 
 if(SSL MATCHES "openssl")
   list(APPEND SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/ssli_openssl.c)
 elseif(SSL MATCHES "polarssl")
   list(APPEND SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/ssli_polarssl.c)
+elseif(SSL MATCHES "mbedtls")
+  list(APPEND SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/ssli_mbedtls.c)
 elseif(SSL MATCHES "gnutls")
   list(APPEND SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/ssli_gnutls.c)
 endif(SSL MATCHES "openssl")
 
-set(SOURCE ${SOURCE} ${SOURCE_FILES} PARENT_SCOPE)
+if(USE_SHAREDMEMORY_API)
+  list(APPEND SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/sharedmemory.c)
+endif(USE_SHAREDMEMORY_API)
 
+configure_file(config.h.in ${CMAKE_SOURCE_DIR}/src/config.h)
+
+include_directories(${LIBCONFIG_INCLUDE_DIR}
+                    ${PROTOBUFC_INCLUDE_DIR}
+                    ${SSLIMP_INCLUDE_DIR})
+
+link_directories(${LIBCONFIG_LIB_DIR}
+                 ${PROTOBUFC_LIB_DIR}
+                 ${SSLIMP_LIB_DIR})
+
+add_executable(${PROJECT_NAME} ${SOURCE_FILES})
+
+target_link_libraries(${PROJECT_NAME}
+                      ${LIBCONFIG_LIBRARIES}
+                      ${PROTOBUFC_LIBRARIES}
+                      ${SSLIMP_LIBRARIES}
+                      ${LIBRT}
+                      ${CRYPTO_LIBRARIES})
+
+install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION "bin")