Skip to content

cmake: use environment variables #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ IF(NOT GIT_SUBMOD_RESULT EQUAL "0")
message(FATAL_ERROR "${GIT_COMMAND_EXECUTED} failed with ${GIT_SUBMOD_RESULT}, please checkout submodules.")
ENDIF()

IF(DEFINED CMAKE_TOOLCHAIN_FILE)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_TOOLCHAIN_FILE})
ELSE()
set(CMAKE_TOOLCHAIN_FILE "vcpkg/scripts/buildsystems/vcpkg.cmake")
ENDIF()


project(pybnesian VERSION ${SKBUILD_PROJECT_VERSION} LANGUAGES CXX)
ADD_DEFINITIONS("-DVERSION_INFO=${SKBUILD_PROJECT_VERSION}")
Expand Down Expand Up @@ -66,10 +71,10 @@ ELSEIF(UNIX)
SET(SCRIPT_EXTENSION "sh")
ENDIF()

execute_process(COMMAND python expand_sources.py RESULT_VARIABLE EXPAND_SOURCES_RESULT)
execute_process(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/expand_sources.py RESULT_VARIABLE EXPAND_SOURCES_RESULT)

IF(NOT EXPAND_SOURCES_RESULT EQUAL "0")
message(FATAL_ERROR "$python expand_sources.py failed with ${EXPAND_SOURCES_RESULT}")
message(FATAL_ERROR "${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/expand_sources.py failed with ${EXPAND_SOURCES_RESULT}")
ENDIF()

execute_process(COMMAND ${SCRIPT_PREFIX}bootstrap-vcpkg.${SCRIPT_EXTENSION} WORKING_DIRECTORY "vcpkg" RESULT_VARIABLE VCPKG_BOOTSTRAP_RESULT)
Expand Down