Skip to content

Commit

Permalink
Add gen of DepManifest.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
bha-evs committed Mar 3, 2024
1 parent 26c4c49 commit 7cab638
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 20 deletions.
51 changes: 32 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

#cmake --build . --config Release -j 16
#cmake --install . --config Debug

#vcpkg list --x-install-root=C:/bld/bofstd-win/vcpkg_installed/
cmake_minimum_required(VERSION 3.25)

# Paranoid check : in-source generation is forbidden
Expand All @@ -49,6 +51,7 @@ string(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPER)
string(REPLACE "-" "_" PROJECT_NAME_UNDERSCORE ${PROJECT_NAME})
string(REPLACE "-" "_" PROJECT_NAME_LOWER_UNDERSCORE ${PROJECT_NAME_LOWER})
string(REPLACE "-" "_" PROJECT_NAME_UPPER_UNDERSCORE ${PROJECT_NAME_UPPER})
file(REMOVE ${CMAKE_BINARY_DIR}/DepManifest.txt)

option(BOFSTD_BUILD_EXAMPLES "Build example of BofStd project" ON)
option(BOFSTD_BUILD_TESTS "Build units tests of BofStd project" ON)
Expand Down Expand Up @@ -241,14 +244,6 @@ endif()

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${COMPILED_BINARIES_DIR}/lib)

# ===============
# == PACKAGING ==
# ===============

if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
# make package only if BofStd is the main project (not a submodule)
include(packaging.cmake)
endif()

# =======================
# == POPULATE PROJECTS ==
Expand Down Expand Up @@ -313,6 +308,27 @@ install(
COMPONENT bofstd-devel
)

# ===============
# == PACKAGING ==
# ===============

#if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
# # make package only if BofStd is the main project (not a submodule)
# include(packaging.cmake)
#endif()
if (PROJECT_IS_TOP_LEVEL)
include(cmake/cpack_main.cmake)
endif()

set(INTERNAL_NAMESPACE ONBINGS)
# Create and install the cmake configuration file based on our template
configure_package_config_file(
${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/bofstd-config.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_DATADIR}
)
unset(INTERNAL_NAMESPACE)

# Install dependencies
set(INCLUDE_REGEXES "^${CMAKE_BINARY_DIR}/vcpkg_installed/")
set(EXCLUDE_REGEXES
Expand All @@ -335,17 +351,6 @@ install(RUNTIME_DEPENDENCY_SET bofstd-imported-runtime-set
# our dependees can find us
include(CMakePackageConfigHelpers)

set(INTERNAL_NAMESPACE ONBINGS)

# Create and install the cmake configuration file based on our template
configure_package_config_file(
${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/bofstd-config.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_DATADIR}
)

unset(INTERNAL_NAMESPACE)

# Give the file a nice naming convention
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/Dependencies.cmake
Expand All @@ -370,3 +375,11 @@ install(FILES
)

#list_cmake_vars_containing("")
# Add a custom command to run the vcpkg list command during configuration
execute_process(
COMMAND ${CMAKE_COMMAND} -E env vcpkg list --x-install-root=./vcpkg_installed
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} # Change to your desired working directory
OUTPUT_VARIABLE DepVcpkg
)
file(APPEND ${CMAKE_BINARY_DIR}/DepManifest.txt "Vcpkg Dependencies for ${PROJECT_NAME}:\n")
file(APPEND ${CMAKE_BINARY_DIR}/DepManifest.txt "${DepVcpkg}")
5 changes: 5 additions & 0 deletions cmake/fetch_content.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ function(fetch_external_library_add LIB_NAME LIST_OF_LIB GIT_URL GIT_TAG)
GIT_REPOSITORY ${GIT_URL}
GIT_TAG ${GIT_TAG}
)
list(LENGTH LIST_OF_LIB LIST_SIZE)
if(LIST_SIZE EQUAL 0)
file(APPEND ${CMAKE_BINARY_DIR}/DepManifest.txt "FetchContent Dependencies for ${PROJECT_NAME}:\n")
endif()
file(APPEND ${CMAKE_BINARY_DIR}/DepManifest.txt "${LIB_NAME}\t${GIT_TAG}\t${GIT_URL}\n")
list(APPEND LIST_OF_LIB ${LIB_NAME}) # Append library name to the provided list
set(LIST_OF_LIB "${LIST_OF_LIB}" PARENT_SCOPE)
message(STATUS "End of of fetch external library add '${LIB_NAME}'")
Expand Down
2 changes: 1 addition & 1 deletion tests/src/ut_circularbuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ TEST(CircularBuffer_Test, Perf)
Index_U32 = 0;
}
}
printf("%ld Push Min %ld Mean %ld Max %ld Lck %ld\n", Profiler.GetNbSample(0), Profiler.GetMin(0), Profiler.GetMean(0), Profiler.GetMax(0), Profiler.GetLockCount(0));
printf("%zd Push Min %zd Mean %zd Max %zd Lck %zd\n", Profiler.GetNbSample(0), Profiler.GetMin(0), Profiler.GetMean(0), Profiler.GetMax(0), Profiler.GetLockCount(0));

Index_U32 = 0;
for (i_U32 = 0; i_U32 < NB_QUEUE_OP; i_U32++)
Expand Down

0 comments on commit 7cab638

Please sign in to comment.