Skip to content

Commit

Permalink
move drishti_merge_libraries cmake feature to subdir (#741)
Browse files Browse the repository at this point in the history
* add license headers and move drishti_merge_libraries to subdirectory

* add license header to merge feature support files

* move support files for merge feature to merge subdir
  • Loading branch information
headupinclouds authored Jan 2, 2019
1 parent b9cadae commit c88f059
Show file tree
Hide file tree
Showing 14 changed files with 92 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions cmake/Modules/drishti_merge_print.cmake

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
11 changes: 11 additions & 0 deletions cmake/Modules/merge/drishti_merge_print.cmake
Original file line number Diff line number Diff line change
@@ -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()
Original file line number Diff line number Diff line change
@@ -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 "")
Expand Down
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
12 changes: 12 additions & 0 deletions cmake/Modules/merge/source/foo.cpp
Original file line number Diff line number Diff line change
@@ -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() {
}
2 changes: 0 additions & 2 deletions cmake/Modules/source/foo.cpp

This file was deleted.

8 changes: 4 additions & 4 deletions src/lib/drishti/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit c88f059

Please sign in to comment.