From 134abb64aa51d150e11c3285e40ffce758d17faa Mon Sep 17 00:00:00 2001 From: Kevron Rees Date: Wed, 3 Apr 2019 09:20:48 -0700 Subject: [PATCH 1/2] use GNUInstallDirs on *nix --- src/CMakeLists.txt | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6313d50a..d8c8d66c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -247,17 +247,39 @@ target_link_libraries("${CLDNN_BUILD__PROJ}" ${CLDNN__SYSTEM_LINK_LIBRARIES}) # ========================================== Installation ============================================== +if(UNIX) + include(GNUInstallDirs) +endif(UNIX) + + # API headers. -install(DIRECTORY "${CLDNN__API_DIR}/" +if(UNIX) + install(DIRECTORY "${CLDNN__API_DIR}/" + DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/clDNN" + FILE_PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ + ) +else() + install(DIRECTORY "${CLDNN__API_DIR}/" DESTINATION "include/clDNN" FILE_PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ ) +endif(UNIX) + # Binaries. -install(TARGETS "${CLDNN_BUILD__PROJ}" - ARCHIVE DESTINATION "lib" - LIBRARY DESTINATION "lib" - RUNTIME DESTINATION "bin" - INCLUDES DESTINATION "include/clDNN" - ) +if(UNIX) + install(TARGETS "${CLDNN_BUILD__PROJ}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}" + RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}" + INCLUDES DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/clDNN" + ) +else() + install(TARGETS "${CLDNN_BUILD__PROJ}" + ARCHIVE DESTINATION "lib" + LIBRARY DESTINATION "lib" + RUNTIME DESTINATION "bin" + INCLUDES DESTINATION "include/clDNN" + ) +endif(UNIX) # ====================================================================================================== From 0a3c868dd82fa3732a7f8338a824585aaf816a79 Mon Sep 17 00:00:00 2001 From: Kevron Rees Date: Wed, 3 Apr 2019 12:32:20 -0700 Subject: [PATCH 2/2] do not put binaries in src dir --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 40ec0a1e..bf73ac6e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,7 +101,8 @@ set(CLDNN__GTEST_DIR "${CLDNN__COMMON_DIR}/googletest-fused") # Build targets settings. # Path which points to default root directory for compilation output. -set(CLDNN_BUILD__DEFAULT_OUT_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/build/out") +set(CLDNN_BUILD__DEFAULT_OUT_ROOT "${CMAKE_BINARY_DIR}") +set(CLDNN__OUTPUT_DIR, "${CMAKE_BINARY_DIR}") # Prefix for all targets in internal pass. set(CLDNN_BUILD__PROJ_NAME_PREFIX "")