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) 0055 if (TARGET Dwarf::Dwarf) 0056 set(HAVE_DWARF TRUE) 0057 endif() 0058 if (NOT OPCODES_FOUND) 0059 message(FATAL_ERROR "Binutils::Opcodes library not found") 0060 endif() 0061 find_package(Capstone) 0062 if (Capstone_FOUND) 0063 set(HAVE_CAPSTONE TRUE) 0064 endif() 0065 find_package(Gnuplot QUIET) 0066 set_package_properties(Gnuplot PROPERTIES 0067 DESCRIPTION "a command-line driven graphing utility" 0068 URL "https://www.gnuplot.info/" 0069 PURPOSE "Required for the Performance benchmark tool" 0070 TYPE RUNTIME 0071 ) 0072 0073 # config files 0074 configure_file(${CMAKE_SOURCE_DIR}/config-elf-dissector.h.cmake ${CMAKE_BINARY_DIR}/config-elf-dissector.h) 0075 configure_file(${CMAKE_SOURCE_DIR}/config-elf-dissector-version.h.cmake ${CMAKE_BINARY_DIR}/config-elf-dissector-version.h) 0076 0077 # build things 0078 include_directories( 0079 ${CMAKE_SOURCE_DIR}/src 0080 ${CMAKE_SOURCE_DIR}/src/3rdparty 0081 ${CMAKE_SOURCE_DIR}/src/lib 0082 ${CMAKE_BINARY_DIR} 0083 ) 0084 0085 add_subdirectory(src) 0086 add_subdirectory(tests) 0087 0088 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)