finalcut icon indicating copy to clipboard operation
finalcut copied to clipboard

cmake CPM building

Open russkel opened this issue 1 year ago • 0 comments

Hi, not really a feature request, just putting this here in case people want this.

After "installing" (https://github.com/cpm-cmake/CPM.cmake) the CPM.cmake file into your project:


include(cmake/CPM.cmake)

CPMAddPackage(
  NAME finalcut
  GIT_REPOSITORY https://github.com/gansm/finalcut.git
  GIT_TAG 0.9.1
  DOWNLOAD_ONLY YES
)

if (finalcut_ADDED)
  # finalcut has no CMake support, so we create our own target
  # needs libgpm-dev libncurses-dev
  include(FindPkgConfig)
#  pkg_check_modules(gpm gpm IMPORTED_TARGET) # looks like gpm does not have a .pc file on ubuntu
  pkg_check_modules(ncurses ncurses IMPORTED_TARGET)

  FILE(GLOB_RECURSE finalcut_sources ${finalcut_SOURCE_DIR}/final/*.cpp)
  add_library(finalcut STATIC ${finalcut_sources})

  target_link_libraries(finalcut
#          PkgConfig::gpm
          gpm
          PkgConfig::ncurses
  )
  target_include_directories(finalcut
          PUBLIC
          $<BUILD_INTERFACE:${finalcut_SOURCE_DIR}>
  )

  target_compile_definitions(finalcut PUBLIC COMPILE_FINAL_CUT F_HAVE_LIBGPM=1)
endif()

You can then simply use finalcut target to link to your executables.

russkel avatar Aug 17 '24 08:08 russkel