From 9dc7cb1b5cf9d0cbfc3227b7acbde446190054b0 Mon Sep 17 00:00:00 2001 From: Michael Brockus Date: Mon, 18 Feb 2019 12:35:53 -0800 Subject: [PATCH 1/2] Adding CMake script to unity test framework. --- CMakeLists.txt | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..282ea4c --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,68 @@ +##################################################### +# FILE NAME CMakeLists.txt # +# # +# PURPOSE contains CMake statements. # +# # +##################################################### +cmake_minimum_required(VERSION 3.13.2.0 FATAL_ERROR) + + + +# +# CMake: Declare project +# +project(unity LANGUAGES C DESCRIPTION "C Unit testing framework.") + + + +# +# CMake: Creation of library +# +add_library("unity" STATIC) + + + +# +# CMake: Adding source to target +# +target_sources("unity" PRIVATE "src/unity.c") + + + +# +# CMake: Including directories to target +# +target_include_directories("unity" + PUBLIC + "$" + "$" + + PRIVATE "src" +) + + + +# +# CMake: Give target an alias +# +add_library("unity::framework" ALIAS "unity") + + + +# +# CMake: export project +# +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}" + + INCLUDES DESTINATION "${CMAKE_INSTALL_LIBDIR}" +) + +install(DIRECTORY src/ DESTINATION src) + +install(EXPORT unityConfig DESTINATION share/unityConfig/cmake) + +# This makes the project importable from the build directory +export(TARGETS unity FILE unityConfig.cmake) \ No newline at end of file From 3e4d064c42cf8db428b96d72c463b7dd71b5cc71 Mon Sep 17 00:00:00 2001 From: Michael Brockus Date: Tue, 19 Feb 2019 09:45:50 -0800 Subject: [PATCH 2/2] Singing my name on the script. --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 282ea4c..0eddcd7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,8 @@ ##################################################### # FILE NAME CMakeLists.txt # # # +# WRITTEN BY Michael Brockus. # +# # # PURPOSE contains CMake statements. # # # ##################################################### @@ -65,4 +67,4 @@ install(DIRECTORY src/ DESTINATION src) install(EXPORT unityConfig DESTINATION share/unityConfig/cmake) # This makes the project importable from the build directory -export(TARGETS unity FILE unityConfig.cmake) \ No newline at end of file +export(TARGETS unity FILE unityConfig.cmake)