|
1 | | -# This program is a part of EASIFEM library |
2 | | -# Copyright (C) 2020-2021 Vikas Sharma, Ph.D |
| 1 | +# This program is a part of EASIFEM library Copyright (C) 2020-2021 Vikas |
| 2 | +# Sharma, Ph.D |
3 | 3 | # |
4 | | -# This program is free software: you can redistribute it and/or modify |
5 | | -# it under the terms of the GNU General Public License as published by |
6 | | -# the Free Software Foundation, either version 3 of the License, or |
7 | | -# (at your option) any later version. |
| 4 | +# This program is free software: you can redistribute it and/or modify it under |
| 5 | +# the terms of the GNU General Public License as published by the Free Software |
| 6 | +# Foundation, either version 3 of the License, or (at your option) any later |
| 7 | +# version. |
8 | 8 | # |
9 | | -# This program is distributed in the hope that it will be useful, |
10 | | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | | -# GNU General Public License for more details. |
| 9 | +# This program is distributed in the hope that it will be useful, but WITHOUT |
| 10 | +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 11 | +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
| 12 | +# details. |
13 | 13 | # |
14 | | -# You should have received a copy of the GNU General Public License |
15 | | -# along with this program. If not, see <https: //www.gnu.org/licenses/> |
| 14 | +# You should have received a copy of the GNU General Public License along with |
| 15 | +# this program. If not, see <https: //www.gnu.org/licenses/> |
16 | 16 | # |
17 | | -#COMPILE DEF |
| 17 | +# COMPILE DEF |
18 | 18 | # |
19 | | -#Single precision or double precision |
20 | | -OPTION(USE_Real32 OFF) |
21 | | -OPTION(USE_Real64 OFF) |
22 | | -IF(USE_Real32) |
23 | | - LIST( APPEND TARGET_COMPILE_DEF "-DUSE_Real32" ) |
24 | | -ELSEIF(USE_Real64) |
25 | | - LIST( APPEND TARGET_COMPILE_DEF "-DUSE_Real64" ) |
26 | | -ELSE() |
27 | | - LIST( APPEND TARGET_COMPILE_DEF "-DUSE_Real64" ) |
28 | | -ENDIF() |
29 | | -OPTION(USE_Int32 OFF) |
30 | | -OPTION(USE_Int64 OFF) |
31 | | -IF(USE_Int32) |
32 | | - LIST( APPEND TARGET_COMPILE_DEF "-DUSE_Int32" ) |
33 | | -ELSEIF(USE_Real64) |
34 | | - LIST( APPEND TARGET_COMPILE_DEF "-DUSE_Int64" ) |
35 | | -ELSE() |
36 | | - LIST( APPEND TARGET_COMPILE_DEF "-DUSE_Int32" ) |
37 | | -ENDIF() |
38 | | -LIST( APPEND TARGET_COMPILE_DEF "-D${CMAKE_HOST_SYSTEM_NAME}_SYSTEM" ) |
| 19 | +# Single precision or double precision |
| 20 | +option(USE_Real32 OFF) |
| 21 | +option(USE_Real64 OFF) |
| 22 | +if(USE_Real32) |
| 23 | + list(APPEND TARGET_COMPILE_DEF "-DUSE_Real32") |
| 24 | +elseif(USE_Real64) |
| 25 | + list(APPEND TARGET_COMPILE_DEF "-DUSE_Real64") |
| 26 | +else() |
| 27 | + list(APPEND TARGET_COMPILE_DEF "-DUSE_Real64") |
| 28 | +endif() |
| 29 | +option(USE_Int32 OFF) |
| 30 | +option(USE_Int64 OFF) |
| 31 | +if(USE_Int32) |
| 32 | + list(APPEND TARGET_COMPILE_DEF "-DUSE_Int32") |
| 33 | +elseif(USE_Real64) |
| 34 | + list(APPEND TARGET_COMPILE_DEF "-DUSE_Int64") |
| 35 | +else() |
| 36 | + list(APPEND TARGET_COMPILE_DEF "-DUSE_Int32") |
| 37 | +endif() |
| 38 | +list(APPEND TARGET_COMPILE_DEF "-D${CMAKE_HOST_SYSTEM_NAME}_SYSTEM") |
39 | 39 |
|
40 | | -#DEFINE DEBUG |
41 | | -IF (${CMAKE_BUILD_TYPE} STREQUAL "Debug") |
42 | | - LIST( APPEND TARGET_COMPILE_DEF "-DDEBUG_VER" ) |
43 | | -ENDIF() |
| 40 | +# DEFINE DEBUG |
| 41 | +if(${CMAKE_BUILD_TYPE} STREQUAL "Debug") |
| 42 | + list(APPEND TARGET_COMPILE_DEF "-DDEBUG_VER") |
| 43 | +endif() |
44 | 44 |
|
45 | | -#ADD TO PROJECT |
46 | | -TARGET_COMPILE_DEFINITIONS( ${PROJECT_NAME} PUBLIC ${TARGET_COMPILE_DEF} ) |
47 | | -MESSAGE( STATUS "COMPILE DEFINITIONS USED ARE ${TARGET_COMPILE_DEF}") |
| 45 | +# ADD TO PROJECT |
| 46 | +target_compile_definitions(${PROJECT_NAME} PUBLIC ${TARGET_COMPILE_DEF}) |
| 47 | +message(STATUS "COMPILE DEFINITIONS USED ARE ${TARGET_COMPILE_DEF}") |
0 commit comments