CMakeLists: Move lib-specific CMake commands into the lib folder

Keeps a clear division between the lib and the driver CMake code.
This commit is contained in:
Lioncash 2019-08-30 04:53:03 -04:00
parent 89df98ee96
commit 1b3bb7815d
2 changed files with 7 additions and 2 deletions

View File

@ -19,8 +19,6 @@ endif()
add_subdirectory(lib) add_subdirectory(lib)
add_subdirectory(driver) add_subdirectory(driver)
target_include_directories(nod PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
install(DIRECTORY include/nod DESTINATION include)
set(version_config_file "${PROJECT_BINARY_DIR}/nodConfigVersion.cmake") set(version_config_file "${PROJECT_BINARY_DIR}/nodConfigVersion.cmake")
set(config_file "${PROJECT_BINARY_DIR}/nodConfig.cmake") set(config_file "${PROJECT_BINARY_DIR}/nodConfig.cmake")

View File

@ -21,6 +21,11 @@ add_library(nod
../include/nod/sha1.h ../include/nod/sha1.h
../include/nod/Util.hpp ../include/nod/Util.hpp
) )
target_include_directories(nod PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
)
target_link_libraries(nod PUBLIC logvisor) target_link_libraries(nod PUBLIC logvisor)
if(WIN32) if(WIN32)
@ -41,3 +46,5 @@ install(
ARCHIVE DESTINATION "lib" ARCHIVE DESTINATION "lib"
INCLUDES DESTINATION include # This sets the INTERFACE_INCLUDE_DIRECTORIES property of the target. INCLUDES DESTINATION include # This sets the INTERFACE_INCLUDE_DIRECTORIES property of the target.
) )
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../include/nod DESTINATION include)