Skip to content

Commit 1b3200d

Browse files
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)
1 parent 97d3173 commit 1b3200d

File tree

4 files changed

+26
-20
lines changed

4 files changed

+26
-20
lines changed

.travis.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ elif [ "$TRAVIS_OS_NAME" == "linux" ]; then
3333
mkdir -p build/Debug && cd build/Debug
3434
echo "-DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/install"
3535
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/install $DIR
36-
make && make package && cd -
36+
make && cd -
3737

3838
echo "--> Building Release..."
3939
mkdir -p build/Release && cd build/Release
@@ -48,7 +48,7 @@ elif [ "$TRAVIS_OS_NAME" == "osx" ]; then
4848
mkdir -p build/Debug && cd build/Debug
4949
echo "-DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/install"
5050
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/install $DIR
51-
make && make package && cd -
51+
make && cd -
5252

5353
echo "--> Building Release..."
5454
mkdir -p build/Release && cd build/Release
@@ -61,7 +61,7 @@ else # local test-build
6161
mkdir -p build/Debug && cd build/Debug
6262
echo "-DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/install"
6363
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/install ../../
64-
make && make package && cd -
64+
make && cd -
6565

6666
echo "--> Building Release..."
6767
mkdir -p build/Release && cd build/Release

CMakeLists.txt

+21-15
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ project(stlink C)
1818
set(PROJECT_DESCRIPTION "Open source version of the STMicroelectronics ST-LINK Tools")
1919
include(GNUInstallDirs) # Define GNU standard installation directories
2020

21-
set(STLINK_UDEV_RULES_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}/udev/rules.d" CACHE PATH "udev rules directory")
22-
option(STLINK_INSTALL_UDEV_RULES "Install udev rules files" ON)
23-
24-
set(STLINK_MODPROBED_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}/modprobe.d" CACHE PATH "modprobe.d directory")
25-
option(STLINK_INSTALL_MODPROBE_CONF "Install modprobe conf files" ON)
26-
27-
option(STLINK_GENERATE_MANPAGES "Generate manpages with pandoc" OFF)
28-
2921
## Determine project version
3022
include(${CMAKE_MODULE_PATH}/get_version.cmake)
3123

@@ -271,20 +263,32 @@ else ()
271263
target_link_libraries(st-util ${STLINK_LIB_SHARED} ${SSP_LIB})
272264
endif ()
273265

266+
install(TARGETS st-flash DESTINATION bin)
267+
install(TARGETS st-info DESTINATION bin)
268+
install(TARGETS st-util DESTINATION bin)
269+
270+
271+
###
272+
# udev and modprobe.d configuration
273+
###
274+
274275
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
276+
## modprobe.d rules
277+
set(STLINK_MODPROBED_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}/modprobe.d" CACHE PATH "modprobe.d directory")
278+
option(STLINK_INSTALL_MODPROBE_CONF "Install modprobe conf files" ON)
275279
if (STLINK_INSTALL_MODPROBE_CONF)
276-
install(FILES etc/modprobe.d/stlink_v1.conf DESTINATION ${STLINK_MODPROBED_DIR}/)
280+
install(FILES ${CMAKE_SOURCE_DIR}/etc/modprobe.d/stlink_v1.conf DESTINATION ${STLINK_MODPROBED_DIR}/)
277281
endif ()
282+
283+
## udev rules
284+
set(STLINK_UDEV_RULES_DIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}/udev/rules.d" CACHE PATH "udev rules directory")
285+
option(STLINK_INSTALL_UDEV_RULES "Install udev rules files" ON)
278286
if (STLINK_INSTALL_UDEV_RULES)
279-
file(GLOB RULES_FILES etc/udev/rules.d/*.rules)
287+
file(GLOB RULES_FILES ${CMAKE_SOURCE_DIR}/etc/udev/rules.d/*.rules)
280288
install(FILES ${RULES_FILES} DESTINATION ${STLINK_UDEV_RULES_DIR}/)
281289
endif ()
282290
endif ()
283291

284-
install(TARGETS st-flash DESTINATION bin)
285-
install(TARGETS st-info DESTINATION bin)
286-
install(TARGETS st-util DESTINATION bin)
287-
288292

289293
###
290294
# Additional build tasks
@@ -297,9 +301,11 @@ add_subdirectory(include) # contains subordinate CMakeLists for version config a
297301

298302
add_subdirectory(src/stlink-gui) # contains subordinate CMakeLists to build GUI
299303
add_subdirectory(tests) # contains subordinate CMakeLists to build test executables
300-
add_subdirectory(doc/man) # contains subordinate CMakeLists to generate manpages
301304
add_subdirectory(cmake/packaging) # contains subordinate CMakeLists to build packages
302305

306+
option(STLINK_GENERATE_MANPAGES "Generate manpages with pandoc" OFF)
307+
add_subdirectory(doc/man) # contains subordinate CMakeLists to generate manpages
308+
303309

304310
###
305311
# Uninstall target

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ build/Debug:
5555

5656
build/Release:
5757
@mkdir -p $@
58-
@cd $@ && cmake -DCMAKE_BUILD_TYPE=Release $(CMAKEFLAGS) -Wno-dev ../../
58+
@cd $@ && cmake -DCMAKE_BUILD_TYPE=Release $(CMAKEFLAGS) ../../
5959

6060
clean:
6161
@echo "[CLEAN]"

doc/man/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ foreach (manpage ${MANPAGES})
3030
endif ()
3131

3232
if (f AND NOT WIN32)
33-
install(FILES ${f} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1)
33+
install(FILES ${f} DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
3434
unset(f)
3535
endif ()
3636
endforeach ()

0 commit comments

Comments
 (0)