Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor CMake #3104

Merged
merged 2 commits into from
Jun 20, 2023
Merged

Conversation

OrkunTokdemir
Copy link
Contributor

@OrkunTokdemir OrkunTokdemir commented Feb 20, 2023

CMake uses absolute paths to generate icons for MacOS build. It fails on build commands different than the commands in README.md file.

Example output

> rm -rf build &&  cmake -S . -B build    -DQt5_DIR=$(brew --prefix qt5)/lib/cmake/Qt5
-- The CXX compiler identification is AppleClang 14.0.0.14000029
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Setting build type to 'RelWithDebInfo' as none was specified.
CMake Warning at cmake/Cache.cmake:28 (message):
  ccache is enabled but was not found.  Not using it
Call Stack (most recent call first):
  CMakeLists.txt:84 (include)


-- Performing Test Wall_FLAG_SUPPORTED
-- Performing Test Wall_FLAG_SUPPORTED - Success
-- Performing Test pedantic_FLAG_SUPPORTED
-- Performing Test pedantic_FLAG_SUPPORTED - Success
-- Performing Test Wextra_FLAG_SUPPORTED
-- Performing Test Wextra_FLAG_SUPPORTED - Success
Flameshot predefined color palette large: false
-- Found Git: /usr/bin/git (found version "2.37.1 (Apple Git-137.1)") 
git found: /usr/bin/git in version     2.37.1 (Apple Git-137.1)
FLAMESHOT_GIT_HASH: 3ededae5
-- Configuring done
CMake Error at src/CMakeLists.txt:61 (add_executable):
  Cannot find source file:

    /Users/orkun/playground/opensource_projects/forked/flameshot/build/flameshot.icns

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
  .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc


-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

Solution

CMAKE_BINARY_DIR path was used in the generation of MacOS flameshot.icns

Also 'make' commands were changed with 'cmake' counterparts.

Changed Files
README.md
src/CMakeLists.txt
.github/workflows/Linux-pack.yml
.github/workflows/MacOS-pack.yml
appveyor.yml

@mmahmoudian
Copy link
Member

Thanks for the PR 👍.

I ran the Github Actions to see if this causes any issue. The PR looks clean. There are some parts that are macOS-specific (e.g iconutil) and I don't know much about it, but according to High Resolution Guidelines for OS X and Mozilla's documentation for Updating macOS Icons, your PR makes sense as far as I understand.

I will try to test this on a mac later and see if icons look alright.

@mmahmoudian
Copy link
Member

Also the .github/workflows/MacOS-pack.yml should be updated I guess

@OrkunTokdemir
Copy link
Contributor Author

OrkunTokdemir commented Feb 22, 2023

Hi @mmahmoudian

Thank you for your comments. I updated a couple of .yml files that use make to make those commands more generic and changed them with the cmake counterparts. Could you please check it when you have time?

@OrkunTokdemir OrkunTokdemir marked this pull request as ready for review February 22, 2023 16:10
@mmahmoudian mmahmoudian merged commit 236534b into flameshot-org:master Jun 20, 2023
panpuchkov pushed a commit to namecheap/flameshot that referenced this pull request Dec 22, 2023
* Refactor CMake

* Update README.md

(cherry picked from commit 236534b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants