1 ###########################################################################
2 # Copyright 2015, 2016, 2017 IoT.bzh
4 # author: Fulup Ar Foll <fulup@iot.bzh>
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 ###########################################################################
21 set(PROJECT_NAME can-config-generator)
22 set(PROJECT_VERSION "1.5")
23 set(PROJECT_PRETTY_NAME "CAN configuration generator")
24 set(PROJECT_DESCRIPTION "Generator that convert JSON file following OpenXC spec to configuration-generated.cpp file for the low level CAN binding.")
25 set(PROJECT_URL "https://gerrit.automotivelinux.org/gerrit/src/low-level-can-generator")
26 set(PROJECT_ICON "icon.png")
27 set(PROJECT_AUTHOR "Loïc Collignon")
28 set(PROJECT_AUTHOR_MAIL "loic.collignon@iot.bzh")
29 set(PROJECT_ICON "icon.png")
30 set(PROJECT_LICENCE "APL2.0")
31 set(PROJECT_LANGUAGES,"CXX")
33 project(${PROJECT_NAME} VERSION ${PROJECT_VERSION} LANGUAGES ${PROJECT_LANGUAGES})
35 set(CMAKE_POSITION_INDEPENDENT_CODE ON)
38 if(NOT CMAKE_BUILD_TYPE)
39 set(CMAKE_BUILD_TYPE "RELEASE")
42 # Static constante definition
43 # -----------------------------
44 add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-std=c++11>
51 -Werror=implicit-function-declaration
55 -Werror=maybe-uninitialized
58 if(${CMAKE_BUILD_TYPE} STREQUAL "RELEASE")
59 add_compile_options(-O2 -D_FORTIFY_SOURCE=2)
60 elseif(${CMAKE_BUILD_TYPE} STREQUAL "DEBUG")
61 add_compile_options(-g -ggdb -O0)
64 # (BUG!!!) as PKG_CONFIG_PATH does not work [should be an env variable]
65 # ---------------------------------------------------------------------
66 # set(CMAKE_INSTALL_PREFIX $ENV{HOME}/opt)
67 set(CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX}/lib64/pkgconfig ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)
68 set(LD_LIBRARY_PATH ${CMAKE_INSTALL_PREFIX}/lib64 ${CMAKE_INSTALL_PREFIX}/lib)