Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

Alpha's Project exporter - added "working" CMAKE POC

<< < (5/5)

ollydbg:

--- Quote from: AndrewCot on October 17, 2022, 10:59:15 am ---I have successfully used the new Export plugin CMAKE facility to rebuild a working C::B setup using CMAKE from the source in the https://github.com/acotty/CodeBlocks_Unofficial_Testing repo.
The following are the simple steps I use to build C::B is using CMAKE

* Build C::B from the repo and install it
* Open the new C::B and load the CodeBlocks_Windows.workspace from the repo
* Select the File->Export project->CMakeLists.txt (WIP) menu item
* Create a src\Cmake_build directory
* Open a command prompt or a bash shell and change into the src\Cmake_build directory
* run the following two command to do the build:    cmake  -DCMAKE_BUILD_TYPE=Release ..
    cmake --build .
If you are using a command prompt you need to add the directory where cmake.exe to the path. You may find that you need to install ninja if you have not already installed it as it is the default cmake build system

--- End quote ---

Good work.

My silly question is: does the generated CMakeLists.txt has many hard-coded paths in it? If not, can you just add those CMakeLists.txt to your git repo, so people can use it directly? I mean just clone your git repo, and run the cmake to build the whole C::B workspace.

Thanks.

AndrewCot:

--- Quote from: ollydbg on October 18, 2022, 05:00:50 pm ---My silly question is: does the generated CMakeLists.txt has many hard-coded paths in it? If not, can you just add those CMakeLists.txt to your git repo, so people can use it directly? I mean just clone your git repo, and run the cmake to build the whole C::B workspace.

--- End quote ---
Unfortunately the answer is yes. I need to do more work on the paths so that eventually (hopefully) remove all the hard coded paths. I am finding that CMake has so many options and it takes a while to figure out which option(s) to use to get the desired result as the CMake manual is not very intuitive for CMake noobs like me.

sodev:
The CMake manual is not really useful for learning CMake, but it's a great reference once you know CMake. To start learning CMake, forget about policies, use the latest available version and don't care about anything before. A really good resource to learn Modern CMake is this book: Professional CMake: A Practical Guide.

AndrewCot:
Update the code to remove the hard coded paths, but I will not be including the CMakeLists.txt and other include CMakeLists*.txt files in the GIT repo as then it just adds to the time it takes to keep everything in sync (it's bad enough with the C::B official code having so many different project files that need to be updated for a single change......).

Navigation

[0] Message Index

[*] Previous page

Go to full version