Skip to content

Commit 39c76eb

Browse files
authored
Use CMAKE_CURRENT_*_DIR when finding gcem (#1752)
`FindGCEM.cmake` searches in `CMAKE_SOURCE_DIR`, which will fail if fluidsynth is not the top-level cmake project. This results in gcem being downloaded from github even when the submodule is updated. Search `CMAKE_CURRENT_SOURCE_DIR` instead (and store the result in `CMAKE_CURRENT_BINARYDIR`)
1 parent 28951f6 commit 39c76eb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cmake_admin/FindGCEM.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ This will define the following variables:
2323
#]=======================================================================]
2424

2525
# Find the headers and library
26-
find_path(GCEM_INCLUDE_DIR NAMES "gcem.hpp" PATHS "${CMAKE_SOURCE_DIR}/gcem/include")
26+
find_path(GCEM_INCLUDE_DIR NAMES "gcem.hpp" PATHS "${CMAKE_CURRENT_SOURCE_DIR}/gcem/include")
2727

2828
include(FindPackageHandleStandardArgs)
2929

@@ -40,8 +40,8 @@ if(NOT GCEM_INCLUDE_DIR)
4040
)
4141
else()
4242
message("The 'gcem' submodule directory seems to be empty or incomplete. Attempting to download gcem from Github.")
43-
set(GCEM_ZIP_FILE "${CMAKE_BINARY_DIR}/gcem.zip")
44-
set(GCEM_EXTRACT_DIR "${CMAKE_BINARY_DIR}/gcem-extracted")
43+
set(GCEM_ZIP_FILE "${CMAKE_CURRENT_BINARY_DIR}/gcem.zip")
44+
set(GCEM_EXTRACT_DIR "${CMAKE_CURRENT_BINARY_DIR}/gcem-extracted")
4545

4646
file(DOWNLOAD "${GCEM_ZIP_URL}" "${GCEM_ZIP_FILE}"
4747
SHOW_PROGRESS

0 commit comments

Comments
 (0)