*/}}

CMakeLists.txt 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. cmake_minimum_required(VERSION 3.1)
  2. project(OurMorphic)
  3. if(${ANDROID})
  4. include(android/apk_build.cmake)
  5. return()
  6. endif()
  7. if(${LAGUI_USE_GLES})
  8. add_definitions(-DLA_USE_GLES)
  9. endif()
  10. IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
  11. SET(CMAKE_INSTALL_PREFIX $ENV{HOME}/OurMorphic CACHE PATH "Where to install" FORCE)
  12. ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
  13. set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION ".")
  14. include (InstallRequiredSystemLibraries)
  15. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR})
  16. set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-no-pie -fpermissive")
  17. set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-no-pie -fpermissive")
  18. find_package(lagui REQUIRED)
  19. find_package(OpenCV REQUIRED)
  20. add_compile_options("$<$<C_COMPILER_ID:MSVC>:/std:c11>")
  21. add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
  22. add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
  23. add_definitions(-w)
  24. if(WIN32)
  25. endif()
  26. include_directories(
  27. ${LAGUI_INCLUDE_DIRS_ALL}
  28. ${OpenCV_INCLUDE_DIRS}
  29. )
  30. file(GLOB_RECURSE OurFiles
  31. ourmorphic.cxx
  32. )
  33. add_executable(OurMorphic ${OurFiles})
  34. target_link_options(OurMorphic PUBLIC "-Wl,--start-group")
  35. target_link_libraries(OurMorphic
  36. ${LAGUI_SHARED_LIBS}
  37. ${OpenCV_LIBS}
  38. )
  39. SET(INSTALL_EXTRAS README.md COPYING COPYING_CC_BY_NC)
  40. SET(LAGUI_FONT_CUSTOM_PATH $ENV{HOME}/.local/share/fonts/lagui CACHE STRING "Where to find lagui fonts")
  41. if (NOT DEFINED ${LAGUI_FONT_CUSTOM_PATH})
  42. set(LAGUI_FONT_CUSTOM_PATH $ENV{HOME}/.local/share/fonts/lagui)
  43. endif()
  44. set(INSTALL_PATH_BIN ".")
  45. if(${CMAKE_VERSION} VERSION_LESS "3.21")
  46. install(TARGETS OurMorphic DESTINATION ${INSTALL_PATH_BIN})
  47. else()
  48. install(TARGETS OurMorphic RUNTIME_DEPENDENCY_SET runtime_deps DESTINATION ${INSTALL_PATH_BIN})
  49. LIST(APPEND pre_exclude_regexes "api-ms-.*")
  50. LIST(APPEND pre_exclude_regexes "ext-ms-.*")
  51. list(APPEND post_exclude_regexes ".*[Ww][Ii][Nn][Dd][Oo][Ww][Ss][\\/][Ss][Yy][Ss][Tt][Ee][Mm]32.*")
  52. list(APPEND post_exclude_regexes ".*[Ww][Ii][Nn][Dd][Oo][Ww][Ss][\\/][Ss][Yy][Ss][Ww][Oo][Ww]64.*")
  53. LIST(APPEND post_exclude_regexes "^/lib" "^/usr" "^/bin")
  54. install(RUNTIME_DEPENDENCY_SET runtime_deps
  55. PRE_EXCLUDE_REGEXES ${pre_exclude_regexes}
  56. POST_EXCLUDE_REGEXES ${post_exclude_regexes}
  57. DESTINATION ${INSTALL_PATH_BIN}
  58. )
  59. endif()
  60. install(DIRECTORY "${LAGUI_FONT_CUSTOM_PATH}/" DESTINATION ${INSTALL_PATH_BIN}/fonts PATTERN "*.*")
  61. install(FILES ${INSTALL_EXTRAS} DESTINATION ${INSTALL_PATH_BIN})