MAP: Correctly print ea-bits-len in map commands.
[vpp.git] / extras / japi / CMakeLists.txt
1 # Copyright (c) 2018 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
15
16 project(japi VERSION 18.10)
17
18 include(CheckCCompilerFlag)
19
20 if(CMAKE_SYSTEM_PROCESSOR MATCHES "amd64.*|x86_64.*|AMD64.*")
21   set(CMAKE_C_FLAGS "-march=corei7 -mtune=corei7-avx ${CMAKE_C_FLAGS}")
22 elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*)")
23   set(CMAKE_C_FLAGS "-march=armv8-a+crc ${CMAKE_C_FLAGS}")
24 endif()
25
26 check_c_compiler_flag("-Wno-address-of-packed-member" compiler_flag_no_address_of_packed_member)
27 if (compiler_flag_no_address_of_packed_member)
28   add_definitions(-Wno-address-of-packed-member)
29 endif()
30
31 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
32 set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
33 set(CMAKE_INSTALL_MESSAGE NEVER)
34
35 find_package(Threads REQUIRED)
36 find_package(Java 1.8 REQUIRED COMPONENTS Development)
37 find_package(JNI REQUIRED)
38
39 message("Found java headers ${JNI_INCLUDE_DIRS}")
40 message("Found javac at: " ${Java_JAVAC_EXECUTABLE})
41
42 add_subdirectory(java)