Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/FBGEMM.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Burke <aaron@focuszonedevelopment.com>2020-08-12 00:50:27 +0300
committerGitHub <noreply@github.com>2020-08-12 00:50:27 +0300
commitc5b2a72e1b128406b178f473882800b24d54dc01 (patch)
tree2f8d07db251a643ae4e0e89fa753d4319fe15466
parentda28b0abb0e54f4ed6e1444309e23879018689d7 (diff)
Fix public header property in cpuinfo and clog to support submodule installs (#6)
Looks good. Thanks!
-rw-r--r--CMakeLists.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c06b60b..6a26fb9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -160,6 +160,19 @@ if(NOT TARGET cpuinfo)
endif(MSVC)
add_subdirectory("${CPUINFO_SOURCE_DIR}" "${FBGEMM_BINARY_DIR}/cpuinfo")
set_property(TARGET cpuinfo PROPERTY POSITION_INDEPENDENT_CODE ON)
+
+ #cpuinfo doesn't correctly prefix its public header with ${CMAKE_CURRENT_LIST_DIR},
+ #which breaks installation targets including it as a submodule, so fix that
+ get_property(CPUINFO_PUBLIC_HEADER_PROP TARGET cpuinfo PROPERTY PUBLIC_HEADER)
+ list(APPEND CPUINFO_PUBLIC_HEADERS ${CPUINFO_PUBLIC_HEADER_PROP}) # Ensure it's a list
+ list(TRANSFORM CPUINFO_PUBLIC_HEADERS PREPEND "${CPUINFO_SOURCE_DIR}/" REGEX "include.*")
+ set_property(TARGET cpuinfo PROPERTY PUBLIC_HEADER ${CPUINFO_PUBLIC_HEADERS})
+
+ #same for clog
+ get_property(CLOG_PUBLIC_HEADER_PROP TARGET clog PROPERTY PUBLIC_HEADER)
+ list(APPEND CLOG_PUBLIC_HEADERS ${CLOG_PUBLIC_HEADER_PROP}) # Ensure it's a list
+ list(TRANSFORM CLOG_PUBLIC_HEADERS PREPEND "${CPUINFO_SOURCE_DIR}/deps/clog/${CLOG_PUBLIC_HEADER}/" REGEX "include.*")
+ set_property(TARGET clog PROPERTY PUBLIC_HEADER ${CLOG_PUBLIC_HEADERS})
endif()
target_include_directories(fbgemm_generic BEFORE