From: Craig Andrews Date: Tue, 30 Oct 2018 01:29:30 +0000 (-0400) Subject: Support out-of-source building and have Travis do it X-Git-Tag: v3.0.0~331^2~1^2 X-Git-Url: http://wagner.pp.ru/gitweb/?a=commitdiff_plain;h=863de1241ca76321388ccfe1d9a7e886d022cb58;p=openssl-gost%2Fengine.git Support out-of-source building and have Travis do it --- diff --git a/.travis.yml b/.travis.yml index ae592a0..dd84cdb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,6 @@ env: - PREFIX=${HOME}/opt - LD_LIBRARY_PATH=${PREFIX}/lib - PATH=${PREFIX}/bin:${PATH} - - OPENSSL_ENGINES=${TRAVIS_BUILD_DIR}/bin matrix: include: @@ -31,5 +30,8 @@ before_script: - cd .. script: - - cmake -DOPENSSL_ROOT_DIR=${PREFIX} -DOPENSSL_LIBRARIES=${PREFIX}/lib -DOPENSSL_ENGINES_DIR=${PREFIX}/engines && make + - mkdir build + - cd build + - cmake -DOPENSSL_ROOT_DIR=${PREFIX} -DOPENSSL_LIBRARIES=${PREFIX}/lib -DOPENSSL_ENGINES_DIR=${PREFIX}/engines .. + - make - make test diff --git a/CMakeLists.txt b/CMakeLists.txt index 55b86c9..26d2a40 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,7 @@ endif() set(BIN_DIRECTORY bin) -set(OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/${BIN_DIRECTORY}) +set(OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${BIN_DIRECTORY}) #set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_DIRECTORY}) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_DIRECTORY}) @@ -141,6 +141,7 @@ add_test(NAME grasshopper add_test(NAME engine COMMAND perl run_tests WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test) +set_tests_properties(engine PROPERTIES ENVIRONMENT OPENSSL_ENGINES=${OUTPUT_DIRECTORY}) add_library(gost_core STATIC ${GOST_LIB_SOURCE_FILES}) set_target_properties(gost_core PROPERTIES POSITION_INDEPENDENT_CODE ON)