Skip to content

Commit

Permalink
Merge pull request #101 from r00t-/fix_build_without_libsml
Browse files Browse the repository at this point in the history
Fix build without libsml
  • Loading branch information
andig committed Jan 8, 2015
2 parents 1d27228 + 4fb556d commit ffc6b5c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Expand Up @@ -149,7 +149,12 @@ message("")
message(" ***** Configuration parameters *****")
message(" prefix: ${CMAKE_INSTALL_PREFIX}")
message(" json: -L${JSON_LIBRARY} -I${JSON_INCLUDE_DIR}")
message(" sml: -L${SML_LIBRARY} -I${SML_INCLUDE_DIR}")
if(SML_FOUND)
message(" sml: -L${SML_LIBRARY} -I${SML_INCLUDE_DIR}")
else(SML_FOUND)
message(" sml: NOT FOUND")
endif(SML_FOUND)

message(" microhttpd: -L${MICROHTTPD_LIBRARY} -I${MICROHTTPD_INCLUDE_DIR}")

if( ENABLE_SML AND NOT SML_FOUND)
Expand Down
5 changes: 4 additions & 1 deletion src/CMakeLists.txt
Expand Up @@ -44,7 +44,10 @@ add_executable(vzlogger ${vzlogger_srcs})

target_link_libraries(vzlogger proto vz vz-api)
target_link_libraries(vzlogger ${JSON_LIBRARY})
target_link_libraries(vzlogger ${SML_LIBRARY})
if(SML_FOUND)
target_link_libraries(vzlogger ${SML_LIBRARY})
endif(SML_FOUND)

target_link_libraries(vzlogger ${MICROHTTPD_LIBRARY})
target_link_libraries(vzlogger ${LIBGCRYPT})
target_link_libraries(vzlogger pthread m ${LIBUUID})
Expand Down
7 changes: 6 additions & 1 deletion tests/CMakeLists.txt
Expand Up @@ -5,16 +5,21 @@ include_directories(

# all *.cpp files here will be used.
file(GLOB test_sources *.cpp)
if(NOT SML_FOUND)
list(REMOVE_ITEM test_sources ${CMAKE_CURRENT_SOURCE_DIR}/MeterSML.cpp)
endif(NOT SML_FOUND)

add_executable(vzlogger_unit_tests ${test_sources})

target_link_libraries(vzlogger_unit_tests
${GTEST_LIBS_DIR}/libgtest.a
${GMOCK_LIBS_DIR}/libgmock.a
${JSON_LIBRARY}
${SML_LIBRARY}
${LIBUUID}
dl
pthread)
target_link_libraries(vzlogger_unit_tests ${CURL_STATIC_LIBRARIES} ${CURL_LIBRARIES} ${GNUTLS_LIBRARIES})

if(SML_FOUND)
target_link_libraries(vzlogger_unit_tests ${SML_LIBRARY})
endif(SML_FOUND)

0 comments on commit ffc6b5c

Please sign in to comment.