CMakeLists.txt 1.7 KB
Newer Older
M
Michael Brockus 已提交
1 2 3 4 5 6 7 8 9 10
###################################################################################
#                                                                                 #
# NAME: CMakeLsits.txt                                                            #
#                                                                                 #
# AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams.                         #
# WRITTEN BY: Michael Brockus.                                                    #
#                                                                                 #
# License: MIT                                                                    #
#                                                                                 #
###################################################################################
M
Michael Brockus 已提交
11
cmake_minimum_required(VERSION 3 FATAL_ERROR)
12 13 14 15 16


project(unity LANGUAGES C DESCRIPTION "C Unit testing framework.")


M
Michael Brockus 已提交
17
add_subdirectory("src")
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33


target_include_directories("unity" 
    PUBLIC 
        "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>"
        "$<INSTALL_INTERFACE:src>"

    PRIVATE "src"
)

add_library("unity::framework" ALIAS "unity")

install(TARGETS "unity" EXPORT "unityConfig"
    ARCHIVE  DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_INSTALL_LIBDIR}"
    LIBRARY  DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_INSTALL_LIBDIR}"
    RUNTIME  DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_INSTALL_BINDIR}"
M
Michael Brockus 已提交
34
    INCLUDES DESTINATION "${CMAKE_INSTALL_LIBDIR}")
35 36 37 38 39

install(DIRECTORY src/ DESTINATION src)
install(EXPORT unityConfig DESTINATION share/unityConfig/cmake)

# This makes the project importable from the build directory
M
Michael Brockus 已提交
40
export(TARGETS unity FILE unityConfig.cmake)