Skip to content

Commit

Permalink
CMake: Fix Install
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l committed Jan 4, 2023
1 parent 60eb5a5 commit c658573
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ jobs:
if(!$?) { Exit $LASTEXITCODE }
- name: Install
run: |
type build\cmake_install.cmake
cmake --build build --config RelWithDebInfo --target install
if(!$?) { Exit $LASTEXITCODE }
cmake --build build --config RelWithDebInfo --target pip_install
Expand Down Expand Up @@ -117,15 +119,20 @@ jobs:
if errorlevel 1 exit 1
cmake --build build --config Release --parallel 2
if errorlevel 1 exit 1
- name: Install Python
- name: Install
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\vc\Auxiliary\build\vcvarsall.bat" x64
type build\cmake_install.cmake
cmake --build build --config Release --target install
if errorlevel 1 exit 1
cmake --build build --config Release --target pip_install
if errorlevel 1 exit 1
- name: Test
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\vc\Auxiliary\build\vcvarsall.bat" x64
ctest --test-dir build --build-config Release --output-on-failure -E AMReX -R py
if errorlevel 1 exit 1
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\vc\Auxiliary\build\vcvarsall.bat" x64
ctest --test-dir build --build-config Release --output-on-failure -E AMReX -R py
if errorlevel 1 exit 1
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,12 @@ if(ImpactX_LIB)
else()
set(ABS_INSTALL_LIB_DIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
endif()
# escape spaces
string(REGEX REPLACE " " "\\\\ " ABS_INSTALL_LIB_DIR ${ABS_INSTALL_LIB_DIR})

install(CODE "file(CREATE_LINK
$<TARGET_FILE_NAME:lib>
${ABS_INSTALL_LIB_DIR}/libImpactX$<TARGET_FILE_SUFFIX:lib>
'${ABS_INSTALL_LIB_DIR}/libImpactX$<TARGET_FILE_SUFFIX:lib>'
COPY_ON_ERROR SYMBOLIC)")
endif()

Expand Down
2 changes: 1 addition & 1 deletion cmake/ImpactXFunctions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function(impactx_test_set_pythonpath test_name)
set_property(TEST ${test_name}
APPEND PROPERTY ENVIRONMENT
"PYTHONPATH=${WIN_PYTHON_OUTPUT_DIRECTORY}\;${WIN_PYTHONPATH}"
"PATH=$<TARGET_FILE_DIR:lib>\;${WIN_PATH}$"
"PATH=$<TARGET_FILE_DIR:lib>\;${WIN_PATH}"
)
else()
set_property(TEST ${test_name}
Expand Down

0 comments on commit c658573

Please sign in to comment.