Description: Fix build infra
 Link some libs and install targets
Author: Stefan Fritsch <sf@debian.org>
Origin: vendor
Forwarded: no
Last-Update: 2016-11-02

--- mapcode.orig/CMakeLists.txt
+++ mapcode/CMakeLists.txt
@@ -65,11 +65,23 @@ set(SOURCE_FILES_UNITTEST
 set(SOURCE_FILES_UTILITY
         utility/mapcode.cpp)
 
+set(THREADS_PREFER_PTHREAD_FLAG ON)
+find_package(Threads REQUIRED)
+find_library(M_LIB m)
+
 add_library(mapcodelib ${SOURCE_FILES_MAPCODELIB})
 target_include_directories(mapcodelib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
+target_link_libraries(mapcodelib Threads::Threads)
+target_link_libraries(mapcodelib ${M_LIB})
 
 add_executable(unittest ${SOURCE_FILES_UNITTEST})
 target_link_libraries(unittest LINK_PUBLIC mapcodelib)
+target_link_libraries(unittest LINK_PUBLIC Threads::Threads)
+target_link_libraries(unittest LINK_PUBLIC ${M_LIB})
 
 add_executable(mapcode ${SOURCE_FILES_UTILITY})
 target_link_libraries(mapcode LINK_PUBLIC mapcodelib)
+target_link_libraries(mapcode LINK_PUBLIC Threads::Threads)
+target_link_libraries(mapcode LINK_PUBLIC ${M_LIB})
+
+install(TARGETS mapcode DESTINATION /usr/bin)
