Skip to content

Commit 2802d34

Browse files
committed
cmake: Improve MSVC output artifacts naming
When using Visual Studio generator, the "lib" prefix is not added automatically.
1 parent edc3f21 commit 2802d34

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/CMakeLists.txt

+10-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ set_target_properties(secp256k1 PROPERTIES
3232
VERSION "${${PROJECT_NAME}_soversion}.${${PROJECT_NAME}_LIB_VERSION_AGE}.${${PROJECT_NAME}_LIB_VERSION_REVISION}"
3333
SOVERSION ${${PROJECT_NAME}_soversion}
3434
)
35+
if(MSVC)
36+
set_target_properties(secp256k1 PROPERTIES
37+
OUTPUT_NAME ${PROJECT_NAME}
38+
)
39+
endif()
3540
if(SECP256K1_BUILD_SHARED)
3641
get_target_property(use_pic secp256k1 POSITION_INDEPENDENT_CODE)
3742
set_target_properties(precomputed PROPERTIES POSITION_INDEPENDENT_CODE ${use_pic})
@@ -46,7 +51,11 @@ add_library(secp256k1_static STATIC EXCLUDE_FROM_ALL
4651
target_include_directories(secp256k1_static INTERFACE
4752
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
4853
)
49-
if(NOT MSVC)
54+
if(MSVC)
55+
set_target_properties(secp256k1_static PROPERTIES
56+
OUTPUT_NAME ${PROJECT_NAME}_static
57+
)
58+
else()
5059
set_target_properties(secp256k1_static PROPERTIES
5160
OUTPUT_NAME secp256k1
5261
)

0 commit comments

Comments
 (0)