cmake: Set top-level target output locations
This change: 1. Collects build artifacts in dedicated locations. 2. Allows to run individual examples with a shared library on Windows. 3. Is compatible with Wine when testing cross-compiled Windows binaries on Linux. 4. Is compatible with integration the project into a larger project hierarchy.
This commit is contained in:
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
@@ -751,14 +751,14 @@ jobs:
|
|||||||
# Use the bash shell included with Git for Windows.
|
# Use the bash shell included with Git for Windows.
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
cd build/src/RelWithDebInfo && file *tests.exe bench*.exe libsecp256k1-*.dll || true
|
cd build/bin/RelWithDebInfo && file *tests.exe bench*.exe libsecp256k1-*.dll || true
|
||||||
|
|
||||||
- name: Check
|
- name: Check
|
||||||
run: |
|
run: |
|
||||||
ctest -C RelWithDebInfo --test-dir build -j ([int]$env:NUMBER_OF_PROCESSORS + 1)
|
ctest -C RelWithDebInfo --test-dir build -j ([int]$env:NUMBER_OF_PROCESSORS + 1)
|
||||||
build\src\RelWithDebInfo\bench_ecmult.exe
|
build\bin\RelWithDebInfo\bench_ecmult.exe
|
||||||
build\src\RelWithDebInfo\bench_internal.exe
|
build\bin\RelWithDebInfo\bench_internal.exe
|
||||||
build\src\RelWithDebInfo\bench.exe
|
build\bin\RelWithDebInfo\bench.exe
|
||||||
|
|
||||||
win64-native-headers:
|
win64-native-headers:
|
||||||
name: "x64 (MSVC): C++ (public headers)"
|
name: "x64 (MSVC): C++ (public headers)"
|
||||||
|
|||||||
@@ -286,6 +286,15 @@ if(SECP256K1_APPEND_LDFLAGS)
|
|||||||
string(APPEND CMAKE_C_LINK_EXECUTABLE " ${SECP256K1_APPEND_LDFLAGS}")
|
string(APPEND CMAKE_C_LINK_EXECUTABLE " ${SECP256K1_APPEND_LDFLAGS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
|
||||||
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
|
||||||
|
endif()
|
||||||
|
if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
|
||||||
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
|
||||||
|
endif()
|
||||||
|
if(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
|
||||||
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
|
||||||
|
endif()
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
if(SECP256K1_BUILD_EXAMPLES)
|
if(SECP256K1_BUILD_EXAMPLES)
|
||||||
add_subdirectory(examples)
|
add_subdirectory(examples)
|
||||||
|
|||||||
Reference in New Issue
Block a user