cmake: Rename project to "libsecp256k1"

This commit is contained in:
Hennadii Stepanov 2023-03-08 21:22:24 +00:00
parent ef4f8bd025
commit 8be82d4362
No known key found for this signature in database
GPG Key ID: 410108112E7EA81F
3 changed files with 18 additions and 18 deletions

View File

@ -10,7 +10,7 @@ endif()
# The package (a.k.a. release) version is based on semantic versioning 2.0.0 of
# the API. All changes in experimental modules are treated as
# backwards-compatible and therefore at most increase the minor version.
project(secp256k1 VERSION 0.2.1 LANGUAGES C)
project(libsecp256k1 VERSION 0.2.1 LANGUAGES C)
# The library version is based on libtool versioning of the ABI. The set of
# rules for updating the version can be found here:

View File

@ -9,9 +9,9 @@ target_link_libraries(example INTERFACE
$<$<PLATFORM_ID:Windows>:bcrypt>
)
if(SECP256K1_BUILD_SHARED)
target_link_libraries(example INTERFACE ${PROJECT_NAME})
target_link_libraries(example INTERFACE secp256k1)
elseif(SECP256K1_BUILD_STATIC)
target_link_libraries(example INTERFACE ${PROJECT_NAME}_static)
target_link_libraries(example INTERFACE secp256k1_static)
if(MSVC)
target_link_options(example INTERFACE /IGNORE:4217)
endif()

View File

@ -17,42 +17,42 @@ add_library(precomputed OBJECT
)
set(internal_obj "$<TARGET_OBJECTS:precomputed>" "${common_obj}")
add_library(${PROJECT_NAME} SHARED EXCLUDE_FROM_ALL
add_library(secp256k1 SHARED EXCLUDE_FROM_ALL
secp256k1.c
${internal_obj}
)
target_include_directories(${PROJECT_NAME} INTERFACE
target_include_directories(secp256k1 INTERFACE
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_compile_definitions(${PROJECT_NAME} PRIVATE
target_compile_definitions(secp256k1 PRIVATE
$<$<PLATFORM_ID:Windows>:DLL_EXPORT>
)
set_target_properties(${PROJECT_NAME} PROPERTIES
set_target_properties(secp256k1 PROPERTIES
VERSION "${${PROJECT_NAME}_LIB_VERSION_CURRENT}.${${PROJECT_NAME}_LIB_VERSION_AGE}.${${PROJECT_NAME}_LIB_VERSION_REVISION}"
SOVERSION "${${PROJECT_NAME}_LIB_VERSION_CURRENT}"
)
if(SECP256K1_BUILD_SHARED)
get_target_property(use_pic ${PROJECT_NAME} POSITION_INDEPENDENT_CODE)
get_target_property(use_pic secp256k1 POSITION_INDEPENDENT_CODE)
set_target_properties(precomputed PROPERTIES POSITION_INDEPENDENT_CODE ${use_pic})
set_target_properties(${PROJECT_NAME} PROPERTIES EXCLUDE_FROM_ALL FALSE)
list(APPEND ${PROJECT_NAME}_installables ${PROJECT_NAME})
set_target_properties(secp256k1 PROPERTIES EXCLUDE_FROM_ALL FALSE)
list(APPEND ${PROJECT_NAME}_installables secp256k1)
endif()
add_library(${PROJECT_NAME}_static STATIC EXCLUDE_FROM_ALL
add_library(secp256k1_static STATIC EXCLUDE_FROM_ALL
secp256k1.c
${internal_obj}
)
target_include_directories(${PROJECT_NAME}_static INTERFACE
target_include_directories(secp256k1_static INTERFACE
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
if(NOT MSVC)
set_target_properties(${PROJECT_NAME}_static PROPERTIES
OUTPUT_NAME ${PROJECT_NAME}
set_target_properties(secp256k1_static PROPERTIES
OUTPUT_NAME secp256k1
)
endif()
if(SECP256K1_BUILD_STATIC)
set_target_properties(${PROJECT_NAME}_static PROPERTIES EXCLUDE_FROM_ALL FALSE)
list(APPEND ${PROJECT_NAME}_installables ${PROJECT_NAME}_static)
set_target_properties(secp256k1_static PROPERTIES EXCLUDE_FROM_ALL FALSE)
list(APPEND ${PROJECT_NAME}_installables secp256k1_static)
endif()
add_library(binary_interface INTERFACE)
@ -62,9 +62,9 @@ target_compile_definitions(binary_interface INTERFACE
add_library(link_library INTERFACE)
if(SECP256K1_BUILD_SHARED)
target_link_libraries(link_library INTERFACE ${PROJECT_NAME})
target_link_libraries(link_library INTERFACE secp256k1)
elseif(SECP256K1_BUILD_STATIC)
target_link_libraries(link_library INTERFACE ${PROJECT_NAME}_static)
target_link_libraries(link_library INTERFACE secp256k1_static)
endif()
if(SECP256K1_BUILD_BENCHMARK)