From fdbc28678ad517a2659c7b2a250b8f6aabee9feb Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Fri, 15 Dec 2023 10:24:50 -0500 Subject: [PATCH 1/3] Fix cmake build with external surelog --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b743c38b..0c5d51803 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -281,8 +281,10 @@ if(VENDORED_YOSYS) add_dependencies(capnp yosys) endif() -add_dependencies(synlig surelog) -add_dependencies(synlig uhdm) +if(NOT SYNLIG_USE_HOST_SURELOG) + add_dependencies(synlig surelog) + add_dependencies(synlig uhdm) +endif() target_link_libraries(synlig PUBLIC ${UHDM_LIBRARY}) target_link_libraries(synlig PUBLIC ${SURELOG_LIBRARY}) From 3425b9cadc6245cb2a745f9b52fa9815396aaa13 Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Fri, 15 Dec 2023 10:46:20 -0500 Subject: [PATCH 2/3] correct capitalization of library --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c5d51803..d9b7adcd4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -128,7 +128,7 @@ set(WITH_STATIC_CRT CACHE BOOL "Use Static CRT") if(SYNLIG_USE_HOST_SURELOG) - find_package(SURELOG REQUIRED) + find_package(Surelog REQUIRED) find_package(UHDM REQUIRED) find_package(CapnProto) set(UHDM_LIBRARY uhdm::uhdm) From 5c76df3377a73b71030e8560269cd8a9710f622d Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Fri, 15 Dec 2023 11:32:22 -0500 Subject: [PATCH 3/3] Install shared library into same dir as non-cmake, fix cmake install command to actually work --- CMakeLists.txt | 22 +++------------------- install_plugin.sh | 2 +- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d9b7adcd4..cb530250b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ endif(NOT CMAKE_BUILD_TYPE) set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH}) -set(INSTALL_DIR ${PROJECT_SOURCE_DIR}/install) +set(INSTALL_DIR ${PROJECT_SOURCE_DIR}/out/current) option( WITH_LIBCXX @@ -318,21 +318,5 @@ target_include_directories(synlig PUBLIC $ target_include_directories(synlig PUBLIC $ $) -include(GNUInstallDirs) - -# Generate cmake config files for reuse by downstream packages -include(CMakePackageConfigHelpers) - -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/SynligConfig.cmake - ${CMAKE_CURRENT_BINARY_DIR}/SynligConfigVersion.cmake - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Synlig) - -# install the configuration file -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Synlig.pc DESTINATION lib/pkgconfig) - -add_custom_target( - synlig_link_target ALL - COMMAND - ${CMAKE_COMMAND} -E create_symlink - ${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json - ${PROJECT_SOURCE_DIR}/compile_commands.json) +# Install library using normal shell script +install(CODE "execute_process(COMMAND ${CMAKE_SOURCE_DIR}/install_plugin.sh)") diff --git a/install_plugin.sh b/install_plugin.sh index 9dbbe59c4..7a40476cc 100755 --- a/install_plugin.sh +++ b/install_plugin.sh @@ -1,4 +1,4 @@ -#!/bin/env bash +#!/usr/bin/env bash set -e