diff --git a/CMakeLists.txt b/CMakeLists.txt index f933e00b7754c72e95b7b0cc3b0594eb2f154210..e31509842a876151c31473d89f7e242f61617544 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,8 +36,9 @@ enable_language(CUDA) find_package(CUDAToolkit REQUIRED) find_package(aidge_core REQUIRED) -find_package(aidge_backend_cpu REQUIRED) - +if(TEST) + find_package(aidge_backend_cpu REQUIRED) +endif() ############################################## # Create target and set properties @@ -48,11 +49,17 @@ add_library(${module_name} ${src_files} ${inc_files}) target_link_libraries(${module_name} PUBLIC _aidge_core # _ is added because we link the target not the project - _aidge_backend_cpu # _ is added because we link the target not the project CUDA::cudart cudnn ) +if(TEST) + target_link_libraries(${module_name} + PUBLIC + _aidge_backend_cpu # _ is added because we link the target not the project + ) +endif() + #Set target properties target_include_directories(${module_name} PUBLIC diff --git a/setup.py b/setup.py index dbf82e2826065c812a3bea5f5e1d34557b79f00d..80500f3165dd87eb7b6dd73c78b89806cc8a874a 100644 --- a/setup.py +++ b/setup.py @@ -62,10 +62,10 @@ class CMakeBuild(build_ext): os.chdir(str(build_temp)) - # Impose to use the executable of the python + # Impose to use the executable of the python # used to launch setup.py to setup PythonInterp param_py = "-DPYTHON_EXECUTABLE=" + sys.executable - + compile_type = 'Debug' install_path = os.path.join(sys.prefix, "lib", "libAidge") if "AIDGE_INSTALL" not in os.environ else os.environ["AIDGE_INSTALL"] @@ -85,11 +85,11 @@ class CMakeBuild(build_ext): for file in files: if (file.endswith('.so') or file.endswith('.pyd')) and (root != str(aidge_package.absolute())): currentFile=os.path.join(root, file) - shutil.copy(currentFile, str(aidge_package.absolute())) + shutil.copy(currentFile, str(aidge_package.absolute())) # Copy version.txt in aidge_package os.chdir(os.path.dirname(__file__)) - shutil.copy("version.txt", str(aidge_package.absolute())) + shutil.copy("version.txt", str(aidge_package.absolute())) if __name__ == '__main__': @@ -108,7 +108,7 @@ if __name__ == '__main__': cmdclass={ 'build_ext': CMakeBuild, }, - install_requires=['aidge_core', 'aidge_backend_cpu'], + install_requires=['aidge_core'], zip_safe=False, )