CMakeLists.txt: Fix undefined behaviour on EXISTS
According to the documentation [1], EXISTS only has well-defined behaviour when an absolute path is given. This fixes a bug where re-configuring the project would fail because CMake would inadverently jump to the invalid branch. [1]: https://cmake.org/cmake/help/latest/command/if.html#exists
This commit is contained in:
parent
8d3ca718b5
commit
ae4f837d5a
1 changed files with 1 additions and 1 deletions
|
@ -41,7 +41,7 @@ if(SD_ASSUME_DATADIR)
|
|||
set(SD_DATADIR_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/games/speed-dreams-2)
|
||||
set(SD_DATADIR_ABS ${SD_DATADIR_INSTALL_PREFIX})
|
||||
message(STATUS "Data directory: ${SD_DATADIR_ABS} (assumed)")
|
||||
elseif(EXISTS speed-dreams-data/CMakeLists.txt)
|
||||
elseif(EXISTS ${CMAKE_CURRENT_LIST_DIR}/speed-dreams-data/CMakeLists.txt)
|
||||
add_subdirectory(speed-dreams-data)
|
||||
set(SD_DATADIR ${CMAKE_INSTALL_DATADIR}/games/speed-dreams-2)
|
||||
set(SD_DATADIR_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/games/speed-dreams-2)
|
||||
|
|
Loading…
Reference in a new issue