summaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2020-01-24 14:09:44 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2020-01-24 17:27:22 -0800
commit242e277a661ec7e51f34dcaf86c1925d550b1498 (patch)
tree24be0e6074bc31673bc5122a42871173743504b8 /src/CMakeLists.txt
parent14622a194c2f640fb6b6e8edbfe9ec5bf9aecfd1 (diff)
build: substitute the path into the generate files
This resorts to the variable substitution to ensure the path embedded is correct. Without this, the path at the time of the configuration. In the case of the Swift project, this ended up searching in the *source* directory rather than the *build* directory. This will ensure that we export the file to an absolute location and we use the same location in the `cmarkConfig.cmake` file by means of CMake's `configure_file` subsitution.
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 2db94c4..48ddd01 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -141,9 +141,10 @@ if(CMARK_SHARED OR CMARK_STATIC)
install(EXPORT cmark DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
+ set(CMARK_TARGETS_FILE ${CMAKE_CURRENT_BINARY_DIR}/cmarkTargets.cmake)
configure_file(cmarkConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/cmarkConfig.cmake)
- export(TARGETS ${CMARK_INSTALL} FILE cmarkTargets.cmake)
+ export(TARGETS ${CMARK_INSTALL} FILE ${CMARK_TARGETS_FILE})
endif()
# Feature tests