cmake: some more include_directories() -> target_include_directories()

This commit is contained in:
Christoph Junghans 2020-03-24 11:36:21 -06:00
parent 4736402dd9
commit 33a57ed215
15 changed files with 15 additions and 16 deletions

View File

@ -17,7 +17,7 @@ endif()
ExternalProject_get_property(mpi4win_build SOURCE_DIR)
target_compile_definitions(lammps PRIVATE -DMPICH_SKIP_MPICXX)
include_directories("${SOURCE_DIR}/include")
target_include_directories(lammps PRIVATE "${SOURCE_DIR}/include")
set(MPI4WIN_LIBRARIES "${SOURCE_DIR}/lib/libmpi.a")
add_dependencies(lammps mpi4win_build)
set(LAMMPS_USE_MPI4WIN ON)

View File

@ -9,5 +9,5 @@ if(PKG_CORESHELL)
get_property(CORESHELL_SOURCES GLOBAL PROPERTY CORESHELL_SOURCES)
target_sources(lammps PRIVATE ${CORESHELL_SOURCES})
include_directories(${CORESHELL_SOURCES_DIR})
target_include_directories(lammps PRIVATE ${CORESHELL_SOURCES_DIR})
endif()

View File

@ -193,5 +193,5 @@ if(PKG_GPU)
get_property(GPU_SOURCES GLOBAL PROPERTY GPU_SOURCES)
target_sources(lammps PRIVATE ${GPU_SOURCES})
include_directories(${GPU_SOURCES_DIR})
target_include_directories(lammps PRIVATE ${GPU_SOURCES_DIR})
endif()

View File

@ -62,5 +62,5 @@ if(PKG_KIM)
find_package(KIM-API ${KIM-API_MIN_VERSION} REQUIRED)
endif()
target_link_libraries(lammps PRIVATE "${KIM-API_LDFLAGS}")
include_directories(${KIM-API_INCLUDE_DIRS})
target_include_directories(lammps PRIVATE ${KIM-API_INCLUDE_DIRS})
endif()

View File

@ -15,7 +15,7 @@ if(PKG_KOKKOS)
${LAMMPS_LIB_KOKKOS_SRC_DIR}/containers/src
${LAMMPS_LIB_KOKKOS_SRC_DIR}/algorithms/src
${LAMMPS_LIB_KOKKOS_BIN_DIR})
include_directories(${Kokkos_INCLUDE_DIRS})
target_include_directories(lammps PRIVATE ${Kokkos_INCLUDE_DIRS})
target_link_libraries(lammps PRIVATE kokkos)
endif()
target_compile_definitions(lammps PRIVATE -DLMP_KOKKOS)
@ -70,5 +70,5 @@ if(PKG_KOKKOS)
get_property(KOKKOS_PKG_SOURCES GLOBAL PROPERTY KOKKOS_PKG_SOURCES)
target_sources(lammps PRIVATE ${KOKKOS_PKG_SOURCES})
include_directories(${KOKKOS_PKG_SOURCES_DIR})
target_include_directories(lammps PRIVATE ${KOKKOS_PKG_SOURCES_DIR})
endif()

View File

@ -41,7 +41,7 @@ if(PKG_KSPACE)
if(FFT_MKL_THREADS)
target_compile_definitions(lammps PRIVATE -DFFT_MKL_THREADS)
endif()
include_directories(${MKL_INCLUDE_DIRS})
target_include_directories(lammps PRIVATE ${MKL_INCLUDE_DIRS})
target_link_libraries(lammps PRIVATE ${MKL_LIBRARIES})
else()
# last option is KISSFFT

View File

@ -28,5 +28,5 @@ if(PKG_MESSAGE)
endif()
target_link_libraries(lammps PRIVATE cslib)
include_directories(${LAMMPS_LIB_SOURCE_DIR}/message/cslib/src)
target_include_directories(lammps PRIVATE ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/src)
endif()

View File

@ -9,5 +9,5 @@ if(PKG_OPT)
get_property(OPT_SOURCES GLOBAL PROPERTY OPT_SOURCES)
target_sources(lammps PRIVATE ${OPT_SOURCES})
include_directories(${OPT_SOURCES_DIR})
target_include_directories(lammps PRIVATE ${OPT_SOURCES_DIR})
endif()

View File

@ -1,6 +1,6 @@
if(PKG_PYTHON)
find_package(PythonLibs REQUIRED)
target_compile_definitions(lammps PRIVATE -DLMP_PYTHON)
include_directories(${PYTHON_INCLUDE_DIR})
target_include_directories(lammps PRIVATE ${PYTHON_INCLUDE_DIR})
target_link_libraries(lammps PRIVATE ${PYTHON_LIBRARY})
endif()

View File

@ -16,5 +16,5 @@ if(PKG_QEQ)
get_property(QEQ_SOURCES GLOBAL PROPERTY QEQ_SOURCES)
target_sources(lammps PRIVATE ${QEQ_SOURCES})
include_directories(${QEQ_SOURCES_DIR})
target_include_directories(lammps PRIVATE ${QEQ_SOURCES_DIR})
endif()

View File

@ -4,5 +4,4 @@ if(PKG_USER-H5MD)
find_package(HDF5 REQUIRED)
target_link_libraries(h5md PRIVATE ${HDF5_LIBRARIES})
target_include_directories(h5md PRIVATE ${HDF5_INCLUDE_DIRS})
include_directories(${HDF5_INCLUDE_DIRS})
endif()

View File

@ -109,5 +109,5 @@ if(PKG_USER-INTEL)
endif()
target_sources(lammps PRIVATE ${USER-INTEL_SOURCES})
include_directories(${USER-INTEL_SOURCES_DIR})
target_include_directories(lammps PRIVATE ${USER-INTEL_SOURCES_DIR})
endif()

View File

@ -38,5 +38,5 @@ if(PKG_USER-OMP)
endif()
target_sources(lammps PRIVATE ${USER-OMP_SOURCES})
include_directories(${USER-OMP_SOURCES_DIR})
target_include_directories(lammps PRIVATE ${USER-OMP_SOURCES_DIR})
endif()

View File

@ -92,5 +92,5 @@ if(PKG_USER-PLUMED)
endif()
target_link_libraries(lammps PRIVATE ${PLUMED_LOAD})
endif()
include_directories(${PLUMED_INCLUDE_DIRS})
target_include_directories(lammps PRIVATE ${PLUMED_INCLUDE_DIRS})
endif()

View File

@ -11,5 +11,5 @@ if(PKG_USER-SDPD)
endif()
set_property(GLOBAL PROPERTY FIX "${hlist}")
include_directories(${USER-SDPD_SOURCES_DIR})
target_include_directories(lammps PRIVATE ${USER-SDPD_SOURCES_DIR})
endif()