X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=CMakeLists.txt;h=e8c532ca5b166eca8e7b649f99f9d91b9c04070c;hb=28c8149a34cf16d7ac7fb1e7b07914200034a8d5;hp=3b09b26cf2c40a0a95f7605ed41dc6ecc5c37672;hpb=2b6bbfbcbb8c09c6c2bcdf80a54f5a79432deaaf;p=umurmur.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b09b26..e8c532c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,18 +7,38 @@ add_definitions() include(FindPkgConfig) include(CheckFunctionExists) include(CheckLibraryExists) - -pkg_check_modules(BASELIBS libconfig) -check_function_exists(clock_gettime GAVE_CLOCK_GETTIME) -check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME_RT) - -set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g") -set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3") +include(CheckSymbolExists) + +pkg_check_modules(LIBCONFIG libconfig) +pkg_check_modules(LIBPROTOBUF libprotobuf-c) + +if(DEFINED SSL) + pkg_check_modules(SSLIMP REQUIRED ${SSL}) +else() + pkg_check_modules(SSLIMP REQUIRED polarssl) +endif() + +check_function_exists(clock_gettime HAVE_CLOCK_GETTIME) + +if(NOT HAVE_CLOCK_GETTIME) + check_library_exists(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME_RT) + if(NOT HAVE_CLOCK_GETTIME_RT) + check_library_exists(c clock_get_time "mach/time.h" HAVE_CLOCK_GET_TIME) + if(NOT HAVE_CLOCK_GET_TIME) + message(FATAL_ERROR "Didn't find clock_gettime() or clock_get_time!") + endif() + else() + set(LIBRARIES ${LIBRARIES} rt) + endif() +endif() set(SOURCE "") add_subdirectory(src) include_directories(include) +add_definitions(${LIBCONFIG_CFLAGS} ${LIBPROTOBUF_CFLAGS} ${SSLIMP_CFLAGS}) +#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBCONFIG_CFLAGS} ${LIBPROTOBUF_CFLAGS}") + add_executable(umurmurd ${SOURCE}) -target_link_libraries(umurmurd pthread) +target_link_libraries(umurmurd ${LIBCONFIG_LIBRARIES} ${LIBPROTOBUF_LIBRARIES} ${SSLIMP_LIBRARIES})