diff --git a/CMakeLists.txt b/CMakeLists.txt index ec6aacd723a50eba2bfed0184941410340c6a7aa..669b72380508c6ffbbde207798a75ff36537cdb7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() +