From 8be82d43628138553bc126a76d52edf523031792 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Wed, 8 Mar 2023 21:22:24 +0000 Subject: [PATCH] cmake: Rename project to "libsecp256k1" --- CMakeLists.txt | 2 +- examples/CMakeLists.txt | 4 ++-- src/CMakeLists.txt | 30 +++++++++++++++--------------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 19844da..33ab1cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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: diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 9a2fc51..0884b64 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -9,9 +9,9 @@ target_link_libraries(example INTERFACE $<$: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() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f110052..26272d0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -17,42 +17,42 @@ add_library(precomputed OBJECT ) set(internal_obj "$" "${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 $ ) -target_compile_definitions(${PROJECT_NAME} PRIVATE +target_compile_definitions(secp256k1 PRIVATE $<$: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 $ ) 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)