Changeset View
Changeset View
Standalone View
Standalone View
src/CMakeLists.txt
Show First 20 Lines • Show All 163 Lines • ▼ Show 20 Lines | |||||
# libraries | # libraries | ||||
add_subdirectory(crypto) | add_subdirectory(crypto) | ||||
add_subdirectory(leveldb) | add_subdirectory(leveldb) | ||||
add_subdirectory(secp256k1) | add_subdirectory(secp256k1) | ||||
add_subdirectory(univalue) | add_subdirectory(univalue) | ||||
set(OBJ_DIR "${CMAKE_CURRENT_BINARY_DIR}/obj") | set(OBJ_DIR "${CMAKE_CURRENT_BINARY_DIR}/obj") | ||||
file(MAKE_DIRECTORY "${OBJ_DIR}") | file(MAKE_DIRECTORY "${OBJ_DIR}") | ||||
add_custom_target(build_header | set(BUILD_HEADER "${OBJ_DIR}/build.h") | ||||
set(BUILD_HEADER_TMP "${BUILD_HEADER}.tmp") | |||||
add_custom_command( | |||||
DEPENDS | |||||
"${CMAKE_SOURCE_DIR}/.git/logs/HEAD" | |||||
deadalnix: Please wrap this in a funcction. First, this file is not guaranteed to exist, second you need… | |||||
"${CMAKE_SOURCE_DIR}/share/genbuild.sh" | |||||
OUTPUT | |||||
"${BUILD_HEADER}" | |||||
COMMAND | COMMAND | ||||
"${CMAKE_SOURCE_DIR}/share/genbuild.sh" | "${CMAKE_SOURCE_DIR}/share/genbuild.sh" | ||||
"${OBJ_DIR}/build.h" | "${BUILD_HEADER_TMP}" | ||||
"${CMAKE_SOURCE_DIR}" | "${CMAKE_SOURCE_DIR}" | ||||
COMMAND | |||||
${CMAKE_COMMAND} -E copy_if_different "${BUILD_HEADER_TMP}" "${BUILD_HEADER}" | |||||
COMMAND | |||||
${CMAKE_COMMAND} -E remove "${BUILD_HEADER_TMP}" | |||||
) | ) | ||||
# Because the Bitcoin ABc source code is disorganised, we | # Because the Bitcoin ABc source code is disorganised, we | ||||
# end up with a bunch of libraries without any apparent | # end up with a bunch of libraries without any apparent | ||||
# cohesive structure. This is inherited from Bitcoin Core | # cohesive structure. This is inherited from Bitcoin Core | ||||
# and reflecting this. | # and reflecting this. | ||||
# TODO: Improve the structure once cmake is rocking. | # TODO: Improve the structure once cmake is rocking. | ||||
Show All 15 Lines | add_library(util | ||||
sync.cpp | sync.cpp | ||||
threadinterrupt.cpp | threadinterrupt.cpp | ||||
uint256.cpp | uint256.cpp | ||||
util.cpp | util.cpp | ||||
utilmoneystr.cpp | utilmoneystr.cpp | ||||
utilstrencodings.cpp | utilstrencodings.cpp | ||||
utiltime.cpp | utiltime.cpp | ||||
util/bytevectorhash.cpp | util/bytevectorhash.cpp | ||||
# obj/build.h | |||||
"${BUILD_HEADER}" | |||||
) | ) | ||||
add_dependencies(util build_header) | |||||
target_compile_definitions(util PUBLIC HAVE_CONFIG_H HAVE_BUILD_INFO) | target_compile_definitions(util PUBLIC HAVE_CONFIG_H HAVE_BUILD_INFO) | ||||
target_include_directories(util | target_include_directories(util | ||||
PUBLIC | PUBLIC | ||||
. | . | ||||
# To access the config/ and obj/ directories | # To access the config/ and obj/ directories | ||||
${CMAKE_CURRENT_BINARY_DIR} | ${CMAKE_CURRENT_BINARY_DIR} | ||||
) | ) | ||||
▲ Show 20 Lines • Show All 262 Lines • Show Last 20 Lines |
Please wrap this in a funcction. First, this file is not guaranteed to exist, second you need to actualy locate the root of the git repo. This now has backed in assumption about the structure of thing outside the scope of this module.