From 7997b68eeef236e6940b0ba168c79dbdd21b34ad Mon Sep 17 00:00:00 2001 From: Abdessattar Sassi <457645+abdes@users.noreply.github.com> Date: Mon, 19 Sep 2022 19:28:58 +0400 Subject: [PATCH 1/2] fix: use correct path for the version include file --- cmake/AsapInstall.cmake | 2 +- tools/version-info/CMakeLists.txt | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmake/AsapInstall.cmake b/cmake/AsapInstall.cmake index ee47d83..ae7caaa 100644 --- a/cmake/AsapInstall.cmake +++ b/cmake/AsapInstall.cmake @@ -85,7 +85,7 @@ if(${META_PROJECT_ID}_INSTALL) # Install generated header files install( - DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/${META_PROJECT_NAME} + DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/${META_PROJECT_ID_LOWER} DESTINATION ${ASAP_INSTALL_INCLUDE} COMPONENT ${dev}) diff --git a/tools/version-info/CMakeLists.txt b/tools/version-info/CMakeLists.txt index 550fb2c..94a238b 100644 --- a/tools/version-info/CMakeLists.txt +++ b/tools/version-info/CMakeLists.txt @@ -48,10 +48,12 @@ asap_add_executable(${MODULE_TARGET_NAME} WARNING SOURCES "src/main.cpp") target_compile_features(${MODULE_TARGET_NAME} PUBLIC cxx_constexpr) +target_compile_features(${MODULE_TARGET_NAME} PUBLIC cxx_constexpr) +cmake_path(SET version_include_dir ${CMAKE_CURRENT_BINARY_DIR}/../../include + NORMALIZE) target_include_directories( ${MODULE_TARGET_NAME} - PUBLIC $ - $ + PUBLIC $ $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) # ------------------------------------------------------------------------------ From c6d5e342e7a74236bb1b006be1e0d6bfe956a51a Mon Sep 17 00:00:00 2001 From: Abdessattar Sassi <457645+abdes@users.noreply.github.com> Date: Mon, 19 Sep 2022 20:33:55 +0400 Subject: [PATCH 2/2] fix: contract mode definition should only be added when not testing asap_contract --- cmake/CompileDefinitions.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/CompileDefinitions.cmake b/cmake/CompileDefinitions.cmake index 7facfc4..8f35cfd 100644 --- a/cmake/CompileDefinitions.cmake +++ b/cmake/CompileDefinitions.cmake @@ -11,7 +11,7 @@ include_guard(GLOBAL) # ------------------------------------------------------------------------------ function(asap_set_compile_definitions target) - set(argOption) + set(argOption "NO_CONTRACT") set(argSingle "") set(argMulti "ADD" "REMOVE") @@ -53,7 +53,9 @@ function(asap_set_compile_definitions target) # If linking against asap_contract, set the contract mode based on the build # type. Use generator expressions only, do not check for CMAKE_BUILD_TYPE # which is not friendly with multi-config generators. - if(TARGET asap_contract) + # + # Do not add this definition if we are testing asap-_contract + if(TARGET asap_contract AND NOT ASAP_CONTRACT_TESTING) if(NOT DEFINED OPTION_CONTRACT_MODE) target_compile_definitions( ${target}