[fixed] new CMakeLists

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[fixed] new CMakeLists

emanuel
This post was updated on .
With the new CMakeLists.txt (librecad_lib), I can no longer build the Python extensions using swig. I always get undefined references. It worked before. Building works perfectly fine in librecad.pro. I have no idea what to do.
Reply | Threaded
Open this post in threaded view
|

Re: new CMakeLists

dxli
Let's merge your changes and fix the issue with the PR.

emanuel wrote
With the new CMakeLists.txt (librecad_lib), I can no longer build the Python extensions using swig. I always get undefined references. It worked before. Building works perfectly fine in librecad.pro. I have no idea what to do.
Reply | Threaded
Open this post in threaded view
|

Re: new CMakeLists

emanuel
cmake-developer_old.patch

New CMakeLists.txt (not working)

1.) the builtin python needs "librecad" as name to be linked:
set_property(TARGET librepython PROPERTY OUTPUT_NAME librecad)

src in scripting module  *.cpp (also used by *.pro building):
PyMODINIT_FUNC PyInit__librecad(void);

2.) new methode in CMakeLists errors:

pixi.error
CMakeLists.txt
Reply | Threaded
Open this post in threaded view
|

Re: new CMakeLists

flywire
Does this use any system python 3? Will that affect version used by users?
Reply | Threaded
Open this post in threaded view
|

Re: new CMakeLists

emanuel
In reply to this post by dxli
com to build:

git clone https://github.com/emanuel4you/LibreCAD.git
cd LibreCAD
git checkout developer
(change to current CMakeLists.txt posted here)
pixi run build
Reply | Threaded
Open this post in threaded view
|

Re: new CMakeLists

emanuel
this sould be fixed.

https://github.com/emanuel4you/LibreCAD/commit/7e457e6de1f5d77e94f2b8ca4094ef882564f613

but I still got an error using the "cmake -S . -B unix -DBUILD_TESTS=ON"
test in build-all.yml

result:
cmake
-- The C compiler identification is GNU 13.3.0
-- The CXX compiler identification is GNU 13.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Found WrapOpenGL: TRUE
-- Could NOT find XKB (missing: XKB_LIBRARY XKB_INCLUDE_DIR) (Required is at least version "0.5.0")
-- Found WrapVulkanHeaders: /usr/include
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE
CMake Warning (dev) at CMakeLists.txt:24 (find_package):
  Policy CMP0167 is not set: The FindBoost module is removed.  Run "cmake
  --help-policy CMP0167" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.83.0/BoostConfig.cmake (found version "1.83.0")
-- Found Freetype: /usr/lib/x86_64-linux-gnu/libfreetype.so (found version "2.13.2")
-- Found Python3: /usr/bin/python3.12 (found version "3.12.3") found components: Interpreter Development Development.Module Development.Embed
-- Found SWIG: /usr/bin/swig4.0 (found suitable version "4.2.0", minimum required is "4") found components: python
CMake Error at CMakeLists.txt:1855 (add_subdirectory):
  The source directory

    /home/runner/work/LibreCAD/LibreCAD/externals/Catch2

  does not contain a CMakeLists.txt file.
Reply | Threaded
Open this post in threaded view
|

Re: new CMakeLists

dxli
I separated most part of librecad into a librecad_lib, and it's shared by the librecad executible and the unit test executible . The motivation is to be certain that the same code is tested.

The changed caused quite a few issues, but the change appears to be in the right direction.


emanuel wrote
this sould be fixed.

https://github.com/emanuel4you/LibreCAD/commit/7e457e6de1f5d77e94f2b8ca4094ef882564f613

but I still got an error using the "cmake -S . -B unix -DBUILD_TESTS=ON"
test in build-all.yml

result:
cmake
-- The C compiler identification is GNU 13.3.0
-- The CXX compiler identification is GNU 13.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Found WrapOpenGL: TRUE
-- Could NOT find XKB (missing: XKB_LIBRARY XKB_INCLUDE_DIR) (Required is at least version "0.5.0")
-- Found WrapVulkanHeaders: /usr/include
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE
CMake Warning (dev) at CMakeLists.txt:24 (find_package):
  Policy CMP0167 is not set: The FindBoost module is removed.  Run "cmake
  --help-policy CMP0167" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.83.0/BoostConfig.cmake (found version "1.83.0")
-- Found Freetype: /usr/lib/x86_64-linux-gnu/libfreetype.so (found version "2.13.2")
-- Found Python3: /usr/bin/python3.12 (found version "3.12.3") found components: Interpreter Development Development.Module Development.Embed
-- Found SWIG: /usr/bin/swig4.0 (found suitable version "4.2.0", minimum required is "4") found components: python
CMake Error at CMakeLists.txt:1855 (add_subdirectory):
  The source directory

    /home/runner/work/LibreCAD/LibreCAD/externals/Catch2

  does not contain a CMakeLists.txt file.
Reply | Threaded
Open this post in threaded view
|

Re: new CMakeLists

emanuel
What I find strange is that this Cache2 test isn't working on the developer GitHub repository. I haven't changed anything in the external/cache2 directory. It works fine on the master repository. And there's no CMakeFiles.txt file there, is there?