From 02a14e5c36d6edfae2b2370044dea76923cb8d59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Kubler?= <gregoire.kubler@proton.me> Date: Thu, 2 May 2024 17:45:33 +0200 Subject: [PATCH] fix : include order --- CMakeLists.txt | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1484a2a0..58e7d201 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,9 +30,6 @@ if(CMAKE_COMPILER_IS_GNUCXX AND COVERAGE) Include(CodeCoverage) endif() -############################################## -# Find system dependencies -find_package(aidge_core REQUIRED) ############################################## # Create target and set properties @@ -42,6 +39,23 @@ file(GLOB_RECURSE inc_files "include/*.hpp") ############################################## #Â creating library add_library(${module_name} ${src_files} ${inc_files}) +# 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 + ) +endif() +############################################## +# Find aidge dependencies +find_package(aidge_core REQUIRED) target_link_libraries(${module_name} PUBLIC _aidge_core # _ is added because we link the target not the project @@ -71,20 +85,6 @@ target_include_directories(${module_name} ${CMAKE_CURRENT_SOURCE_DIR}/src ) -# 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 - ) -endif() target_link_libraries(${module_name} PUBLIC fmt::fmt) target_compile_features(${module_name} PRIVATE cxx_std_14) -- GitLab