Skip to content

Commit

Permalink
Enable cmake option overrides (CMP0077)
Browse files Browse the repository at this point in the history
Add enable static msvcrt to ykhsmauth
  • Loading branch information
notdpate committed Sep 21, 2024
1 parent f100564 commit bfa7dae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ cmake_policy(SET CMP0025 NEW)
cmake_policy(SET CMP0042 NEW)
cmake_policy(SET CMP0054 NEW)
cmake_policy(SET CMP0091 NEW)
cmake_policy(SET CMP0077 NEW)

project (yubihsm-shell)

Expand Down
7 changes: 7 additions & 0 deletions ykhsmauth/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,20 @@ target_link_libraries (ykhsmauth ${LIBPCSC_LDFLAGS})

set_target_properties (ykhsmauth PROPERTIES VERSION "${yubihsm_shell_VERSION_MAJOR}.${yubihsm_shell_VERSION_MINOR}.${yubihsm_shell_VERSION_PATCH}" SOVERSION ${yubihsm_shell_VERSION_MAJOR})

if (ENABLE_STATIC_MSVCRT)
set_property(TARGET ykhsmauth PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()

# Set install RPATH
set_target_properties(ykhsmauth PROPERTIES INSTALL_RPATH "${YUBIHSM_INSTALL_LIB_DIR}")

add_library (ykhsmauth_static STATIC ${SOURCE})
set_target_properties (ykhsmauth_static PROPERTIES POSITION_INDEPENDENT_CODE on OUTPUT_NAME ykhsmauth)
set_target_properties (ykhsmauth_static PROPERTIES COMPILE_FLAGS "-DSTATIC")
target_link_libraries (ykhsmauth_static ${LIBPCSC_LDFLAGS})
if (ENABLE_STATIC_MSVCRT)
set_property(TARGET ykhsmauth_static PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ykhsmauth.pc.in ${CMAKE_CURRENT_BINARY_DIR}/ykhsmauth.pc @ONLY)
if(WIN32)
Expand Down

0 comments on commit bfa7dae

Please sign in to comment.