resolve circular dependencies in h2log
-CMAKE_MINIMUM_REQUIRED(VERSION 3.5.1)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
+CMAKE_POLICY(SET CMP0003 NEW)
ENABLE_LANGUAGE(CXX)
SET(CMAKE_CXX_STANDARD 11)
@@ -7,10 +8,12 @@ SET(CMAKE_CXX_EXTENSIONS OFF)
INCLUDE(GNUInstallDirs)
-SET(H2O_COMMIT "fb0d55a")
-
PROJECT(h2olog)
+IF(NOT H2O_DIR)
+ SET(H2O_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..")
+ENDIF(NOT H2O_DIR)
+
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Release)
ENDIF(NOT CMAKE_BUILD_TYPE)
@@ -40,21 +43,15 @@ SET(SOURCE_FILES
"quic.h"
)
-ADD_CUSTOM_COMMAND(
- OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/quicly-probes.d"
- COMMAND curl -sLf 'https://raw.githubusercontent.com/h2o/h2o/${H2O_COMMIT}/deps/quicly/quicly-probes.d' >${CMAKE_CURRENT_SOURCE_DIR}/quicly-probes.d
-)
-LIST(APPEND DTRACE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/quicly-probes.d")
+FILE(COPY "${H2O_DIR}/deps/quicly/quicly-probes.d" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+LIST(APPEND DTRACE_FILES "${CMAKE_CURRENT_BINARY_DIR}/quicly-probes.d")
-ADD_CUSTOM_COMMAND(
- OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/h2o-probes.d"
- COMMAND curl -sLf 'https://raw.githubusercontent.com/h2o/h2o/${H2O_COMMIT}/h2o-probes.d' >${CMAKE_CURRENT_SOURCE_DIR}/h2o-probes.d
-)
-LIST(APPEND DTRACE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/h2o-probes.d")
+FILE(COPY "${H2O_DIR}/h2o-probes.d" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+LIST(APPEND DTRACE_FILES "${CMAKE_CURRENT_BINARY_DIR}/h2o-probes.d")
ADD_CUSTOM_COMMAND(
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/generated-quic.cc"
- COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/misc/gen-quic-bpf.py" "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/generated-quic.cc"
+ COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/misc/gen-quic-bpf.py" "${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/generated-quic.cc"
DEPENDS ${DTRACE_FILES}
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/misc/gen-quic-bpf.py"
)
