summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2022-08-24 09:26:04 +0300
committerIvan Maidanski <ivmai@mail.ru>2022-08-24 14:07:20 +0300
commit7f13372f7a269b80a739347dcb9836f6c9166d4e (patch)
treec39e1eab9ec95604e7760d38b6a4c25e670a55f5
parent7ede906e1c93253ebf7fb724fe749ae6cda2ca5c (diff)
downloadlibatomic_ops-7f13372f7a269b80a739347dcb9836f6c9166d4e.tar.gz
Do not use include_directories(src) in CMakeLists.txt
(refactoring) * CMakeLists.txt (src): Remove include_directories specification. * CMakeLists.txt (atomic_ops): Specify path to "src" as public. * CMakeLists.txt [enable_gpl] (atomic_ops_gpl): Likewise.
-rw-r--r--CMakeLists.txt14
1 files changed, 6 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 773413c..27c6500 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -88,8 +88,6 @@ else()
add_compile_options(-Wall -Wextra)
endif()
-include_directories(src)
-
find_package(Threads REQUIRED)
message(STATUS "Thread library: ${CMAKE_THREAD_LIBS_INIT}")
include_directories(${Threads_INCLUDE_DIR})
@@ -144,9 +142,9 @@ endif()
add_library(atomic_ops ${SRC})
target_link_libraries(atomic_ops PRIVATE ${THREADDLLIBS_LIST})
-target_include_directories(atomic_ops INTERFACE
- "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>"
- "$<INSTALL_INTERFACE:include>")
+target_include_directories(atomic_ops
+ PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>"
+ INTERFACE "$<INSTALL_INTERFACE:include>")
if (enable_gpl)
set(AO_GPL_SRC src/atomic_ops_malloc.c src/atomic_ops_stack.c)
@@ -156,9 +154,9 @@ if (enable_gpl)
target_compile_definitions(atomic_ops_gpl PRIVATE HAVE_MMAP)
endif()
target_link_libraries(atomic_ops_gpl PRIVATE atomic_ops)
- target_include_directories(atomic_ops_gpl INTERFACE
- "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>"
- "$<INSTALL_INTERFACE:include>")
+ target_include_directories(atomic_ops_gpl
+ PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>"
+ INTERFACE "$<INSTALL_INTERFACE:include>")
if (BUILD_SHARED_LIBS)
set_property(TARGET atomic_ops_gpl PROPERTY VERSION ${AO_GPL_VERSION_PROP})
set_property(TARGET atomic_ops_gpl PROPERTY SOVERSION ${AO_GPL_SOVERSION})