Skip to content

Commit de40090

Browse files
committed
build: fix issue with the -DIdefix_PROBLEM_DIR default value
1 parent 4af7e8a commit de40090

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ option(Idefix_DEBUG "Enable Idefix debug features (makes the code very slow)" OF
1616
option(Idefix_RUNTIME_CHECKS "Enable runtime sanity checks" OFF)
1717
option(Idefix_WERROR "Treat compiler warnings as errors" OFF)
1818
option(Idefix_PYTHON "Enable python bindings (requires pybind11)" OFF)
19-
Option(Idefix_PROBLEM_DIR "Define the directory of the case to build for." ${PROJECT_BINARY_DIR})
19+
set(Idefix_PROBLEM_DIR "${CMAKE_BINARY_DIR}" CACHE STRING "Define the directory of the case to build for.")
2020
set(Idefix_CXX_FLAGS "" CACHE STRING "Additional compiler/linker flag")
2121
set(Idefix_DEFS "definitions.hpp" CACHE FILEPATH "Problem definition header file")
2222
option(Idefix_CUSTOM_EOS "Use custom equation of state" OFF)
@@ -76,7 +76,7 @@ add_executable(idefix)
7676
add_subdirectory(src build)
7777

7878
# make absolute
79-
get_filename_component(Idefix_PROBLEM_DIR_ABS "${Idefix_PROBLEM_DIR}" REALPATH BASE_DIR "${PROJECT_BINARY_DIR}")
79+
file(REAL_PATH ${Idefix_PROBLEM_DIR} Idefix_PROBLEM_DIR_ABS BASE_DIRECTORY ${PROJECT_BINARY_DIR})
8080

8181
if(EXISTS ${Idefix_PROBLEM_DIR_ABS}/setup.cpp)
8282
target_sources(idefix PUBLIC ${Idefix_PROBLEM_DIR_ABS}/setup.cpp)

0 commit comments

Comments
 (0)