Warning, /sdk/elf-dissector/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 # CMake setup
0002 cmake_minimum_required(VERSION 3.1)
0003 project(elf-dissector VERSION 0.0.1)
0004 
0005 find_package(ECM 5.38 REQUIRED NO_MODULE)
0006 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
0007 
0008 include(KDECompilerSettings NO_POLICY_SCOPE)
0009 include(ECMSetupVersion)
0010 include(ECMPoQmTools)
0011 include(ECMInstallIcons)
0012 include(FeatureSummary)
0013 include(KDEInstallDirs)
0014 include(KDECMakeSettings)
0015 
0016 set(CMAKE_AUTOUIC on)
0017 set(CMAKE_AUTORCC on)
0018 set(CMAKE_CXX_VISIBILITY_PRESET "hidden")
0019 set(CMAKE_VISIBILITY_INLINES_HIDDEN on)
0020 set(CMAKE_C_STANDARD 11)
0021 set(CMAKE_CXX_STANDARD 14)
0022 enable_testing()
0023 
0024 # version setup
0025 set(PROJECT_VERSION_STRING "${PROJECT_VERSION}")
0026 if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
0027   find_package(Git)
0028   set_package_properties(Git PROPERTIES TYPE OPTIONAL PURPOSE "Determine exact build version.")
0029   if(GIT_FOUND)
0030     execute_process(
0031       COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
0032       WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
0033       OUTPUT_VARIABLE _git_revision
0034     )
0035     string(REGEX REPLACE "\n" "" _git_revision "${_git_revision}")
0036     set(PROJECT_VERSION_STRING "${PROJECT_VERSION_STRING} (revision: ${_git_revision})")
0037   endif()
0038 endif()
0039 
0040 # compiler setup
0041 if(CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME STREQUAL GNU)
0042   if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
0043     set(EXTRA_LINKER_FLAGS "-Wl,--hash-style=both")
0044     set(CMAKE_EXE_LINKER_FLAGS "${EXTRA_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}")
0045     set(CMAKE_SHARED_LINKER_FLAGS "${EXTRA_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}")
0046     set(CMAKE_MODULE_LINKER_FLAGS "${EXTRA_LINKER_FLAGS} ${CMAKE_MODULE_LINKER_FLAGS}")
0047   endif()
0048 endif()
0049 
0050 # dependencies
0051 find_package(Qt5 5.11 COMPONENTS Widgets Test NO_MODULE REQUIRED)
0052 
0053 find_package(Iberty REQUIRED)
0054 find_package(Dwarf REQUIRED)
0055 if (NOT OPCODES_FOUND)
0056     message(FATAL_ERROR "Binutils::Opcodes library not found")
0057 endif()
0058 find_package(Capstone)
0059 if (Capstone_FOUND)
0060     set(HAVE_CAPSTONE TRUE)
0061 endif()
0062 find_package(Gnuplot QUIET)
0063 set_package_properties(Gnuplot PROPERTIES
0064     DESCRIPTION "a command-line driven graphing utility"
0065     URL "https://www.gnuplot.info/"
0066     PURPOSE "Required for the Performance benchmark tool"
0067     TYPE RUNTIME
0068 )
0069 
0070 # config files
0071 configure_file(${CMAKE_SOURCE_DIR}/config-elf-dissector.h.cmake ${CMAKE_BINARY_DIR}/config-elf-dissector.h)
0072 configure_file(${CMAKE_SOURCE_DIR}/config-elf-dissector-version.h.cmake ${CMAKE_BINARY_DIR}/config-elf-dissector-version.h)
0073 
0074 # build things
0075 include_directories(
0076     ${CMAKE_SOURCE_DIR}/src
0077     ${CMAKE_SOURCE_DIR}/src/3rdparty
0078     ${CMAKE_SOURCE_DIR}/src/lib
0079     ${CMAKE_BINARY_DIR}
0080 )
0081 
0082 add_subdirectory(src)
0083 add_subdirectory(tests)
0084 
0085 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)