summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2012-12-23 21:11:51 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2012-12-23 21:11:51 +0100
commit3c19fd226e3d519be0fe11e451f36940b743c6f7 (patch)
tree4ae25508a86af12a86027487840ca1aed8c804c9
parent577a9c0ed6c28f3e5d1d8c2f8174129a7e80f8ad (diff)
downloadfastd-3c19fd226e3d519be0fe11e451f36940b743c6f7.tar
fastd-3c19fd226e3d519be0fe11e451f36940b743c6f7.zip
Use new pkg-config support of libuecc
-rw-r--r--CMakeLists.txt4
-rw-r--r--FindUECC.cmake16
-rw-r--r--src/CMakeLists.txt7
3 files changed, 7 insertions, 20 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4cdff4a..13c0079 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,7 +12,9 @@ if(NOT CMAKE_USE_PTHREADS_INIT)
MESSAGE(FATAL_ERROR "No pthread support found.")
endif(NOT CMAKE_USE_PTHREADS_INIT)
-find_package(UECC REQUIRED)
+find_package(PkgConfig REQUIRED)
+pkg_check_modules(UECC REQUIRED libuecc>=2)
+
find_package(NaCl REQUIRED)
diff --git a/FindUECC.cmake b/FindUECC.cmake
deleted file mode 100644
index 269c8f7..0000000
--- a/FindUECC.cmake
+++ /dev/null
@@ -1,16 +0,0 @@
-FIND_PATH(UECC_INCLUDE_DIR libuecc/ecc.h)
-FIND_LIBRARY(UECC_LIBRARY NAMES uecc)
-
-IF (UECC_INCLUDE_DIR AND UECC_LIBRARY)
- SET(UECC_FOUND TRUE)
-ENDIF (UECC_INCLUDE_DIR AND UECC_LIBRARY)
-
-IF (UECC_FOUND)
- IF (NOT UECC_FIND_QUIETLY)
- MESSAGE(STATUS "Found libuecc: ${UECC_LIBRARY}; include path: ${UECC_INCLUDE_DIR}")
- ENDIF (NOT UECC_FIND_QUIETLY)
-ELSE (UECC_FOUND)
- IF (UECC_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "Could not find libuecc")
- ENDIF (UECC_FIND_REQUIRED)
-ENDIF (UECC_FOUND)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7bacad5..32ce8c3 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -8,7 +8,8 @@ if(WITH_METHOD_AES128_GCM)
list(APPEND METHODS method_aes128_gcm.c)
endif(WITH_METHOD_AES128_GCM)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${FASTD_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${UECC_INCLUDE_DIR} ${NACL_INCLUDE_DIR})
+include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${FASTD_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${UECC_INCLUDE_DIRS} ${NACL_INCLUDE_DIR})
+link_directories(${UECC_LIBRARY_DIRS})
FLEX_TARGET(fastd_config_lex config.l ${CMAKE_CURRENT_BINARY_DIR}/config.ll.c)
BISON_TARGET(fastd_config_parse config.y ${CMAKE_CURRENT_BINARY_DIR}/config.yy.c)
@@ -30,7 +31,7 @@ add_executable(fastd
${BISON_fastd_config_parse_OUTPUTS}
${METHODS}
)
-set_target_properties(fastd PROPERTIES COMPILE_FLAGS -pthread LINK_FLAGS -pthread)
-target_link_libraries(fastd rt ${UECC_LIBRARY} ${NACL_LIBRARY})
+set_target_properties(fastd PROPERTIES COMPILE_FLAGS -pthread ${UECC_CFLAGS_OTHER} LINK_FLAGS -pthread ${UECC_LDFLAGS_OTHER})
+target_link_libraries(fastd rt ${UECC_LIBRARIES} ${NACL_LIBRARY})
install(TARGETS fastd RUNTIME DESTINATION bin)