summaryrefslogtreecommitdiffstats
path: root/can-config-generator/CMakeLists.txt
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-04-11 17:55:13 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-04-11 17:55:13 +0200
commit511b3c469ead67be27d2d742699a23be28666b24 (patch)
tree252da80f9a8e06833924f41f0b375f281a05990e /can-config-generator/CMakeLists.txt
parenta58d40b5ae336a54408201963b065ee049b43acd (diff)
Adapt CMakeFile including can-config-generator tool.
Change-Id: I154d3976c0ab91ded20c07c44a1a586a98f3057f Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'can-config-generator/CMakeLists.txt')
-rw-r--r--can-config-generator/CMakeLists.txt80
1 files changed, 53 insertions, 27 deletions
diff --git a/can-config-generator/CMakeLists.txt b/can-config-generator/CMakeLists.txt
index 8eb40d55..5baf632c 100644
--- a/can-config-generator/CMakeLists.txt
+++ b/can-config-generator/CMakeLists.txt
@@ -1,27 +1,53 @@
-cmake_minimum_required(VERSION 3.3)
-project(can-config-generator)
-
-if (CMAKE_VERSION VERSION_LESS "3.1")
- if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
- set (CMAKE_CXX_FLAGS "--std=gnu++11 ${CMAKE_CXX_FLAGS}")
- elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
- set (CMAKE_CXX_FLAGS "--std=c++11 ${CMAKE_CXX_FLAGS}")
- endif ()
-else ()
- set (CMAKE_CXX_STANDARD 11)
-endif ()
-
-include_directories(SYSTEM 3rdparty/json)
-
-add_executable(can-config-generator
- src/main.cpp
- src/openxc/message_set.cpp
- src/openxc/can_bus.cpp
- src/openxc/can_message.cpp
- src/openxc/command.cpp
- src/openxc/diagnostic_message.cpp
- src/openxc/mapping.cpp
- src/openxc/signal.cpp)
-
-target_link_libraries(can-config-generator)
-target_compile_features(can-config-generator PRIVATE cxx_range_for cxx_constexpr cxx_nullptr)
+###########################################################################
+# Copyright 2015, 2016, 2017 IoT.bzh
+#
+# author: Fulup Ar Foll <fulup@iot.bzh>
+# contrib: Romain Forlot <romain.forlot@iot.bzh>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+###########################################################################
+
+# Add target to project dependency list
+PROJECT_TARGET_ADD(can-config-generator)
+
+ # Define project Targets
+ fill_include_dir(${PROJECT_LIBDIR})
+ file(GLOB filelist "${PROJECT_LIBDIR}/*")
+ foreach(filename ${filelist})
+ if(IS_DIRECTORY ${filename})
+ include_directories(${filename})
+ STRING(REGEX REPLACE "^.*\/(.*)$" "\\1" shortname ${filename})
+ find_source_files(${PROJECT_LIBDIR})
+ add_library(${shortname} STATIC ${sources_files})
+ endif(IS_DIRECTORY ${filename})
+ endforeach()
+
+ add_executable(can-config-generator
+ src/main.cpp
+ src/openxc/message_set.cpp
+ src/openxc/can_bus.cpp
+ src/openxc/can_message.cpp
+ src/openxc/command.cpp
+ src/openxc/diagnostic_message.cpp
+ src/openxc/mapping.cpp
+ src/openxc/signal.cpp)
+
+ # Library dependencies (include updates automatically)
+ TARGET_LINK_LIBRARIES(can-config-generator
+ ${EXTRA_LINK_LIBRARIES}
+ ${link_libraries}
+ )
+
+ # installation directory
+ INSTALL(TARGETS can-config-generator
+ RUNTIME DESTINATION ${BINDINGS_INSTALL_DIR})