Refactor of CMake for cleaner dependency handling

This commit is contained in:
Jack Andersen 2019-06-11 15:54:20 -10:00
parent 77013bbd9f
commit 47322b9496
3 changed files with 12 additions and 12 deletions

View File

@ -1,8 +1,8 @@
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
cmake_minimum_required(VERSION 3.10 FATAL_ERROR) # because of c++17
project(nod VERSION 0.1)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
cmake_minimum_required(VERSION 3.10 FATAL_ERROR) # because of c++17
project(nod VERSION 0.1)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()
include (CMakePackageConfigHelpers)
@ -15,14 +15,13 @@ endif()
if (NOT TARGET logvisor)
add_subdirectory(logvisor)
set(LOGVISOR_INCLUDE_DIR logvisor/include)
endif()
include_directories(include ${LOGVISOR_INCLUDE_DIR})
file(GLOB NOD_HEADERS include/nod/*.h*)
add_subdirectory(lib)
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")

View File

@ -16,8 +16,9 @@ add_library(nod
nod.cpp
${PLAT_SRCS}
${NOD_HEADERS})
target_link_libraries(nod PUBLIC logvisor)
if(NOT MSVC AND NOT NX)
set_source_files_properties(aes.cpp PROPERTIES COMPILE_FLAGS -maes)
set_source_files_properties(aes.cpp PROPERTIES COMPILE_FLAGS -maes)
endif()
# Associate target with export

@ -1 +1 @@
Subproject commit ebe7463e671388902e56084453a464e35389324a
Subproject commit a0ef17d895ba655ade171f76a984663639a1d390