Skip to content

Commit 09d3b3f

Browse files
committed
Rename one CMake option
Avoids possible namespace collisions when using XCFun via FetchContent
1 parent 5f888d6 commit 09d3b3f

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ before_script:
113113
-DCMAKE_Fortran_COMPILER=${Fortran_COMPILER}
114114
-DCMAKE_BUILD_TYPE=${BUILD_TYPE}
115115
-DENABLE_CODE_COVERAGE=${COVERAGE}
116-
-DENABLE_PYTHON_INTERFACE=ON
116+
-DXCFun_ENABLE_PYTHON_INTERFACE=ON
117117
-DPYTHON_EXECUTABLE=$(which python)
118118
-DCMAKE_INSTALL_PREFIX=$HOME/Software/xcfun
119119
${PYBIND11}

cmake/custom/xcfun.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Variables modified::
66
#
77
# XCFun_XC_MAX_ORDER -- Maximum order of derivatives of the exchange-correlation kernel
8-
# ENABLE_PYTHON_INTERFACE -- Whether to enable the Python interface
8+
# XCFun_ENABLE_PYTHON_INTERFACE -- Whether to enable the Python interface
99
#
1010
# autocmake.yml configuration::
1111
#
@@ -14,7 +14,7 @@
1414
# - "--pybindings Enable Python interface [default: OFF]."
1515
# define:
1616
# - "'-DXCFun_XC_MAX_ORDER=\"{0}\"'.format(arguments['--xcmaxorder'])"
17-
# - "'-DENABLE_PYTHON_INTERFACE={0}'.format(arguments['--pybindings'])"
17+
# - "'-DXCFun_ENABLE_PYTHON_INTERFACE={0}'.format(arguments['--pybindings'])"
1818

1919
option_with_default(XCFun_XC_MAX_ORDER "Maximum order of derivatives of the exchange-correlation kernel" 3)
2020
# Make sure user selected a valuer larger than 2
@@ -41,7 +41,7 @@ else()
4141
endif()
4242
file(TO_NATIVE_PATH "lib/${PYMOD_INSTALL_LIBDIR}/xcfun" PYMOD_INSTALL_FULLDIR)
4343

44-
option_with_print(ENABLE_PYTHON_INTERFACE "Enable Python interface" OFF)
44+
option_with_print(XCFun_ENABLE_PYTHON_INTERFACE "Enable Python interface" OFF)
4545

4646
if(ENABLE_FC_SUPPORT)
4747
enable_language(Fortran)
@@ -55,7 +55,7 @@ endif()
5555
add_subdirectory(${PROJECT_SOURCE_DIR}/api)
5656
add_subdirectory(${PROJECT_SOURCE_DIR}/src)
5757

58-
if(ENABLE_PYTHON_INTERFACE)
58+
if(XCFun_ENABLE_PYTHON_INTERFACE)
5959
include(${PROJECT_SOURCE_DIR}/external/upstream/fetch_pybind11.cmake)
6060
add_subdirectory(python)
6161
endif()

setup

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def gen_cmake_command(options, arguments):
5353
command.append('-DENABLE_CODE_COVERAGE={0}'.format(arguments['--coverage']))
5454
command.append('-DSTATIC_LIBRARY_ONLY={0}'.format(arguments['--static']))
5555
command.append('-DXCFun_XC_MAX_ORDER="{0}"'.format(arguments['--xcmaxorder']))
56-
command.append('-DENABLE_PYTHON_INTERFACE={0}'.format(arguments['--pybindings']))
56+
command.append('-DXCFun_ENABLE_PYTHON_INTERFACE={0}'.format(arguments['--pybindings']))
5757
command.append('-DCMAKE_BUILD_TYPE={0}'.format(arguments['--type']))
5858
command.append('-G"{0}"'.format(arguments['--generator']))
5959
if arguments['--cmake-options'] != "''":

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ if(ENABLE_FC_SUPPORT)
3232
add_test(fortran_example ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/fortran_example)
3333
endif()
3434

35-
if(ENABLE_PYTHON_INTERFACE)
35+
if(XCFun_ENABLE_PYTHON_INTERFACE)
3636
list(APPEND _pytest_files
3737
${CMAKE_CURRENT_SOURCE_DIR}/test_xcfun.py
3838
)

0 commit comments

Comments
 (0)