diff --git a/CMakeLists.txt b/CMakeLists.txt index dfc243c4816b266310f80bfde86d4143657cdb41..08fafd9d7ee667da2a54e402ca128f24c3baea50 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ ################################################################################### # # -# NAME: CMakeLsits.txt # +# NAME: CMakeLists.txt # # # # AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams. # # WRITTEN BY: Michael Brockus. # @@ -13,11 +13,8 @@ cmake_minimum_required(VERSION 3.0 FATAL_ERROR) project(unity LANGUAGES C DESCRIPTION "C Unit testing framework.") - -add_subdirectory("src") - - -target_include_directories("unity" +add_subdirectory(src) +target_include_directories(unity PUBLIC "$" "$" @@ -25,15 +22,9 @@ target_include_directories("unity" 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}" - INCLUDES DESTINATION "${CMAKE_INSTALL_LIBDIR}") +add_library(unity::framework ALIAS unity) -install(DIRECTORY src/ DESTINATION src) +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/ DESTINATION src) install(EXPORT unityConfig DESTINATION share/unityConfig/cmake) # This makes the project importable from the build directory diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4aa2bcbde9cb88898f9ccd3553c195b117376890..c747cb0ae4a9f6e7f9adb2a79fb4090ddd4c2077 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -8,9 +8,15 @@ # License: MIT # # # ################################################################################### -cmake_minimum_required(VERSION 3.13.2.0 FATAL_ERROR) +cmake_minimum_required(VERSION 3.0 FATAL_ERROR) -add_library("unity" STATIC) +add_library(unity STATIC "unity.c") + +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}") + -target_sources("unity" PRIVATE "unity.c")