Skip to content

Commit

Permalink
cmake: Rename project to "libsecp256k1"
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed Mar 8, 2023
1 parent ef4f8bd commit 8be82d4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
30 changes: 15 additions & 15 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 8be82d4

Please sign in to comment.