diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a31eb59..78321281 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,10 +61,13 @@ option(DRISHTI_BUILD_MERGED_SDK "Merge all static dependencies" OFF) option(DRISHTI_COPY_3RDPARTY_LICENSES "Install 3rd party licenses" ON) if(DRISHTI_BUILD_MERGED_SDK) + + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/Modules/merge") # Override the drishti-upload DRISHTI_BUILD_OPENCV_WORLD option, since the opencv_world # library contains duplicate object filenames that prevents a successful split + merge # due to limitations in the ar utility. option(DRISHTI_BUILD_OPENCV_WORLD "Build OpenCV world (monolithic lib)" OFF) + endif() option(DRISHTI_BUILD_ACF "Drishti ACF lib" ON) diff --git a/cmake/Modules/drishti_merge_print.cmake b/cmake/Modules/drishti_merge_print.cmake deleted file mode 100644 index 4c22ead9..00000000 --- a/cmake/Modules/drishti_merge_print.cmake +++ /dev/null @@ -1,3 +0,0 @@ -function(drishti_merge_print) - message("[merge static] " ${ARGV}) -endfunction() diff --git a/cmake/Modules/drishti_get_library_location.cmake b/cmake/Modules/merge/drishti_get_library_location.cmake similarity index 75% rename from cmake/Modules/drishti_get_library_location.cmake rename to cmake/Modules/merge/drishti_get_library_location.cmake index 390e55ab..93d49054 100644 --- a/cmake/Modules/drishti_get_library_location.cmake +++ b/cmake/Modules/merge/drishti_get_library_location.cmake @@ -1,3 +1,11 @@ +# @file drishti_get_library_location.cmake +# @brief CMake script to return the location of a library target. +# +# \copyright Copyright 2014-2018 Elucideye, Inc. All rights reserved. +# \license{This project is released under the 3 Clause BSD License.} +# +# This is a helper routine for drishti_merge_libraries.cmake + include(CMakeParseArguments) # cmake_parse_arguments function(drishti_get_library_location) diff --git a/cmake/Modules/drishti_merge_get_all_dependencies.cmake b/cmake/Modules/merge/drishti_merge_get_all_dependencies.cmake similarity index 88% rename from cmake/Modules/drishti_merge_get_all_dependencies.cmake rename to cmake/Modules/merge/drishti_merge_get_all_dependencies.cmake index dc9357eb..b4d97e4c 100644 --- a/cmake/Modules/drishti_merge_get_all_dependencies.cmake +++ b/cmake/Modules/merge/drishti_merge_get_all_dependencies.cmake @@ -1,3 +1,11 @@ +# @file drishti_merge_librariers_ar_ranlib.cmake +# @brief CMake script to recursively collect dependencies for a tyarget. +# +# \copyright Copyright 2014-2018 Elucideye, Inc. All rights reserved. +# \license{This project is released under the 3 Clause BSD License. +# +# This is a helper routine for drishti_merge_libraries.cmake} + include(drishti_merge_print) include(CMakeParseArguments) # cmake_parse_arguments diff --git a/cmake/Modules/drishti_merge_libraries.cmake b/cmake/Modules/merge/drishti_merge_libraries.cmake similarity index 88% rename from cmake/Modules/drishti_merge_libraries.cmake rename to cmake/Modules/merge/drishti_merge_libraries.cmake index 48417659..121032cf 100644 --- a/cmake/Modules/drishti_merge_libraries.cmake +++ b/cmake/Modules/merge/drishti_merge_libraries.cmake @@ -1,3 +1,9 @@ +# @file drishti_merge_librariers.cmake +# @brief CMake scripts to recursively gather deps, split to .o files, and merge to mega *.a +# +# \copyright Copyright 2014-2018 Elucideye, Inc. All rights reserved. +# \license{This project is released under the 3 Clause BSD License.} + include(CMakeParseArguments) # cmake_parse_arguments cmake_policy(SET CMP0026 OLD) # drishti_merge_libraries_msvc use LOCATION diff --git a/cmake/Modules/drishti_merge_libraries_ar_ranlib.cmake b/cmake/Modules/merge/drishti_merge_libraries_ar_ranlib.cmake similarity index 84% rename from cmake/Modules/drishti_merge_libraries_ar_ranlib.cmake rename to cmake/Modules/merge/drishti_merge_libraries_ar_ranlib.cmake index 345893b0..037cf362 100644 --- a/cmake/Modules/drishti_merge_libraries_ar_ranlib.cmake +++ b/cmake/Modules/merge/drishti_merge_libraries_ar_ranlib.cmake @@ -1,3 +1,11 @@ +# @file drishti_merge_librariers_ar_ranlib.cmake +# @brief CMake scripts to merge static dependencies using ar/ranlib. +# +# \copyright Copyright 2014-2018 Elucideye, Inc. All rights reserved. +# \license{This project is released under the 3 Clause BSD License.} +# +# This is a helper routine for drishti_merge_libraries.cmake + include(CMakeParseArguments) # cmake_parse_arguments function(drishti_merge_libraries_ar_ranlib) diff --git a/cmake/Modules/drishti_merge_libraries_msvc.cmake b/cmake/Modules/merge/drishti_merge_libraries_msvc.cmake similarity index 83% rename from cmake/Modules/drishti_merge_libraries_msvc.cmake rename to cmake/Modules/merge/drishti_merge_libraries_msvc.cmake index eeab24c2..bbaa91e9 100644 --- a/cmake/Modules/drishti_merge_libraries_msvc.cmake +++ b/cmake/Modules/merge/drishti_merge_libraries_msvc.cmake @@ -1,3 +1,11 @@ +# @file drishti_merge_librariers_ar_ranlib.cmake +# @brief CMake scripts to merge static dependencies w/ MSVC. +# +# \copyright Copyright 2014-2018 Elucideye, Inc. All rights reserved. +# \license{This project is released under the 3 Clause BSD License.} +# +# This is a helper routine for drishti_merge_libraries.cmake + include(CMakeParseArguments) # cmake_parse_arguments include(drishti_get_library_location) diff --git a/cmake/Modules/drishti_merge_libraries_xcode.cmake b/cmake/Modules/merge/drishti_merge_libraries_xcode.cmake similarity index 85% rename from cmake/Modules/drishti_merge_libraries_xcode.cmake rename to cmake/Modules/merge/drishti_merge_libraries_xcode.cmake index 91da7d95..82357c17 100644 --- a/cmake/Modules/drishti_merge_libraries_xcode.cmake +++ b/cmake/Modules/merge/drishti_merge_libraries_xcode.cmake @@ -1,3 +1,11 @@ +# @file drishti_merge_librariers_ar_ranlib.cmake +# @brief CMake script to merge static dependencies w/ xcode. +# +# \copyright Copyright 2014-2018 Elucideye, Inc. All rights reserved. +# \license{This project is released under the 3 Clause BSD License.} +# +# This is a helper routine for drishti_merge_libraries.cmake + include(CMakeParseArguments) # cmake_parse_arguments function(drishti_merge_libraries_xcode) diff --git a/cmake/Modules/merge/drishti_merge_print.cmake b/cmake/Modules/merge/drishti_merge_print.cmake new file mode 100644 index 00000000..de0107da --- /dev/null +++ b/cmake/Modules/merge/drishti_merge_print.cmake @@ -0,0 +1,11 @@ +# @file drishti_merge_librariers_ar_ranlib.cmake +# @brief Print helper +# +# \copyright Copyright 2014-2018 Elucideye, Inc. All rights reserved. +# \license{This project is released under the 3 Clause BSD License.} +# +# This is a helper routine for drishti_merge_libraries.cmake + +function(drishti_merge_print) + message("[merge static] " ${ARGV}) +endfunction() diff --git a/cmake/Modules/script/append.cmake b/cmake/Modules/merge/script/append.cmake similarity index 55% rename from cmake/Modules/script/append.cmake rename to cmake/Modules/merge/script/append.cmake index 6f512c6f..505632da 100644 --- a/cmake/Modules/script/append.cmake +++ b/cmake/Modules/merge/script/append.cmake @@ -1,3 +1,11 @@ +# @file append.cmake +# @brief CMake helper to append libs to master list +# +# \copyright Copyright 2014-2018 Elucideye, Inc. All rights reserved. +# \license{This project is released under the 3 Clause BSD License.} +# +# This is a helper routine for drishti_merge_libraries.cmake + cmake_minimum_required(VERSION 3.1) if("${LIBRARIES_LIST}" STREQUAL "") diff --git a/cmake/Modules/script/create_by_ar_ranlib.cmake b/cmake/Modules/merge/script/create_by_ar_ranlib.cmake similarity index 92% rename from cmake/Modules/script/create_by_ar_ranlib.cmake rename to cmake/Modules/merge/script/create_by_ar_ranlib.cmake index 1aba1c2a..b25c0b95 100644 --- a/cmake/Modules/script/create_by_ar_ranlib.cmake +++ b/cmake/Modules/merge/script/create_by_ar_ranlib.cmake @@ -1,3 +1,11 @@ +# @file create_by_ar_ranlib.cmake +# @brief Use CMAKE_AR and CMAKE_RANLIB to create a single static lib +# +# \copyright Copyright 2014-2018 Elucideye, Inc. All rights reserved. +# \license{This project is released under the 3 Clause BSD License.} +# +# This is a helper routine for drishti_merge_libraries.cmake + cmake_minimum_required(VERSION 3.1) include("${CMAKE_CURRENT_LIST_DIR}/../drishti_merge_print.cmake") diff --git a/cmake/Modules/merge/source/foo.cpp b/cmake/Modules/merge/source/foo.cpp new file mode 100644 index 00000000..abe97317 --- /dev/null +++ b/cmake/Modules/merge/source/foo.cpp @@ -0,0 +1,12 @@ +/** + @file foo.cpp + @brief dummy/empty c++ function for drishti_merge_libraries + + \copyright Copyright 2014-2018 Elucideye, Inc. All rights reserved. + \license{This project is released under the 3 Clause BSD License.} + + CMake add_library() requires at least one source file. +*/ + +void drishti_merge_static_libraries_dummy_function() { +} diff --git a/cmake/Modules/source/foo.cpp b/cmake/Modules/source/foo.cpp deleted file mode 100644 index c46084f9..00000000 --- a/cmake/Modules/source/foo.cpp +++ /dev/null @@ -1,2 +0,0 @@ -void drishti_merge_static_libraries_dummy_function() { -} diff --git a/src/lib/drishti/CMakeLists.txt b/src/lib/drishti/CMakeLists.txt index c1b7efa7..f35d6a24 100644 --- a/src/lib/drishti/CMakeLists.txt +++ b/src/lib/drishti/CMakeLists.txt @@ -299,10 +299,6 @@ target_compile_definitions(${drishti_api_name} PUBLIC _USE_MATH_DEFINES) # defin target_link_libraries(${drishti_api_name} PRIVATE "${drishti_sdk_libs}") list(APPEND drishti_interface_libs ${drishti_api_name}) -generate_export_header(drishti - EXPORT_FILE_NAME "${drishti_export_header}" -) - # Append drishti subdirectory for installed headers set(drishti_include_install_dir "${drishti_include_install_dir}/${drishti_api_name}") @@ -357,6 +353,10 @@ elseif(DRISHTI_BUILD_MERGED_SDK) list(APPEND drishti_interface_libs drishti) endif() +generate_export_header(drishti + EXPORT_FILE_NAME "${drishti_export_header}" +) + # ALIAS target allow us to have same interface while including project add_library(drishti::drishti ALIAS drishti)