Skip to content

Commit ac7454a

Browse files
Third Partyax3l
authored andcommitted
Squashed 'thirdParty/cmake-modules/' changes from a47312b..af5d9d4
af5d9d4 Merge pull request #7 from ComputationalRadiationPhysics/fix-mallocMCListExistence 464cf50 Fix: Undefined List for FindmallocMC 96d3dbd Merge pull request #6 from slizzered/hotfix-regression_from_list_with_spaces 0ec533e changed list creation to reference syntax 4c1a34f Required arguments checked exactly when required 0ad59c9 Hotfix for regression bug from prev commit 01c5d7b Merge pull request #5 from slizzered/issue3-mallocMC-module eddc3ec Added documentation about MALLOCMC_ROOT variable 6a7ca13 Also use CMake variable MALLOCMC_ROOT 4cd27c9 removed hardcoded path 2cbaa5f Restructure module FindmallocMC.cmake 232cad5 Merge pull request #1 from ComputationalRadiationPhysics/topic-changToISC 779e84e Propose License Change to ISC git-subtree-dir: thirdParty/cmake-modules git-subtree-split: af5d9d47c539a8dac53c1e7240465384f86d7081
1 parent 28700fb commit ac7454a

File tree

5 files changed

+146
-120
lines changed

5 files changed

+146
-120
lines changed

FindADIOS.cmake

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,19 @@
3838

3939

4040
################################################################################
41-
# Copyright 2014 Axel Huebl, Felix Schmitt
41+
# Copyright 2014-2015 Axel Huebl, Felix Schmitt
4242
#
43-
# This file is part of PIConGPU.
43+
# Permission to use, copy, modify, and/or distribute this software for any
44+
# purpose with or without fee is hereby granted, provided that the above
45+
# copyright notice and this permission notice appear in all copies.
4446
#
45-
# PIConGPU is free software: you can redistribute it and/or modify
46-
# it under the terms of the GNU General Public License as published by
47-
# the Free Software Foundation, either version 3 of the License, or
48-
# (at your option) any later version.
49-
#
50-
# PIConGPU is distributed in the hope that it will be useful,
51-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
52-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
53-
# GNU General Public License for more details.
54-
#
55-
# You should have received a copy of the GNU General Public License
56-
# along with PIConGPU.
57-
# If not, see <http://www.gnu.org/licenses/>.
47+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
48+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
49+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
50+
# SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
51+
# RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
52+
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
53+
# USE OR PERFORMANCE OF THIS SOFTWARE.
5854
################################################################################
5955

6056

FindPNGwriter.cmake

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,19 @@
3535

3636

3737
###############################################################################
38-
# Copyright 2014 Axel Huebl
38+
# Copyright 2014-2015 Axel Huebl
3939
#
40-
# This file is part of PIConGPU.
40+
# Permission to use, copy, modify, and/or distribute this software for any
41+
# purpose with or without fee is hereby granted, provided that the above
42+
# copyright notice and this permission notice appear in all copies.
4143
#
42-
# PIConGPU is free software: you can redistribute it and/or modify
43-
# it under the terms of the GNU General Public License as published by
44-
# the Free Software Foundation, either version 3 of the License, or
45-
# (at your option) any later version.
46-
#
47-
# PIConGPU is distributed in the hope that it will be useful,
48-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
49-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
50-
# GNU General Public License for more details.
51-
#
52-
# You should have received a copy of the GNU General Public License
53-
# along with PIConGPU.
54-
# If not, see <http://www.gnu.org/licenses/>.
44+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
45+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
46+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
47+
# SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
48+
# RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
49+
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
50+
# USE OR PERFORMANCE OF THIS SOFTWARE.
5551
###############################################################################
5652

5753

FindSplash.cmake

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,19 @@
3737

3838

3939
###############################################################################
40-
# Copyright 2014 Axel Huebl, Felix Schmitt, Rene Widera
40+
# Copyright 2014-2015 Axel Huebl, Felix Schmitt, Rene Widera
4141
#
42-
# This file is part of PIConGPU.
42+
# Permission to use, copy, modify, and/or distribute this software for any
43+
# purpose with or without fee is hereby granted, provided that the above
44+
# copyright notice and this permission notice appear in all copies.
4345
#
44-
# PIConGPU is free software: you can redistribute it and/or modify
45-
# it under the terms of the GNU General Public License as published by
46-
# the Free Software Foundation, either version 3 of the License, or
47-
# (at your option) any later version.
48-
#
49-
# PIConGPU is distributed in the hope that it will be useful,
50-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
51-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
52-
# GNU General Public License for more details.
53-
#
54-
# You should have received a copy of the GNU General Public License
55-
# along with PIConGPU.
56-
# If not, see <http://www.gnu.org/licenses/>.
46+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
47+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
48+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
49+
# SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
50+
# RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
51+
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
52+
# USE OR PERFORMANCE OF THIS SOFTWARE.
5753
###############################################################################
5854

5955

FindmallocMC.cmake

Lines changed: 99 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -11,128 +11,152 @@
1111
# )
1212
#
1313
# To provide a hint to this module where to find the mallocMC installation,
14-
# set the MALLOCMC_ROOT environment variable.
14+
# set the MALLOCMC_ROOT environment variable. You can also set the
15+
# MALLOCMC_ROOT CMake variable, which will take precedence over the environment
16+
# variable.
1517
#
1618
# This module requires CUDA and Boost. When calling it, make sure to call
1719
# find_package(CUDA) and find_package(Boost) first.
1820
#
1921
# This module will define the following variables:
2022
# mallocMC_INCLUDE_DIRS - Include directories for the mallocMC headers.
21-
# mallocMC_FOUND - TRUE if FindMallocMC found a working install
23+
# mallocMC_FOUND - TRUE if FindmallocMC found a working install
2224
# mallocMC_VERSION - Version in format Major.Minor.Patch
2325
#
26+
# The following variables are optional and only defined if the selected
27+
# components require them:
28+
# mallocMC_LIBRARIES - mallocMC libraries for dynamic linking using
29+
# target_link_libraries(${mallocMC_LIBRARIES})
30+
# mallocMC_DEFINITIONS - Compiler definitions you should add with
31+
# add_definitions(${mallocMC_DEFINITIONS})
32+
#
2433

2534

2635
###############################################################################
27-
# Copyright 2014 Axel Huebl, Felix Schmitt, Rene Widera, Carlchristian Eckert
28-
#
29-
# This file is part of PIConGPU.
36+
# Copyright 2014-2015 Axel Huebl, Felix Schmitt, Rene Widera,
37+
# Carlchristian Eckert
3038
#
31-
# PIConGPU is free software: you can redistribute it and/or modify
32-
# it under the terms of the GNU General Public License as published by
33-
# the Free Software Foundation, either version 3 of the License, or
34-
# (at your option) any later version.
39+
# Permission to use, copy, modify, and/or distribute this software for any
40+
# purpose with or without fee is hereby granted, provided that the above
41+
# copyright notice and this permission notice appear in all copies.
3542
#
36-
# PIConGPU is distributed in the hope that it will be useful,
37-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
38-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
39-
# GNU General Public License for more details.
40-
#
41-
# You should have received a copy of the GNU General Public License
42-
# along with PIConGPU.
43-
# If not, see <http://www.gnu.org/licenses/>.
43+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
44+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
45+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
46+
# SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
47+
# RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
48+
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
49+
# USE OR PERFORMANCE OF THIS SOFTWARE.
4450
###############################################################################
4551

4652

47-
###############################################################################
48-
# Required cmake version
49-
###############################################################################
50-
53+
# Required cmake version ######################################################
54+
#
5155
cmake_minimum_required(VERSION 2.8.5)
5256

5357

54-
###############################################################################
55-
# mallocMC
56-
###############################################################################
57-
58-
# we start by assuming we found mallocMC and falsify it if some
59-
# dependencies are missing (or if we did not find mallocMC at all)
58+
# mallocMC ####################################################################
59+
#
6060
set(mallocMC_FOUND TRUE)
6161

6262

63-
###############################################################################
64-
# preconditions
65-
###############################################################################
66-
67-
if(NOT CUDA_FOUND)
68-
set(mallocMC_FOUND FALSE)
69-
message(STATUS "could not find CUDA, try something like find_package(CUDA REQUIRED)")
70-
elseif(CUDA_VERSION VERSION_LESS "5.0")
71-
set(mallocMC_FOUND FALSE)
72-
message(STATUS "CUDA found, but version too low (needs 5.0 or higher)")
73-
endif(NOT CUDA_FOUND)
74-
75-
if(NOT Boost_FOUND)
76-
set(mallocMC_FOUND FALSE)
77-
message(STATUS "could not find Boost, try something like find_package(Boost REQUIRED)")
78-
elseif(Boost_VERSION LESS 104800)
79-
set(mallocMC_FOUND FALSE)
80-
message(STATUS "Boost found, but version too low (needs 1.48 or higher)")
81-
endif(NOT Boost_FOUND)
63+
# dependencies ################################################################
64+
#
65+
find_package(CUDA 5.0 REQUIRED)
66+
find_package(Boost 1.48.0 REQUIRED)
8267

8368

84-
# find mallocMC installation #################################################
69+
# find mallocMC installation ##################################################
8570
#
8671
find_path(mallocMC_ROOT_DIR
87-
NAMES include/mallocMC/mallocMC.hpp
88-
PATHS ENV MALLOCMC_ROOT
89-
DOC "mallocMC ROOT location"
90-
)
72+
NAMES include/mallocMC/mallocMC.hpp
73+
PATHS ${MALLOCMC_ROOT} ENV MALLOCMC_ROOT
74+
PATH_SUFFIXES "src"
75+
DOC "mallocMC ROOT location"
76+
)
9177

78+
set(mallocMC_REQUIRED_VARS_LIST mallocMC_ROOT_DIR mallocMC_INCLUDE_DIRS)
9279

9380
if(mallocMC_ROOT_DIR)
94-
# mallocMC headers ##########################################################
95-
#
96-
list(APPEND mallocMC_INCLUDE_DIRS ${mallocMC_ROOT_DIR}/include)
9781

98-
99-
# find version ############################################################
82+
# find version ##############################################################
10083
#
10184
file(STRINGS "${mallocMC_ROOT_DIR}/include/mallocMC/version.hpp"
102-
mallocMC_VERSION_MAJOR_HPP REGEX "#define MALLOCMC_VERSION_MAJOR ")
85+
mallocMC_VERSION_MAJOR_HPP REGEX "#define MALLOCMC_VERSION_MAJOR ")
10386
file(STRINGS "${mallocMC_ROOT_DIR}/include/mallocMC/version.hpp"
104-
mallocMC_VERSION_MINOR_HPP REGEX "#define MALLOCMC_VERSION_MINOR ")
87+
mallocMC_VERSION_MINOR_HPP REGEX "#define MALLOCMC_VERSION_MINOR ")
10588
file(STRINGS "${mallocMC_ROOT_DIR}/include/mallocMC/version.hpp"
106-
mallocMC_VERSION_PATCH_HPP REGEX "#define MALLOCMC_VERSION_PATCH ")
89+
mallocMC_VERSION_PATCH_HPP REGEX "#define MALLOCMC_VERSION_PATCH ")
10790
string(REGEX MATCH "([0-9]+)" mallocMC_VERSION_MAJOR
10891
${mallocMC_VERSION_MAJOR_HPP})
10992
string(REGEX MATCH "([0-9]+)" mallocMC_VERSION_MINOR
11093
${mallocMC_VERSION_MINOR_HPP})
11194
string(REGEX MATCH "([0-9]+)" mallocMC_VERSION_PATCH
11295
${mallocMC_VERSION_PATCH_HPP})
11396

97+
# mallocMC variables ########################################################
98+
#
11499
set(mallocMC_VERSION "${mallocMC_VERSION_MAJOR}.${mallocMC_VERSION_MINOR}.${mallocMC_VERSION_PATCH}")
100+
set(mallocMC_INCLUDE_DIRS ${mallocMC_ROOT_DIR}/include)
101+
102+
# check additional components ###############################################
103+
#
104+
foreach(COMPONENT ${mallocMC_FIND_COMPONENTS})
105+
set(mallocMC_${COMPONENT}_FOUND TRUE)
106+
107+
if(${COMPONENT} STREQUAL "halloc")
108+
109+
# halloc linked library #################################################
110+
#
111+
list(APPEND mallocMC_REQUIRED_VARS_LIST mallocMC_LIBRARIES)
112+
find_library(${COMPONENT}_LIBRARY
113+
NAMES libhalloc.a
114+
PATHS "${mallocMC_ROOT_DIR}/../halloc/" ENV HALLOC_ROOT
115+
PATH_SUFFIXES "lib" "bin"
116+
)
117+
if(${COMPONENT}_LIBRARY)
118+
list(APPEND mallocMC_LIBRARIES ${${COMPONENT}_LIBRARY})
119+
else(${COMPONENT}_LIBRARY)
120+
if(mallocMC_FIND_REQUIRED OR NOT mallocMC_FIND_QUIETLY)
121+
message(WARNING "libhalloc.a not found. Ensure it is compiled correctly and set HALLOC_ROOT")
122+
endif()
123+
set(mallocMC_${COMPONENT}_FOUND FALSE)
124+
endif(${COMPONENT}_LIBRARY)
125+
126+
# halloc headers ########################################################
127+
#
128+
find_path(${COMPONENT}_INCLUDE_DIR
129+
NAMES halloc.h
130+
PATHS "${mallocMC_ROOT_DIR}/../halloc/" ENV HALLOC_ROOT
131+
PATH_SUFFIXES "include" "src"
132+
)
133+
if(${COMPONENT}_INCLUDE_DIR)
134+
list(APPEND mallocMC_INCLUDE_DIRS ${${COMPONENT}_INCLUDE_DIR})
135+
else(${COMPONENT}_INCLUDE_DIR)
136+
set(mallocMC_${COMPONENT}_FOUND FALSE)
137+
endif(${COMPONENT}_INCLUDE_DIR)
138+
139+
# set separable compilation #############################################
140+
#
141+
if(mallocMC_${COMPONENT}_FOUND)
142+
set(CUDA_SEPARABLE_COMPILATION ON PARENT_SCOPE)
143+
endif(mallocMC_${COMPONENT}_FOUND)
144+
145+
endif(${COMPONENT} STREQUAL "halloc")
146+
147+
endforeach(COMPONENT ${mallocMC_FIND_COMPONENTS})
115148

116-
else(mallocMC_ROOT_DIR)
117-
set(mallocMC_FOUND FALSE)
118-
message(STATUS "Can NOT find mallocMC - set MALLOCMC_ROOT")
119149
endif(mallocMC_ROOT_DIR)
120150

121151

122-
# unset checked variables if not found ########################################
152+
# handles the REQUIRED, QUIET and version-related arguments for find_package ##
123153
#
124-
if(NOT mallocMC_FOUND)
125-
unset(mallocMC_INCLUDE_DIRS)
126-
endif(NOT mallocMC_FOUND)
127-
128-
129-
###############################################################################
130-
# FindPackage Options
131-
###############################################################################
132-
133-
# handles the REQUIRED, QUIET and version-related arguments for find_package
154+
list(REMOVE_DUPLICATES mallocMC_REQUIRED_VARS_LIST)
134155
include(FindPackageHandleStandardArgs)
135156
find_package_handle_standard_args(mallocMC
136-
REQUIRED_VARS mallocMC_INCLUDE_DIRS
157+
FOUND_VAR mallocMC_FOUND
158+
REQUIRED_VARS ${mallocMC_REQUIRED_VARS_LIST}
137159
VERSION_VAR mallocMC_VERSION
138-
)
160+
HANDLE_COMPONENTS
161+
)
162+
unset(mallocMC_REQUIRED_VARS_LIST)

LICENSE

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Copyright (c) 2014-2015 Axel Huebl, Felix Schmitt, Rene Widera,
2+
Carlchristian Eckert
3+
4+
Permission to use, copy, modify, and/or distribute this software for any
5+
purpose with or without fee is hereby granted, provided that the above
6+
copyright notice and this permission notice appear in all copies.
7+
8+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11+
SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
12+
RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
13+
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
14+
USE OR PERFORMANCE OF THIS SOFTWARE.

0 commit comments

Comments
 (0)