summaryrefslogtreecommitdiff
path: root/cmake/ConvenienceLibrary.cmake
blob: eb6443e1c79a8d5b02d0367004b1e15633385526 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Function for convenience libraries, ie., libraries which can be statically
# linked into shared libraries.
function (add_convenience_library)

    set (name "${ARGV0}")
    list (REMOVE_AT ARGV 0)

    add_library ("${name}" STATIC ${ARGV})

    set_target_properties ("${name}" PROPERTIES
        # Ensure it can be statically linked onto shared libraries
        POSITION_INDEPENDENT_CODE ON
    )

endfunction ()