From 1abeefb6ce8030d68f48a60123e2d3c66f5fba09 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 27 Jun 2017 22:01:36 -0700 Subject: [PATCH] build: create modulemap symlinks Use a darwin specific modulemap on darwin, and the generic one elsewhere. This fixes the cmake build to create the symlinks like the autotools build and cause the installation to be correct on Darwin as well as the build. --- CMakeLists.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ffb02507..ed5c139c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -188,6 +188,23 @@ if(leaks_EXECUTABLE) set(HAVE_LEAKS TRUE) endif() +if(CMAKE_SYSTEM_NAME STREQUAL Darwin) + add_custom_command(OUTPUT + "${CMAKE_SOURCE_DIR}/dispatch/module.modulemap" + "${CMAKE_SOURCE_DIR}/private/module.modulemap" + COMMAND + ${CMAKE_COMMAND} -E create_symlink "${CMAKE_SOURCE_DIR}/darwin/module.modulemap" "${CMAKE_SOURCE_DIR}/dispatch/module.modulemap" + COMMAND + ${CMAKE_COMMAND} -E create_symlink "${CMAKE_SOURCE_DIR}/darwin/module.modulemap" "${CMAKE_SOURCE_DIR}/private/module.modulemap") +else() + add_custom_command(OUTPUT + "${CMAKE_SOURCE_DIR}/dispatch/module.modulemap" + "${CMAKE_SOURCE_DIR}/private/module.modulemap" + COMMAND + ${CMAKE_COMMAND} -E create_symlink "${CMAKE_SOURCE_DIR}/generic/module.modulemap" "${CMAKE_SOURCE_DIR}/dispatch/module.modulemap" + COMMAND + ${CMAKE_COMMAND} -E create_symlink "${CMAKE_SOURCE_DIR}/generic/module.modulemap" "${CMAKE_SOURCE_DIR}/private/module.modulemap") +endif() configure_file("${CMAKE_SOURCE_DIR}/cmake/config.h.in" "${CMAKE_BINARY_DIR}/config/config_ac.h") add_definitions(-DHAVE_CONFIG_H)