mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2025-05-22 18:08:05 +08:00
CMakeLists fixes
This commit is contained in:

committed by
Aurelien Labrosse

parent
53916f823c
commit
b75b19c969
@ -1,6 +1,6 @@
|
|||||||
###################################################################################
|
###################################################################################
|
||||||
# #
|
# #
|
||||||
# NAME: CMakeLsits.txt #
|
# NAME: CMakeLists.txt #
|
||||||
# #
|
# #
|
||||||
# AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams. #
|
# AUTHOR: Mike Karlesky, Mark VanderVoord, Greg Williams. #
|
||||||
# WRITTEN BY: Michael Brockus. #
|
# 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.")
|
project(unity LANGUAGES C DESCRIPTION "C Unit testing framework.")
|
||||||
|
|
||||||
|
add_subdirectory(src)
|
||||||
add_subdirectory("src")
|
target_include_directories(unity
|
||||||
|
|
||||||
|
|
||||||
target_include_directories("unity"
|
|
||||||
PUBLIC
|
PUBLIC
|
||||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>"
|
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>"
|
||||||
"$<INSTALL_INTERFACE:src>"
|
"$<INSTALL_INTERFACE:src>"
|
||||||
@ -25,15 +22,9 @@ target_include_directories("unity"
|
|||||||
PRIVATE "src"
|
PRIVATE "src"
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library("unity::framework" ALIAS "unity")
|
add_library(unity::framework ALIAS unity)
|
||||||
|
|
||||||
install(TARGETS "unity" EXPORT "unityConfig"
|
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/ DESTINATION src)
|
||||||
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)
|
install(EXPORT unityConfig DESTINATION share/unityConfig/cmake)
|
||||||
|
|
||||||
# This makes the project importable from the build directory
|
# This makes the project importable from the build directory
|
||||||
|
@ -8,9 +8,15 @@
|
|||||||
# License: MIT #
|
# 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")
|
|
||||||
|
Reference in New Issue
Block a user