Fix cmake files so client projects can link to the interface target.

This way they can link to vwr::vectorwrapper to have the
correct include path added.
This commit is contained in:
King_DuckZ 2020-04-07 23:53:19 +02:00
parent 0a90a289a2
commit 2e30692071
4 changed files with 4 additions and 4 deletions

View file

@ -22,8 +22,10 @@ write_basic_package_version_file(
) )
add_library(${PROJECT_NAME} INTERFACE) add_library(${PROJECT_NAME} INTERFACE)
add_library(vwr::vectorwrapper ALIAS vectorwrapper)
target_include_directories(${PROJECT_NAME} target_include_directories(${PROJECT_NAME}
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include> INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
) )
install(DIRECTORY include/vectorwrapper install(DIRECTORY include/vectorwrapper

View file

@ -21,9 +21,5 @@ add_definitions(
-Wconversion -Wconversion
) )
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../include
${CMAKE_CURRENT_BINARY_DIR}/../include
)
add_subdirectory(unit) add_subdirectory(unit)
add_subdirectory(unit_noconv) add_subdirectory(unit_noconv)

View file

@ -14,6 +14,7 @@ add_executable(${PROJECT_NAME}
target_link_libraries(${PROJECT_NAME} target_link_libraries(${PROJECT_NAME}
gtest gtest
vwr::vectorwrapper
) )
target_compile_definitions(${PROJECT_NAME} target_compile_definitions(${PROJECT_NAME}

View file

@ -12,6 +12,7 @@ add_executable(${PROJECT_NAME}
target_link_libraries(${PROJECT_NAME} target_link_libraries(${PROJECT_NAME}
gtest gtest
vwr::vectorwrapper
) )
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD_REQUIRED ON) set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD_REQUIRED ON)