libkysdk-system/CMakeLists.txt

53 lines
1.8 KiB
CMake
Raw Permalink Normal View History

2022-06-13 16:13:21 +08:00
cmake_minimum_required(VERSION 3.1.3)
project(kysdk-system)
set (CMAKE_SKIP_RPATH ON)
2022-06-13 16:13:21 +08:00
include(CMakePackageConfigHelpers)
include(FindPkgConfig)
include (GNUInstallDirs)
2022-06-13 16:13:21 +08:00
pkg_check_modules(PKGS REQUIRED
dbus-1
glib-2.0
dbus-glib-1
libudev
)
include_directories(${PKGS_INCLUDE_DIRS})
include_directories("${PROJECT_BINARY_DIR}")
include_directories("/usr/include/kysdk/kysdk-base")
# link_directories("/usr/lib/kysdk/kysdk-base")
# link_directories("/usr/lib/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux-gnu/")
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "armv8l")
link_directories("/usr/lib/arm-linux-gnueabihf/")
elseif(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "mips64")
link_directories("/usr/lib/mips64el-linux-gnuabi64/")
elseif(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "i686")
link_directories("/usr/lib/i386-linux-gnu/")
else()
link_directories("/usr/lib/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux-gnu/")
endif()
2022-06-13 16:13:21 +08:00
set (CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_BUILD_TYPE Debug)
message("Build Type: ${CMAKE_BUILD_TYPE}")
set (CMAKE_INSTALL_PREFIX /usr)
# set (LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux-gnu/)
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "armv8l")
set (LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib/arm-linux-gnueabihf/)
elseif(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "mips64")
set (LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib/mips64el-linux-gnuabi64/)
elseif(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "i686")
set (LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib/i386-linux-gnu/)
else()
set (LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib/${CMAKE_HOST_SYSTEM_PROCESSOR}-linux-gnu/)
endif()
2022-06-13 16:13:21 +08:00
set (EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
add_subdirectory(src)