Skip to content

Commit fcfc9e7

Browse files
committed
CMake: libSplash 1.7.0+
Update CMake scripts to require libSplash 1.7.0+
1 parent 676c619 commit fcfc9e7

File tree

4 files changed

+21
-256
lines changed

4 files changed

+21
-256
lines changed

include/picongpu/CMakeLists.txt

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -279,17 +279,16 @@ endif()
279279
# libSplash (+ hdf5 due to required headers)
280280
################################################################################
281281

282-
# find libSplash installation
283-
# prefer static libraries over shared ones (but do not force them)
284-
set(Splash_USE_STATIC_LIBS ON)
285-
find_package(Splash 1.6.0 COMPONENTS PARALLEL)
282+
find_package(Splash 1.7.0 CONFIG COMPONENTS PARALLEL)
286283

287-
if(Splash_FOUND)
288-
include_directories(SYSTEM ${Splash_INCLUDE_DIRS})
289-
list(APPEND Splash_DEFINITIONS "-DENABLE_HDF5=1")
290-
add_definitions(${Splash_DEFINITIONS})
291-
set(LIBS ${LIBS} ${Splash_LIBRARIES})
292-
endif(Splash_FOUND)
284+
if(TARGET Splash::Splash)
285+
add_definitions(-DENABLE_HDF5=1)
286+
set(LIBS ${LIBS} Splash::Splash)
287+
message(STATUS "Found Splash: ${Splash_DIR}")
288+
else()
289+
message(STATUS "Could NOT find Splash - "
290+
"set Splash_DIR or check your CMAKE_PREFIX_PATH")
291+
endif()
293292

294293

295294
################################################################################
@@ -302,6 +301,10 @@ find_package(PNGwriter 0.7.0 CONFIG)
302301
if(PNGwriter_FOUND)
303302
set(LIBS ${LIBS} PNGwriter::PNGwriter)
304303
add_definitions(-DPIC_ENABLE_PNG=1)
304+
message(STATUS "Found PNGwriter: ${PNGwriter_DIR}")
305+
else()
306+
message(STATUS "Could NOT find PNGwriter - "
307+
"set PNGwriter_DIR or check your CMAKE_PREFIX_PATH")
305308
endif(PNGwriter_FOUND)
306309

307310

src/tools/png2gas/CMakeLists.txt

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,10 @@ endif()
9696
################################################################################
9797

9898
# find libSplash installation
99-
# prefer static libraries over shared ones (but do not force them)
100-
set(Splash_USE_STATIC_LIBS ON)
101-
find_package(Splash 1.6.0 REQUIRED COMPONENTS PARALLEL)
99+
find_package(Splash 1.7.0 REQUIRED CONFIG COMPONENTS PARALLEL)
102100

103-
if(Splash_FOUND)
104-
include_directories(SYSTEM ${Splash_INCLUDE_DIRS})
105-
list(APPEND Splash_DEFINITIONS "-DENABLE_HDF5=1")
106-
add_definitions(${Splash_DEFINITIONS})
107-
set(LIBS ${LIBS} ${Splash_LIBRARIES})
108-
endif(Splash_FOUND)
101+
add_definitions(-DENABLE_HDF5=1)
102+
message(STATUS "Found Splash: ${Splash_DIR}")
109103

110104

111105
################################################################################
@@ -115,9 +109,7 @@ endif(Splash_FOUND)
115109
# find PNGwriter installation
116110
find_package(PNGwriter 0.7.0 REQUIRED CONFIG)
117111

118-
if(PNGwriter_FOUND)
119-
set(LIBS ${LIBS} PNGwriter::PNGwriter)
120-
endif(PNGwriter_FOUND)
112+
set(LIBS ${LIBS} PNGwriter::PNGwriter)
121113

122114

123115
################################################################################

src/tools/splash2txt/CMakeLists.txt

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#
21
# Copyright 2013-2018 Felix Schmitt, Axel Huebl, Rene Widera
32
#
43
# This file is part of splash2txt.
@@ -100,17 +99,10 @@ endif(MPI_CXX_FOUND)
10099
################################################################################
101100

102101
# find libSplash installation
103-
# prefer static libraries over shared ones (but do not force them)
104-
set(Splash_USE_STATIC_LIBS ON)
105-
find_package(Splash 1.6.0 REQUIRED COMPONENTS PARALLEL)
102+
find_package(Splash 1.7.0 REQUIRED CONFIG COMPONENTS PARALLEL)
106103

107-
if(Splash_FOUND)
108-
include_directories(SYSTEM ${Splash_INCLUDE_DIRS})
109-
list(APPEND Splash_DEFINITIONS "-DENABLE_HDF5=1")
110-
add_definitions(${Splash_DEFINITIONS})
111-
message(STATUS "libSplash compiler definitions: ${Splash_DEFINITIONS}")
112-
set(LIBS ${LIBS} ${Splash_LIBRARIES})
113-
endif(Splash_FOUND)
104+
add_definitions(-DENABLE_HDF5=1)
105+
message(STATUS "Found Splash: ${Splash_DIR}")
114106

115107

116108
################################################################################
@@ -148,9 +140,7 @@ endif()
148140

149141
set(SRCFILES "splash2txt.cpp")
150142

151-
if(Splash_FOUND)
152-
list(APPEND SRCFILES "tools_splash_parallel.cpp")
153-
endif(Splash_FOUND)
143+
list(APPEND SRCFILES "tools_splash_parallel.cpp")
154144
if(ADIOS_FOUND)
155145
list(APPEND SRCFILES "tools_adios_parallel.cpp")
156146
endif(ADIOS_FOUND)

thirdParty/cmake-modules/FindSplash.cmake

Lines changed: 0 additions & 220 deletions
This file was deleted.

0 commit comments

Comments
 (0)