@@ -42,40 +42,35 @@ set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${DEBUG_FLAGS}
4242set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${DEBUG_FLAGS} " )
4343set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${DEBUG_FLAGS} " )
4444
45- find_package (Protobuf REQUIRED)
4645find_package (Threads REQUIRED)
47- find_package (ZLIB REQUIRED)
4846
49- include_directories (
50- ${PROTOBUF_INCLUDE_DIRS}
51- ${ZLIB_INCLUDE_DIRS}
52- ${CMAKE_CURRENT_BINARY_DIR}
53- ${CMAKE_CURRENT_SOURCE_DIR}
54- ${CMAKE_SOURCE_DIR}
55- )
47+ include_directories (${OSMPBF_INCLUDE_DIRS} )
5648
57- set (OSMPBF_LIBRARIES ${osmpbf_BINARY_DIR} /libosmpbf.a)
49+ set (MY_LINK_LIBRARIES
50+ ${OSMPBF_LINK_LIBRARIES}
51+ ${CMAKE_THREAD_LIBS_INIT}
52+ )
5853
5954add_executable (dumppbf dumppbf.cpp)
6055add_dependencies (dumppbf osmpbf)
61- target_link_libraries (dumppbf ${OSMPBF_LIBRARIES} ${ZLIB_LIBRARIES} ${PROTOBUF_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} )
56+ target_link_libraries (dumppbf )
6257
6358add_executable (dumppbf_openmp dumppbf.cpp)
6459add_dependencies (dumppbf_openmp osmpbf)
65- target_link_libraries (dumppbf_openmp ${OSMPBF_LIBRARIES} ${ZLIB_LIBRARIES} ${PROTOBUF_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT } )
60+ target_link_libraries (dumppbf_openmp ${MY_LINK_LIBRARIES } )
6661add_target_properties(dumppbf_openmp COMPILE_FLAGS "-fopenmp" )
6762add_target_properties(dumppbf_openmp LINK_FLAGS "-fopenmp" )
6863
6964add_executable (dumppbf_parsehelpers dumppbf_parsehelpers.cpp)
7065add_dependencies (dumppbf_parsehelpers osmpbf)
71- target_link_libraries (dumppbf_parsehelpers ${OSMPBF_LIBRARIES} ${ZLIB_LIBRARIES} ${PROTOBUF_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT } )
66+ target_link_libraries (dumppbf_parsehelpers ${MY_LINK_LIBRARIES } )
7267add_target_properties(dumppbf_parsehelpers COMPILE_FLAGS "-fopenmp" )
7368add_target_properties(dumppbf_parsehelpers LINK_FLAGS "-fopenmp" )
7469
7570add_executable (filteredCount filteredCount.cpp)
7671add_dependencies (filteredCount osmpbf)
77- target_link_libraries (filteredCount ${OSMPBF_LIBRARIES} ${ZLIB_LIBRARIES} ${PROTOBUF_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT } )
72+ target_link_libraries (filteredCount ${MY_LINK_LIBRARIES } )
7873
7974add_executable (osmpbf_dump osmpbf_dump.cpp)
8075add_dependencies (osmpbf_dump osmpbf)
81- target_link_libraries (osmpbf_dump ${OSMPBF_LIBRARIES} ${ZLIB_LIBRARIES} ${PROTOBUF_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT } )
76+ target_link_libraries (osmpbf_dump ${MY_LINK_LIBRARIES } )
0 commit comments