#Build for Release done but faild
41 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
cmake_minimum_required(VERSION 3.10)
project(Lizon)
find_package(wxWidgets REQUIRED COMPONENTS core base)
include(${wxWidgets_USE_FILE})
add_executable(Lizon mframe.cpp main.cpp)
target_link_libraries(Lizon ${wxWidgets_LIBRARIES})```
.
├── assets
│ ├── cpu.png
│ ├── dif1.png
│ ├── dif2.png
│ ├── dif3.png
│ ├── dif4.png
│ ├── icon.ico
│ ├── konsole.png
│ ├── mic1.png
│ ├── music.png
│ ├── ram.png
│ ├── temp.png
│ └── vscode.png
├── build
│ ├── CMakeCache.txt
│ ├── CMakeFiles
│ ├── cmake_install.cmake
│ ├── compile_commands.json
│ ├── Lizon
│ └── Makefile
├── CMakeLists.txt
├── main.cpp
├── main.h
├── mframe.cpp
├── mframe.h
└── README
You need two commands to build. First yours, then cmake --build . -j8
You need to run two commands
You already ran one, then you need to run the one I gave you
I run it and all it does is to do a build
build for release
I don t want a normal build
I need to create a .exe file for my program
.exe is created regardless of it being release or debug build
You selected the release build in the first command. Then the second commands makes whatever build you selected
yes but for release because I have png files in the project and if I ship it my program will not find my png files
it doesn't work, i don t know why?
Hmm
You could always copy them manually
Or make a script that copies them and zips the executable + the pngs
The "official" way of doing this is adding -DCMAKE_INSTALL_PREFIX=some_dir to the first command, and running cmake --install . after the last command. Then it should copy everything to that directory, which you can then zip
But you might need to list things that need to be copied in your CMakeLists.txt
ok it is ok but I have this path "../assets/icon.ico" and there wil be an error
so I think that I can solve that
Simple, don't use paths like that 😛
Get a location of the executable itself (which is done in a platform-dependent way, sadly), and load images relative to that
do you add your lib into the enviroment path rigitly?
you can try to use "include_libraries"
yes I know
(which is done in a platform-dependent way, sadly) what you mean?
I tried but not succesful
I create a dist folder for release
├── bin
│ └── Lizon
└── share
├── cpu.png
├── dif1.png
├── dif2.png
├── dif3.png
├── dif4.png
├── icon.ico
├── konsole.png
├── mic1.png
├── music.png
├── ram.png
├── temp.png
└── vscode.png
but my app did't find tha pngs
What graphics API do you use, if any?
You need to get the location of the executable, to load images relative to that
Google how to do that on your OS