aboutsummaryrefslogtreecommitdiff
path: root/ports/simdjson/fix-cmake.patch
diff options
context:
space:
mode:
Diffstat (limited to 'ports/simdjson/fix-cmake.patch')
-rw-r--r--ports/simdjson/fix-cmake.patch70
1 files changed, 70 insertions, 0 deletions
diff --git a/ports/simdjson/fix-cmake.patch b/ports/simdjson/fix-cmake.patch
new file mode 100644
index 000000000..ebd8291b4
--- /dev/null
+++ b/ports/simdjson/fix-cmake.patch
@@ -0,0 +1,70 @@
+diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt
+index cb12222..ed728d8 100644
+--- a/benchmark/CMakeLists.txt
++++ b/benchmark/CMakeLists.txt
+@@ -1,7 +1,6 @@
+-target_include_directories(${SIMDJSON_LIB_NAME}
+- PUBLIC
+- ${PROJECT_SOURCE_DIR}/benchmark
+- ${PROJECT_SOURCE_DIR}/benchmark/linux
++target_include_directories(${SIMDJSON_LIB_NAME} INTERFACE
++ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/benchmark>
++ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/benchmark/linux>
+ )
+
+ add_cpp_benchmark(parse)
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index dd96ee8..20feac3 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -3,6 +3,7 @@ if(${CMAKE_C_COMPILER_ID} MATCHES "Intel") # icc / icpc
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-intel")
+ endif()
+
++include(GNUInstallDirs)
+
+ # we default on a shared library.
+ if(SIMDJSON_BUILD_STATIC)
+@@ -26,11 +27,24 @@ set(SIMDJSON_SRC
+ )
+
+ add_library(${SIMDJSON_LIB_NAME} ${SIMDJSON_LIB_TYPE} ${SIMDJSON_SRC})
+-target_include_directories(${SIMDJSON_LIB_NAME}
+- PUBLIC ${PROJECT_SOURCE_DIR}/include
++
++target_include_directories(${SIMDJSON_LIB_NAME} PUBLIC
++ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
++ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
++)
++
++install(TARGETS ${SIMDJSON_LIB_NAME}
++ EXPORT ${SIMDJSON_LIB_NAME}-config
++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ )
+
+-install(TARGETS ${SIMDJSON_LIB_NAME} DESTINATION lib)
++install(EXPORT ${SIMDJSON_LIB_NAME}-config
++ FILE unofficial-${SIMDJSON_LIB_NAME}-config.cmake
++ NAMESPACE unofficial::${SIMDJSON_LIB_NAME}::
++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/unofficial-${SIMDJSON_LIB_NAME}
++)
+
+ if(NOT MSVC)
+ ## We output the library at the root of the current directory where cmake is invoked
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 86a89f9..c3dfa12 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -1,7 +1,7 @@
+ if(MSVC)
+-target_include_directories(${SIMDJSON_LIB_NAME}
+- PUBLIC ${PROJECT_SOURCE_DIR}/windows
+-)
++ target_include_directories(${SIMDJSON_LIB_NAME} INTERFACE
++ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/windows>
++ )
+ endif()
+
+ add_cpp_test(jsoncheck)