Skip to content
Snippets Groups Projects
Commit 774e0080 authored by Grégoire Kubler's avatar Grégoire Kubler
Browse files

feat : pybind disabled by default + error messages

parent 43b467f6
No related branches found
No related tags found
2 merge requests!212Version 0.3.0,!116feat/release_pip
......@@ -15,7 +15,7 @@ set(CXX_STANDARD 14)
##############################################
# Define options
option(PYBIND "python binding" ON)
option(PYBIND "python binding" OFF)
option(WERROR "Warning as error" OFF)
option(TEST "Enable tests" ON)
option(COVERAGE "Enable coverage" OFF)
......@@ -79,14 +79,16 @@ endif()
# PYTHON BINDING
if (PYBIND)
find_package(Python REQUIRED)
if (${Python_VERSION_MAJOR} LESS 3)
MESSAGE(FATAL_ERROR "Unsupported Python version. Python 3.0.0+ is required")
endif()
generate_python_binding(${project} ${module_name})
# Handles Python + pybind11 headers dependencies
target_link_libraries(${module_name}
PUBLIC
pybind11::pybind11
PRIVATE
Python::Python
)
endif()
......@@ -133,6 +135,11 @@ endif()
##############################################
# Installation instructions
message("$ENV{AIDGE_INSTALL}")
if(NOT $ENV{AIDGE_INSTALL} STREQUAL "")
set(CMAKE_INSTALL_PREFIX $ENV{AIDGE_INSTALL})
message(WARNING "CMAKE_INSTALL_PREFIX set to env variable AIDGE_INSTALL by default = ${CMAKE_INSTALL_PREFIX}")
endif()
include(GNUInstallDirs)
set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${project})
......@@ -177,6 +184,7 @@ install(FILES
##############################################
## Exporting from the build tree
message(STATUS "Exporting created targets to use them in another build")
export(EXPORT ${project}-targets
FILE "${CMAKE_CURRENT_BINARY_DIR}/${project}-targets.cmake")
......@@ -187,3 +195,4 @@ if(TEST)
enable_testing()
add_subdirectory(unit_tests)
endif()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment