ripe
ripe copied to clipboard
ripe.lib not generated
Hi Majid Q,
I have successfully compiled https://github.com/abumq/ripe/issues/40 on Ubuntu, but I encountered an issue with Windows. As far as I know, for the static build, the file extension should be *.lib.
Highlight
ninja: error: 'cryptopp-cmake/cryptopp/Debug/cryptopp.lib', needed by 'ripe/ripe.dll', missing and no known rule to make it
CMakeLists.txt
cmake_minimum_required(VERSION 3.21)
project(hello_library)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
############################################################
# Create a library
############################################################
# Cryptopp
add_subdirectory(cryptopp-cmake)
set(CryptoPP_USE_STATIC_LIBS ON)
set(CRYPTOPP_ROOT_DIR "${CMAKE_BINARY_DIR}/cryptopp-cmake")
set(CRYPTOPP_LIBRARY "${CMAKE_BINARY_DIR}/cryptopp-cmake")
find_package(CryptoPP REQUIRED) # Check if this package is correctly installed and found.
if(UNIX)
set(CRYPTOPP_LIBRARIES_ENV ${CRYPTOPP_LIBRARIES}/cryptopp/libcryptopp.a) # This will be set for Linux and other Unix-like systems
elseif(WIN32)
set(CRYPTOPP_LIBRARIES_ENV ${CRYPTOPP_LIBRARIES}/cryptopp/Debug/cryptopp.lib) # This will be set for Windows
endif()
# Ripe
add_subdirectory(ripe) # Build the Ripe library first
set(RIPE_USE_STATIC_LIBS ON)
set(LIB_RIPE_SOURCE_FILES "${CMAKE_SOURCE_DIR}/ripe")
set(RIPE_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/ripe")
set(RIPE_LIBRARY "${CMAKE_BINARY_DIR}/ripe") # Point to the build directory of Ripe
find_package(Ripe REQUIRED) # Check if this package is correctly installed and found.
if(UNIX)
set(RIPE_LIBRARY_ENV ${RIPE_LIBRARY}/libripe.so) # This will be set for Linux and other Unix-like systems
elseif(WIN32)
set(RIPE_LIBRARY_ENV ${RIPE_LIBRARY}/Debug/ripe.lib) # This will be set for Windows
endif()
target_link_libraries(ripe
${CRYPTOPP_LIBRARIES_ENV}
${ZLIB_LIBRARIES}
)
target_link_libraries (ripe-bin
${CRYPTOPP_LIBRARIES_ENV}
${ZLIB_LIBRARIES}
)
# Licenspp
add_subdirectory(licensepp) # Build the Licenspp library first
target_include_directories(licensepp-lib
PRIVATE
${CMAKE_SOURCE_DIR}/licensepp # Add the directory containing json-object.h
${CMAKE_SOURCE_DIR}/licensepp/include
${RIPE_INCLUDE_DIR}/include
# Other include directories if needed
)
target_link_libraries(licensepp-lib
${CRYPTOPP_LIBRARIES_ENV}
${RIPE_LIBRARY_ENV}
)
# target_link_libraries(licensepp-lib
# ${RIPE_LIBRARY_ENV}
# )
# Add your main project executable or library
add_executable(hello_library main.cpp) # Replace with your target name
Log
rm -rf build && mkdir build && cmake -B build -G Ninja && cmake --build build/-- The C compiler identification is Clang 15.0.6 with GNU-like command-line
-- The CXX compiler identification is Clang 15.0.6 with GNU-like command-line
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/LLVM/bin/clang.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/LLVM/bin/clang++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM compiler identification is Clang with GNU-like command-line
-- Found assembler: C:/Program Files/LLVM/bin/clang.exe
=> Project : cryptopp-cmake v8.8.0
-- Found Git: C:/Program Files/Git/mingw64/bin/git.exe (found version "2.38.1.windows.1")
-- Crypto++ auto fetched at: C:/Users/aa6my/_dev/cmake-test/build/cryptopp-cmake/cryptopp
-- Using branch licensing_mechanism for tests
-- Adding unit test: disable-feature
-- Adding unit test: include-prefix
-- Adding unit test: no-install
-- Adding unit test: standard-cpm
-- Adding install integration test: int-install-default
-- Adding install integration test: int-install-prefix
=> Module : cryptopp
-- [cryptopp] CMake version 3.25.1
-- [cryptopp] System Windows
-- [cryptopp] Processor AMD64
-- [cryptopp] CMAKE_HOST_SYSTEM_PROCESSOR : AMD64
-- [cryptopp] CMAKE_SYSTEM_PROCESSOR : AMD64
-- [cryptopp] Target architecture detected as: x86_64 -> CRYPTOPP_AMD64
-- [cryptopp] Performing Test CRYPTOPP_HAVE_SSE2
-- [cryptopp] Performing Test CRYPTOPP_HAVE_SSE2 - Success
-- [cryptopp] Performing Test CRYPTOPP_HAVE_SSE3
-- [cryptopp] Performing Test CRYPTOPP_HAVE_SSE3 - Success
-- [cryptopp] Performing Test CRYPTOPP_HAVE_SSSE3
-- [cryptopp] Performing Test CRYPTOPP_HAVE_SSSE3 - Success
-- [cryptopp] Performing Test CRYPTOPP_HAVE_SSE41
-- [cryptopp] Performing Test CRYPTOPP_HAVE_SSE41 - Success
-- [cryptopp] Performing Test CRYPTOPP_HAVE_SSE42
-- [cryptopp] Performing Test CRYPTOPP_HAVE_SSE42 - Success
-- [cryptopp] Performing Test CRYPTOPP_HAVE_CLMUL
-- [cryptopp] Performing Test CRYPTOPP_HAVE_CLMUL - Success
-- [cryptopp] Performing Test CRYPTOPP_HAVE_AESNI
-- [cryptopp] Performing Test CRYPTOPP_HAVE_AESNI - Success
-- [cryptopp] Performing Test CRYPTOPP_HAVE_AVX
-- [cryptopp] Performing Test CRYPTOPP_HAVE_AVX - Success
-- [cryptopp] Performing Test CRYPTOPP_HAVE_AVX2
-- [cryptopp] Performing Test CRYPTOPP_HAVE_AVX2 - Success
-- [cryptopp] Performing Test CRYPTOPP_HAVE_SHANI
-- [cryptopp] Performing Test CRYPTOPP_HAVE_SHANI - Success
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - no
-- Found Threads: TRUE
-- [cryptopp] Generating cmake package config files
-- [cryptopp] Generating pkgconfig files
-- [cryptopp] Platform: x86_64
-- [cryptopp] Compiler definitions:
-- [cryptopp] Compiler options:
-- [cryptopp] Build type: Debug
-- Static linking to Crypto++
-- Found CryptoPP: C:/Users/aa6my/_dev/cmake-test/build/cryptopp-cmake (found version "..")
-- Static linking to Crypto++
-- Crypto++ binary: C:/Users/aa6my/_dev/cmake-test/build/cryptopp-cmake
-- Found ZLIB: C:/Program Files/zlib/lib/zlibstat.lib (found version "1.2.3")
-- Looking for C++ include attr/xattr.h
-- Looking for C++ include attr/xattr.h - not found
-- Looking for C++ include sys/xattr.h
-- Looking for C++ include sys/xattr.h - not found
-- Ripe: Static linking
-- Ripe: Include: C:/Users/aa6my/_dev/cmake-test/ripe, Binary: C:/Users/aa6my/_dev/cmake-test/build/ripe
-- Found Ripe: C:/Users/aa6my/_dev/cmake-test/ripe
-- Static linking to Crypto++
-- Crypto++ binary: C:/Users/aa6my/_dev/cmake-test/build/cryptopp-cmake
-- Ripe: Dynamic linking
-- Ripe: Include: C:/Users/aa6my/_dev/cmake-test/ripe, Binary: C:/Users/aa6my/_dev/cmake-test/build/ripe
-- Configuring done
CMake Warning at ripe/CMakeLists.txt:95 (target_link_libraries):
Target "ripe" requests linking to directory
"C:/Users/aa6my/_dev/cmake-test/build/cryptopp-cmake". Targets
may link only to libraries. CMake is dropping the item.
CMake Warning at ripe/CMakeLists.txt:110 (target_link_libraries):
Target "ripe-bin" requests linking to directory
"C:/Users/aa6my/_dev/cmake-test/build/cryptopp-cmake". Targets
may link only to libraries. CMake is dropping the item.
CMake Warning at licensepp/CMakeLists.txt:88 (target_link_libraries):
Target "licensepp-lib" requests linking to directory
"C:/Users/aa6my/_dev/cmake-test/build/cryptopp-cmake". Targets
may link only to libraries. CMake is dropping the item.
CMake Warning at licensepp/CMakeLists.txt:88 (target_link_libraries):
Target "licensepp-lib" requests linking to directory
"C:/Users/aa6my/_dev/cmake-test/build/ripe". Targets may link
only to libraries. CMake is dropping the item.
-- Generating done
-- Build files have been written to: C:/Users/aa6my/_dev/cmake-test/build
ninja: error: 'cryptopp-cmake/cryptopp/Debug/cryptopp.lib', needed by 'ripe/ripe.dll', missing and no known rule to make it