kopia lustrzana https://github.com/stlink-org/stlink
Updated build settings
- Removed unneeded commands in travis.sh - Removed -Wno-dev flag in Release target - cmake: Grouped udev and modprobe.d config - rpm package now relocatable (CPackRPM)pull/960/head
rodzic
97d3173f48
commit
1b3200d5bc
|
@ -33,7 +33,7 @@ elif [ "$TRAVIS_OS_NAME" == "linux" ]; then
|
|||
mkdir -p build/Debug && cd build/Debug
|
||||
echo "-DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/install"
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/install $DIR
|
||||
make && make package && cd -
|
||||
make && cd -
|
||||
|
||||
echo "--> Building Release..."
|
||||
mkdir -p build/Release && cd build/Release
|
||||
|
@ -48,7 +48,7 @@ elif [ "$TRAVIS_OS_NAME" == "osx" ]; then
|
|||
mkdir -p build/Debug && cd build/Debug
|
||||
echo "-DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/install"
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/install $DIR
|
||||
make && make package && cd -
|
||||
make && cd -
|
||||
|
||||
echo "--> Building Release..."
|
||||
mkdir -p build/Release && cd build/Release
|
||||
|
@ -61,7 +61,7 @@ else # local test-build
|
|||
mkdir -p build/Debug && cd build/Debug
|
||||
echo "-DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/install"
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/install ../../
|
||||
make && make package && cd -
|
||||
make && cd -
|
||||
|
||||
echo "--> Building Release..."
|
||||
mkdir -p build/Release && cd build/Release
|
||||
|
|
|
@ -18,14 +18,6 @@ project(stlink C)
|
|||
set(PROJECT_DESCRIPTION "Open source version of the STMicroelectronics ST-LINK Tools")
|
||||
include(GNUInstallDirs) # Define GNU standard installation directories
|
||||
|
||||
set(STLINK_UDEV_RULES_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}/udev/rules.d" CACHE PATH "udev rules directory")
|
||||
option(STLINK_INSTALL_UDEV_RULES "Install udev rules files" ON)
|
||||
|
||||
set(STLINK_MODPROBED_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}/modprobe.d" CACHE PATH "modprobe.d directory")
|
||||
option(STLINK_INSTALL_MODPROBE_CONF "Install modprobe conf files" ON)
|
||||
|
||||
option(STLINK_GENERATE_MANPAGES "Generate manpages with pandoc" OFF)
|
||||
|
||||
## Determine project version
|
||||
include(${CMAKE_MODULE_PATH}/get_version.cmake)
|
||||
|
||||
|
@ -271,21 +263,33 @@ else ()
|
|||
target_link_libraries(st-util ${STLINK_LIB_SHARED} ${SSP_LIB})
|
||||
endif ()
|
||||
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
if (STLINK_INSTALL_MODPROBE_CONF)
|
||||
install(FILES etc/modprobe.d/stlink_v1.conf DESTINATION ${STLINK_MODPROBED_DIR}/)
|
||||
endif ()
|
||||
if (STLINK_INSTALL_UDEV_RULES)
|
||||
file(GLOB RULES_FILES etc/udev/rules.d/*.rules)
|
||||
install(FILES ${RULES_FILES} DESTINATION ${STLINK_UDEV_RULES_DIR}/)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
install(TARGETS st-flash DESTINATION bin)
|
||||
install(TARGETS st-info DESTINATION bin)
|
||||
install(TARGETS st-util DESTINATION bin)
|
||||
|
||||
|
||||
###
|
||||
# udev and modprobe.d configuration
|
||||
###
|
||||
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
## modprobe.d rules
|
||||
set(STLINK_MODPROBED_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}/modprobe.d" CACHE PATH "modprobe.d directory")
|
||||
option(STLINK_INSTALL_MODPROBE_CONF "Install modprobe conf files" ON)
|
||||
if (STLINK_INSTALL_MODPROBE_CONF)
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/etc/modprobe.d/stlink_v1.conf DESTINATION ${STLINK_MODPROBED_DIR}/)
|
||||
endif ()
|
||||
|
||||
## udev rules
|
||||
set(STLINK_UDEV_RULES_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}/udev/rules.d" CACHE PATH "udev rules directory")
|
||||
option(STLINK_INSTALL_UDEV_RULES "Install udev rules files" ON)
|
||||
if (STLINK_INSTALL_UDEV_RULES)
|
||||
file(GLOB RULES_FILES ${CMAKE_SOURCE_DIR}/etc/udev/rules.d/*.rules)
|
||||
install(FILES ${RULES_FILES} DESTINATION ${STLINK_UDEV_RULES_DIR}/)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
|
||||
###
|
||||
# Additional build tasks
|
||||
###
|
||||
|
@ -297,9 +301,11 @@ add_subdirectory(include) # contains subordinate CMakeLists for version config a
|
|||
|
||||
add_subdirectory(src/stlink-gui) # contains subordinate CMakeLists to build GUI
|
||||
add_subdirectory(tests) # contains subordinate CMakeLists to build test executables
|
||||
add_subdirectory(doc/man) # contains subordinate CMakeLists to generate manpages
|
||||
add_subdirectory(cmake/packaging) # contains subordinate CMakeLists to build packages
|
||||
|
||||
option(STLINK_GENERATE_MANPAGES "Generate manpages with pandoc" OFF)
|
||||
add_subdirectory(doc/man) # contains subordinate CMakeLists to generate manpages
|
||||
|
||||
|
||||
###
|
||||
# Uninstall target
|
||||
|
|
2
Makefile
2
Makefile
|
@ -55,7 +55,7 @@ build/Debug:
|
|||
|
||||
build/Release:
|
||||
@mkdir -p $@
|
||||
@cd $@ && cmake -DCMAKE_BUILD_TYPE=Release $(CMAKEFLAGS) -Wno-dev ../../
|
||||
@cd $@ && cmake -DCMAKE_BUILD_TYPE=Release $(CMAKEFLAGS) ../../
|
||||
|
||||
clean:
|
||||
@echo "[CLEAN]"
|
||||
|
|
|
@ -30,7 +30,7 @@ foreach (manpage ${MANPAGES})
|
|||
endif ()
|
||||
|
||||
if (f AND NOT WIN32)
|
||||
install(FILES ${f} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1)
|
||||
install(FILES ${f} DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
||||
unset(f)
|
||||
endif ()
|
||||
endforeach ()
|
||||
|
|
Ładowanie…
Reference in New Issue