File: run.cmake

package info (click to toggle)
zxing-cpp 3.0.0%2Bds-1~exp2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 30,204 kB
  • sloc: ansic: 69,384; cpp: 34,587; php: 2,790; python: 199; makefile: 30; sh: 3
file content (33 lines) | stat: -rw-r--r-- 935 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
set(install_prefix "${PROJECT_BINARY_DIR}/InstallTest-prefix")
set(consumer_build "${PROJECT_BINARY_DIR}/InstallTest-build")

# 1. Install zxing-cpp
execute_process(
    COMMAND "${CMAKE_COMMAND}" --install "${PROJECT_BINARY_DIR}" --prefix "${install_prefix}"
    RESULT_VARIABLE install_result
)
if(NOT install_result EQUAL 0)
    message(FATAL_ERROR "Install step failed")
endif()

# 2. Configure consumer project
execute_process(
    COMMAND
        "${CMAKE_COMMAND}"
        -S "${SOURCE_DIR}"
        -B "${consumer_build}"
        -DCMAKE_PREFIX_PATH=${install_prefix}
    RESULT_VARIABLE configure_result
)
if(NOT configure_result EQUAL 0)
    message(FATAL_ERROR "Consumer configure failed")
endif()

# 3. Build consumer project
execute_process(
    COMMAND "${CMAKE_COMMAND}" --build "${consumer_build}"
    RESULT_VARIABLE build_result
)
if(NOT build_result EQUAL 0)
    message(FATAL_ERROR "Consumer build failed")
endif()