cmake_minimum_required(VERSION 3.1) project(OurMorphic) if(${ANDROID}) include(android/apk_build.cmake) return() endif() if(${LAGUI_USE_GLES}) add_definitions(-DLA_USE_GLES) endif() IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) SET(CMAKE_INSTALL_PREFIX $ENV{HOME}/OurMorphic CACHE PATH "Where to install" FORCE) ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION ".") include (InstallRequiredSystemLibraries) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}) set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-no-pie -fpermissive") set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-no-pie -fpermissive") find_package(lagui REQUIRED) find_package(OpenCV REQUIRED) add_compile_options("$<$:/std:c11>") add_compile_options("$<$:/utf-8>") add_compile_options("$<$:/utf-8>") add_definitions(-w) if(WIN32) endif() include_directories( ${LAGUI_INCLUDE_DIRS_ALL} ${OpenCV_INCLUDE_DIRS} ) file(GLOB_RECURSE OurFiles ourmorphic.cxx ) add_executable(OurMorphic ${OurFiles}) target_link_options(OurMorphic PUBLIC "-Wl,--start-group") target_link_libraries(OurMorphic ${LAGUI_SHARED_LIBS} ${OpenCV_LIBS} ) SET(INSTALL_EXTRAS README.md COPYING COPYING_CC_BY_NC) SET(LAGUI_FONT_CUSTOM_PATH $ENV{HOME}/.local/share/fonts/lagui CACHE STRING "Where to find lagui fonts") if (NOT DEFINED ${LAGUI_FONT_CUSTOM_PATH}) set(LAGUI_FONT_CUSTOM_PATH $ENV{HOME}/.local/share/fonts/lagui) endif() set(INSTALL_PATH_BIN ".") if(${CMAKE_VERSION} VERSION_LESS "3.21") install(TARGETS OurMorphic DESTINATION ${INSTALL_PATH_BIN}) else() install(TARGETS OurMorphic RUNTIME_DEPENDENCY_SET runtime_deps DESTINATION ${INSTALL_PATH_BIN}) LIST(APPEND pre_exclude_regexes "api-ms-.*") LIST(APPEND pre_exclude_regexes "ext-ms-.*") list(APPEND post_exclude_regexes ".*[Ww][Ii][Nn][Dd][Oo][Ww][Ss][\\/][Ss][Yy][Ss][Tt][Ee][Mm]32.*") list(APPEND post_exclude_regexes ".*[Ww][Ii][Nn][Dd][Oo][Ww][Ss][\\/][Ss][Yy][Ss][Ww][Oo][Ww]64.*") LIST(APPEND post_exclude_regexes "^/lib" "^/usr" "^/bin") install(RUNTIME_DEPENDENCY_SET runtime_deps PRE_EXCLUDE_REGEXES ${pre_exclude_regexes} POST_EXCLUDE_REGEXES ${post_exclude_regexes} DESTINATION ${INSTALL_PATH_BIN} ) endif() install(DIRECTORY "${LAGUI_FONT_CUSTOM_PATH}/" DESTINATION ${INSTALL_PATH_BIN}/fonts PATTERN "*.*") install(FILES ${INSTALL_EXTRAS} DESTINATION ${INSTALL_PATH_BIN})