Ignore:
Timestamp:
Oct 4, 2016, 7:55:11 AM (3 years ago)
Author:
cameron
Message:

Simplify build to allow easier determination/selection of LLVM library

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/CMakeLists.txt

    r5172 r5178  
    1 cmake_minimum_required (VERSION 2.8)
     1cmake_minimum_required (VERSION 3.2.0)
    22
    33project (icgrep)
     
    66# The version number.
    77set (icgrep_VERSION_MAJOR 1)
    8 set (icgrep_VERSION_MINOR 5)
     8set (icgrep_VERSION_MINOR 6)
    99
    1010option(ENABLE_MULTIPLEXING "Compiling the Multiplexing Module")
     
    1212option(PRINT_TIMING_INFORMATION "Write compilation and execution timing information to standard error stream")
    1313
    14 # configure a header file to pass some of the CMake settings
    15 # to the source code
    16 #configure_file (
    17 #  "${PROJECT_SOURCE_DIR}/icgrepconfig.h.in"
    18 #  "${PROJECT_BINARY_DIR}/icgrepconfig.h"
    19 #  )
    20 
    21 # LLVM set up
    22 #
    23 # A convenience variable:
    24 set(LLVM_ROOT "../libllvm" CACHE PATH "Root of LLVM install.")
    25 
    26 # A bit of a sanity check:
    27 if( NOT EXISTS ${LLVM_ROOT}/include/llvm )
    28 message(FATAL_ERROR "LLVM_ROOT (${LLVM_ROOT}) is not a valid LLVM install")
    29 endif()
    30 
    31 # We incorporate the CMake features provided by LLVM:
    32 set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${LLVM_ROOT}/share/llvm/cmake;${CMAKE_CURRENT_SOURCE_DIR}/cmake")
    33 
    34 include(LLVMConfig)
     14find_package(LLVM REQUIRED CONFIG)
     15
     16message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
     17message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
     18
    3519
    3620# Now set the header and library paths:
     
    5539set(LLVM_ALL_TARGETS AArch64 AMDGPU ARM BPF CppBackend Hexagon Mips MSP430 NVPTX PowerPC Sparc SystemZ X86 XCore)
    5640llvm_map_components_to_libnames(REQ_LLVM_LIBRARIES ${LLVM_ALL_TARGETS} mcjit native IRReader Linker)
    57 
    58 message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION} in ${LLVM_ROOT_DIR}")
    5941
    6042# Check if boost has been installed on this system.
Note: See TracChangeset for help on using the changeset viewer.