Skip to content

Commit

Permalink
CMake: lib w/ other name than app/exe on Win
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l committed Jul 31, 2023
1 parent 740da03 commit 9647628
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ if(ImpactX_PYTHON)
else()
pybind11_extension(pyImpactX)
endif()
if(NOT MSVC AND NOT ${CMAKE_BUILD_TYPE} MATCHES Debug|RelWithDebInfo)
if(NOT MSVC AND NOT ${CMAKE_BUILD_TYPE} MATCHES Debug|RelWithDebInfo) # change to NOT WIN32 AND NOT ... ?
pybind11_strip(pyImpactX)
endif()
endif()
Expand Down
8 changes: 6 additions & 2 deletions cmake/ImpactXFunctions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,13 @@ function(impactx_set_binary_name)
if(ImpactX_APP)
list(APPEND ImpactX_bin_names app)
endif()
if(WIN32)
set_target_properties(lib PROPERTIES OUTPUT_NAME "libimpactx")
else()
set_target_properties(lib PROPERTIES OUTPUT_NAME "impactx")
endif()
set_target_properties(app PROPERTIES OUTPUT_NAME "impactx")
foreach(tgt IN LISTS ImpactX_bin_names)
set_target_properties(${tgt} PROPERTIES OUTPUT_NAME "impactx")

if(ImpactX_MPI)
set_property(TARGET ${tgt} APPEND_STRING PROPERTY OUTPUT_NAME ".MPI")
else()
Expand Down

0 comments on commit 9647628

Please sign in to comment.