Skip to content

Commit

Permalink
copies ngspice.dll into executable folder
Browse files Browse the repository at this point in the history
  • Loading branch information
lmdiazangulo committed Feb 1, 2024
1 parent 60efdb5 commit c9bbe6a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/windows-intelLLVM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ jobs:
- name: Setup ninja
uses: seanmiddleditch/gha-setup-ninja@master

# - name: Setup upterm session
# uses: lhotari/action-upterm@v1
- name: Setup upterm session
uses: lhotari/action-upterm@v1

- name: CMake build
run: |
Expand Down
6 changes: 1 addition & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ if (CompileWithMTLN)
endif()
MESSAGE(STATUS "Using lapack precompiled libraries at: " ${LAPACK_DIR})


if (${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU" AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(NGSPICE_DIR "${CMAKE_SOURCE_DIR}/precompiled_libraries/linux-gcc-rls/ngspice/")
set(NGSPICE_LIB ${NGSPICE_DIR}libngspice.a)
Expand All @@ -91,11 +92,6 @@ if (CompileWithMTLN)
IMPORTED_LOCATION "${NGSPICE_DIR}ngspice.dll"
IMPORTED_IMPLIB "${NGSPICE_DIR}ngspice.lib"
)
configure_file(
"${NGSPICE_DIR}ngspice.dll"
"${CMAKE_BINARY_DIR}/bin/ngspice.dll"
COPYONLY
)
else()
message(FATAL_ERROR "ngspice precompiled libraries for this platform and/or compiler have not been found.")
endif()
Expand Down
21 changes: 21 additions & 0 deletions test/mtln/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,27 @@ target_link_libraries(mtln_solver_tests_fortran
)

add_executable(mtlnsolver_tests "main_test.cpp")

message(STATUS "Copying to: ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CONFIG}/ngspice.dll")
# configure_file(
# "${NGSPICE_DIR}ngspice.dll"
# "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CONFIG}/ngspice.dll"
# COPYONLY
# )
message(STATUS "Copying to:" $<TARGET_FILE_DIR:mtlnsolver_tests>)
# configure_file(
# "${NGSPICE_DIR}ngspice.dll"
# "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CONFIG}/ngspice.dll"
# COPYONLY
# )
if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
add_custom_command(TARGET mtlnsolver_tests POST_BUILD # Adds a post-build event to MyTest
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${NGSPICE_DIR}ngspice.dll"
$<TARGET_FILE_DIR:mtlnsolver_tests>
)
endif()

target_link_libraries(mtlnsolver_tests
mtln_solver_tests_fortran
GTest::gtest_main
Expand Down

0 comments on commit c9bbe6a

Please sign in to comment.