2020-04-18 14:45:05 +00:00
|
|
|
###
|
|
|
|
# General cmake settings
|
|
|
|
###
|
|
|
|
|
2020-04-05 12:25:45 +00:00
|
|
|
cmake_minimum_required(VERSION 3.4.2)
|
2020-04-16 19:00:30 +00:00
|
|
|
cmake_policy(SET CMP0042 NEW)
|
|
|
|
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_SOURCE_DIR}/cmake/modules")
|
2020-04-18 14:45:05 +00:00
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
2020-04-24 13:01:28 +00:00
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
2020-04-18 14:45:05 +00:00
|
|
|
|
|
|
|
###
|
|
|
|
# General project settings
|
|
|
|
###
|
|
|
|
|
2016-07-09 20:07:50 +00:00
|
|
|
project(stlink C)
|
2020-04-05 12:25:45 +00:00
|
|
|
set(PROJECT_DESCRIPTION "Open source version of the STMicroelectronics ST-LINK Tools")
|
2020-04-21 12:49:25 +00:00
|
|
|
include(GNUInstallDirs) # Define GNU standard installation directories
|
2020-04-16 19:00:30 +00:00
|
|
|
|
2020-04-24 13:01:28 +00:00
|
|
|
## Determine project version
|
2020-04-18 14:45:05 +00:00
|
|
|
include(${CMAKE_MODULE_PATH}/get_version.cmake)
|
|
|
|
|
2020-04-24 13:01:28 +00:00
|
|
|
## Set C build flags
|
2020-04-18 14:45:05 +00:00
|
|
|
if (NOT MSVC)
|
|
|
|
include(${CMAKE_MODULE_PATH}/c_flags.cmake)
|
|
|
|
else ()
|
|
|
|
message(STATUS "MSVC C Flags override to /MT")
|
|
|
|
set(CMAKE_C_FLAGS_DEBUG_INIT "/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1")
|
|
|
|
set(CMAKE_C_FLAGS_MINSIZEREL_INIT "/MT /O1 /Ob1 /D NDEBUG")
|
|
|
|
set(CMAKE_C_FLAGS_RELEASE_INIT "/MT /O2 /Ob2 /D NDEBUG")
|
|
|
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MT /Zi /O2 /Ob1 /D NDEBUG")
|
|
|
|
endif ()
|
|
|
|
|
2020-05-19 09:28:35 +00:00
|
|
|
## Set installation directories for header files ### TODO: Clean this up...
|
2020-04-05 12:25:45 +00:00
|
|
|
if (IS_DIRECTORY ${INCLUDE_INSTALL_DIR})
|
2018-04-16 18:54:03 +00:00
|
|
|
set(INCLUDE_INSTALL_DIR ${INCLUDE_INSTALL_DIR} CACHE PATH "Main include directory")
|
2020-04-12 16:26:46 +00:00
|
|
|
set(STLINK_INCLUDE_PATH "${INCLUDE_INSTALL_DIR}")
|
2020-04-05 12:25:45 +00:00
|
|
|
else ()
|
2018-04-16 18:54:03 +00:00
|
|
|
set(INCLUDE_INSTALL_DIR "include" CACHE PATH "Main include directory")
|
|
|
|
set(STLINK_INCLUDE_PATH "${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR}")
|
2020-04-05 12:25:45 +00:00
|
|
|
endif ()
|
2015-11-17 00:50:08 +00:00
|
|
|
|
2020-04-05 12:57:59 +00:00
|
|
|
|
2016-09-15 20:29:59 +00:00
|
|
|
###
|
|
|
|
# Dependencies
|
|
|
|
###
|
2020-04-05 12:57:59 +00:00
|
|
|
|
2020-04-21 12:49:25 +00:00
|
|
|
find_package(libusb REQUIRED)
|
2020-04-17 12:41:48 +00:00
|
|
|
|
2020-04-24 13:01:28 +00:00
|
|
|
## Package configuration (pkg-config) on unix-based systems
|
2020-04-17 15:01:36 +00:00
|
|
|
if (NOT WIN32 AND NOT CMAKE_CROSSCOMPILING)
|
2020-05-18 13:13:36 +00:00
|
|
|
#add_subdirectory(cmake/pkgconfig)
|
2020-04-05 12:25:45 +00:00
|
|
|
find_package(PkgConfig)
|
2020-04-17 18:45:33 +00:00
|
|
|
pkg_check_modules(GTK3 gtk+-3.0)
|
2016-06-18 14:19:09 +00:00
|
|
|
endif ()
|
2015-11-17 00:50:08 +00:00
|
|
|
|
2020-04-24 13:01:28 +00:00
|
|
|
## Check for system-specific additional header files and libraries
|
2016-10-22 07:44:37 +00:00
|
|
|
include(CheckIncludeFile)
|
2020-04-17 12:41:48 +00:00
|
|
|
|
2016-08-03 09:04:20 +00:00
|
|
|
CHECK_INCLUDE_FILE(sys/mman.h STLINK_HAVE_SYS_MMAN_H)
|
|
|
|
if (STLINK_HAVE_SYS_MMAN_H)
|
2020-04-05 12:25:45 +00:00
|
|
|
add_definitions(-DSTLINK_HAVE_SYS_MMAN_H)
|
|
|
|
endif ()
|
2016-08-03 09:04:20 +00:00
|
|
|
|
2017-06-29 19:33:31 +00:00
|
|
|
CHECK_INCLUDE_FILE(unistd.h STLINK_HAVE_UNISTD_H)
|
|
|
|
if (STLINK_HAVE_UNISTD_H)
|
2020-04-05 12:25:45 +00:00
|
|
|
add_definitions(-DSTLINK_HAVE_UNISTD_H)
|
|
|
|
endif ()
|
2017-06-29 19:33:31 +00:00
|
|
|
|
2020-03-21 12:48:40 +00:00
|
|
|
include(CheckLibraryExists)
|
|
|
|
|
2020-04-17 12:41:48 +00:00
|
|
|
CHECK_LIBRARY_EXISTS(ssp __stack_chk_fail "" _stack_chk_fail_exists)
|
2020-04-05 12:25:45 +00:00
|
|
|
if (_stack_chk_fail_exists)
|
2020-05-19 14:50:10 +00:00
|
|
|
set(SSP_LIB -static ssp)
|
2020-04-05 12:25:45 +00:00
|
|
|
else ()
|
2020-03-21 12:48:40 +00:00
|
|
|
set(SSP_LIB "")
|
2020-04-05 12:25:45 +00:00
|
|
|
endif ()
|
2020-03-21 12:48:40 +00:00
|
|
|
|
2016-09-15 20:29:59 +00:00
|
|
|
|
2020-04-25 20:34:18 +00:00
|
|
|
###
|
|
|
|
# Main build process
|
|
|
|
###
|
|
|
|
|
|
|
|
## Define include directories to avoid absolute paths for header defines
|
|
|
|
include_directories(${LIBUSB_INCLUDE_DIR})
|
|
|
|
|
2020-04-24 13:01:28 +00:00
|
|
|
# ====
|
2020-05-19 09:28:35 +00:00
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/include) ### TODO: Clean this up...
|
2020-04-25 20:34:18 +00:00
|
|
|
include_directories(${PROJECT_BINARY_DIR}/include/stlink)
|
2020-05-19 09:28:35 +00:00
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/include/stlink)
|
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/include/stlink/tools)
|
2020-04-25 20:34:18 +00:00
|
|
|
# ====
|
|
|
|
|
|
|
|
include_directories(src)
|
2020-05-19 09:28:35 +00:00
|
|
|
include_directories(src/tools) ### TODO: Clean this up...
|
2016-06-18 14:19:09 +00:00
|
|
|
|
2016-05-16 08:21:04 +00:00
|
|
|
set(STLINK_HEADERS
|
2020-04-25 20:34:18 +00:00
|
|
|
include/stlink.h
|
|
|
|
include/stlink/backend.h
|
|
|
|
include/stlink/chipid.h
|
|
|
|
include/stlink/commands.h
|
|
|
|
include/stlink/flash_loader.h
|
|
|
|
include/stlink/reg.h
|
|
|
|
src/logging.h
|
|
|
|
src/md5.h
|
|
|
|
src/sg.h
|
|
|
|
src/usb.h
|
|
|
|
)
|
2016-05-05 12:46:42 +00:00
|
|
|
|
2016-05-16 08:21:04 +00:00
|
|
|
set(STLINK_SOURCE
|
2020-04-25 20:34:18 +00:00
|
|
|
src/common.c
|
|
|
|
src/chipid.c
|
|
|
|
src/flash_loader.c
|
|
|
|
src/logging.c
|
|
|
|
src/md5.c
|
|
|
|
src/sg.c
|
|
|
|
src/usb.c
|
|
|
|
)
|
2015-11-17 00:50:08 +00:00
|
|
|
|
2020-04-17 11:21:07 +00:00
|
|
|
if (WIN32 OR MINGW OR MSYS)
|
2020-04-25 20:34:18 +00:00
|
|
|
include_directories(src/mingw)
|
2020-04-15 14:20:17 +00:00
|
|
|
set(STLINK_SOURCE "${STLINK_SOURCE};src/mmap.c;src/mingw/mingw.c")
|
2020-04-25 20:34:18 +00:00
|
|
|
set(STLINK_HEADERS "${STLINK_HEADERS};src/mmap.h;src/mingw/mingw.h")
|
2016-06-18 14:19:09 +00:00
|
|
|
endif ()
|
|
|
|
|
2017-06-17 06:05:47 +00:00
|
|
|
if (MSVC)
|
2020-04-05 12:57:59 +00:00
|
|
|
include_directories(src/win32)
|
|
|
|
include_directories(src/getopt)
|
|
|
|
# Use string.h rather than strings.h and disable annoying warnings
|
|
|
|
add_definitions(-DHAVE_STRING_H -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS /wd4710)
|
2017-06-17 06:05:47 +00:00
|
|
|
endif ()
|
2015-11-17 00:50:08 +00:00
|
|
|
|
2020-04-25 20:34:18 +00:00
|
|
|
## Include test execution for test-targets for target Debug
|
2020-04-24 13:01:28 +00:00
|
|
|
if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
|
|
|
|
include(CTest)
|
|
|
|
endif ()
|
2020-04-05 12:57:59 +00:00
|
|
|
|
2020-04-25 20:34:18 +00:00
|
|
|
|
2020-05-19 09:28:35 +00:00
|
|
|
###
|
|
|
|
# Libraries
|
|
|
|
###
|
|
|
|
|
|
|
|
set(STLINK_LIBRARY_PATH ${CMAKE_INSTALL_LIBDIR} CACHE PATH "Main library install directory")
|
|
|
|
|
|
|
|
# Set the environment variable LD_LIBRARY_PATH to point to /usr/local/lib (per default).
|
2020-05-28 09:42:26 +00:00
|
|
|
execute_process (COMMAND bash -c "export LD_LIBRARY_PATH="${CMAKE_INSTALL_LIBDIR}" ")
|
2020-05-19 09:28:35 +00:00
|
|
|
|
|
|
|
|
2017-01-28 10:30:30 +00:00
|
|
|
###
|
2016-09-15 20:29:59 +00:00
|
|
|
# Shared library
|
2017-01-28 10:30:30 +00:00
|
|
|
###
|
2020-04-05 12:57:59 +00:00
|
|
|
|
2020-05-19 09:28:35 +00:00
|
|
|
# Set library name
|
2018-03-16 15:41:07 +00:00
|
|
|
if (NOT WIN32)
|
2020-04-05 12:25:45 +00:00
|
|
|
set(STLINK_LIB_SHARED ${PROJECT_NAME})
|
2020-04-17 11:21:07 +00:00
|
|
|
else (WIN32)
|
2020-04-05 12:25:45 +00:00
|
|
|
set(STLINK_LIB_SHARED ${PROJECT_NAME}-shared)
|
|
|
|
endif ()
|
2017-01-28 10:30:30 +00:00
|
|
|
|
2020-05-19 09:28:35 +00:00
|
|
|
add_library(${STLINK_LIB_SHARED} SHARED ${STLINK_HEADERS} ${STLINK_SOURCE})
|
2020-04-05 12:25:45 +00:00
|
|
|
|
|
|
|
set(STLINK_SHARED_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
|
2020-02-20 11:25:23 +00:00
|
|
|
message(STATUS "STLINK_LIB_SHARED: ${STLINK_LIB_SHARED}")
|
|
|
|
message(STATUS "PROJECT_VERSION_MAJOR: ${PROJECT_VERSION_MAJOR}")
|
|
|
|
message(STATUS "VERSION: ${STLINK_SHARED_VERSION}")
|
|
|
|
|
2020-05-22 17:42:16 +00:00
|
|
|
set_target_properties(${STLINK_LIB_SHARED} PROPERTIES
|
2020-04-17 12:41:48 +00:00
|
|
|
SOVERSION ${PROJECT_VERSION_MAJOR}
|
|
|
|
VERSION ${STLINK_SHARED_VERSION}
|
2020-05-19 09:28:35 +00:00
|
|
|
OUTPUT_NAME ${PROJECT_NAME}
|
2020-04-17 12:41:48 +00:00
|
|
|
)
|
2016-07-09 20:07:50 +00:00
|
|
|
|
2020-05-17 22:49:08 +00:00
|
|
|
# Link shared library
|
2020-05-18 13:13:36 +00:00
|
|
|
if (APPLE) # ... with Apple macOS libraries
|
2020-04-05 12:57:59 +00:00
|
|
|
find_library(ObjC objc)
|
|
|
|
find_library(CoreFoundation CoreFoundation)
|
|
|
|
find_library(IOKit IOKit)
|
2020-05-17 22:49:08 +00:00
|
|
|
target_link_libraries(${STLINK_LIB_SHARED} ${LIBUSB_LIBRARY} ${SSP_LIB} ${ObjC} ${CoreFoundation} ${IOKit})
|
|
|
|
elseif (WIN32) # ... with Windows libraries
|
|
|
|
target_link_libraries(${STLINK_LIB_SHARED} ${LIBUSB_LIBRARY} ${SSP_LIB} wsock32 ws2_32)
|
2020-04-05 12:25:45 +00:00
|
|
|
else ()
|
2020-03-21 12:48:40 +00:00
|
|
|
target_link_libraries(${STLINK_LIB_SHARED} ${LIBUSB_LIBRARY} ${SSP_LIB})
|
2020-04-05 12:25:45 +00:00
|
|
|
endif ()
|
2016-09-15 13:05:00 +00:00
|
|
|
|
2020-04-25 20:34:18 +00:00
|
|
|
install(TARGETS ${STLINK_LIB_SHARED} DESTINATION ${STLINK_LIBRARY_PATH})
|
2018-03-28 07:49:14 +00:00
|
|
|
|
2016-09-15 02:58:49 +00:00
|
|
|
|
2016-09-15 20:29:59 +00:00
|
|
|
###
|
|
|
|
# Static library
|
|
|
|
###
|
2020-04-05 12:57:59 +00:00
|
|
|
|
2020-05-19 09:28:35 +00:00
|
|
|
# Set library name
|
2016-09-15 20:29:59 +00:00
|
|
|
set(STLINK_LIB_STATIC ${PROJECT_NAME}-static)
|
2016-07-09 20:07:50 +00:00
|
|
|
|
2020-05-19 09:28:35 +00:00
|
|
|
add_library(${STLINK_LIB_STATIC} STATIC ${STLINK_HEADERS} ${STLINK_SOURCE})
|
2017-01-28 10:30:30 +00:00
|
|
|
|
2020-05-17 22:49:08 +00:00
|
|
|
set(STLINK_STATIC_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
|
|
|
|
message(STATUS "STLINK_LIB_STATIC: ${STLINK_LIB_STATIC}")
|
|
|
|
message(STATUS "PROJECT_VERSION_MAJOR: ${PROJECT_VERSION_MAJOR}")
|
|
|
|
message(STATUS "VERSION: ${STLINK_STATIC_VERSION}")
|
|
|
|
|
2020-05-22 17:42:16 +00:00
|
|
|
set_target_properties(${STLINK_LIB_STATIC} PROPERTIES
|
2020-05-17 22:49:08 +00:00
|
|
|
SOVERSION ${PROJECT_VERSION_MAJOR}
|
|
|
|
VERSION ${STLINK_STATIC_VERSION}
|
2020-04-25 20:34:18 +00:00
|
|
|
OUTPUT_NAME ${PROJECT_NAME}
|
|
|
|
)
|
|
|
|
|
2020-05-17 22:49:08 +00:00
|
|
|
# Link static library
|
2020-05-18 13:13:36 +00:00
|
|
|
if (APPLE) # ... with Apple macOS libraries
|
2020-04-05 12:57:59 +00:00
|
|
|
find_library(ObjC objc)
|
|
|
|
find_library(CoreFoundation CoreFoundation)
|
|
|
|
find_library(IOKit IOKit)
|
2020-05-17 22:49:08 +00:00
|
|
|
target_link_libraries(${STLINK_LIB_STATIC} ${LIBUSB_LIBRARY} ${SSP_LIB} ${ObjC} ${CoreFoundation} ${IOKit})
|
|
|
|
elseif (WIN32) # ... with Windows libraries
|
|
|
|
target_link_libraries(${STLINK_LIB_STATIC} ${LIBUSB_LIBRARY} ${SSP_LIB} wsock32 ws2_32)
|
2020-04-05 12:25:45 +00:00
|
|
|
else ()
|
2020-03-21 12:48:40 +00:00
|
|
|
target_link_libraries(${STLINK_LIB_STATIC} ${LIBUSB_LIBRARY} ${SSP_LIB})
|
2020-04-05 12:25:45 +00:00
|
|
|
endif ()
|
2017-01-28 10:30:30 +00:00
|
|
|
|
2020-05-19 09:28:35 +00:00
|
|
|
install(TARGETS ${STLINK_LIB_STATIC} ARCHIVE DESTINATION ${STLINK_LIBRARY_PATH})
|
2016-07-09 20:07:50 +00:00
|
|
|
|
2020-04-05 12:57:59 +00:00
|
|
|
|
2016-09-15 20:29:59 +00:00
|
|
|
###
|
2020-04-25 20:34:18 +00:00
|
|
|
# Build toolset executables
|
2016-09-15 20:29:59 +00:00
|
|
|
###
|
2020-04-05 12:57:59 +00:00
|
|
|
|
2020-04-25 20:34:18 +00:00
|
|
|
set(ST-UTIL_SOURCES src/st-util/gdb-remote.c src/st-util/gdb-server.c src/st-util/semihosting.c)
|
|
|
|
|
|
|
|
if (MSVC)
|
|
|
|
# Add getopt to sources
|
|
|
|
set(ST-UTIL_SOURCES "${ST-UTIL_SOURCES};src/getopt/getopt.c")
|
|
|
|
endif ()
|
|
|
|
|
2016-09-15 20:29:59 +00:00
|
|
|
add_executable(st-flash src/tools/flash.c src/tools/flash_opts.c)
|
|
|
|
add_executable(st-info src/tools/info.c)
|
2020-04-25 20:34:18 +00:00
|
|
|
add_executable(st-util ${ST-UTIL_SOURCES})
|
2020-04-16 19:00:30 +00:00
|
|
|
|
2017-01-28 10:30:30 +00:00
|
|
|
if (WIN32 OR APPLE)
|
2020-04-16 19:00:30 +00:00
|
|
|
target_link_libraries(st-flash ${STLINK_LIB_STATIC} ${SSP_LIB})
|
2020-03-21 12:48:40 +00:00
|
|
|
target_link_libraries(st-info ${STLINK_LIB_STATIC} ${SSP_LIB})
|
2020-04-25 20:34:18 +00:00
|
|
|
target_link_libraries(st-util ${STLINK_LIB_STATIC} ${SSP_LIB})
|
2020-04-05 12:25:45 +00:00
|
|
|
else ()
|
2020-04-16 19:00:30 +00:00
|
|
|
target_link_libraries(st-flash ${STLINK_LIB_SHARED} ${SSP_LIB})
|
2020-03-21 12:48:40 +00:00
|
|
|
target_link_libraries(st-info ${STLINK_LIB_SHARED} ${SSP_LIB})
|
2020-04-25 20:34:18 +00:00
|
|
|
target_link_libraries(st-util ${STLINK_LIB_SHARED} ${SSP_LIB})
|
2020-04-05 12:25:45 +00:00
|
|
|
endif ()
|
2015-11-17 00:50:08 +00:00
|
|
|
|
2020-05-19 09:28:35 +00:00
|
|
|
install(TARGETS st-flash DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
install(TARGETS st-info DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
install(TARGETS st-util DESTINATION ${CMAKE_INSTALL_BINDIR})
|
2020-05-18 16:34:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
###
|
2020-05-19 09:28:35 +00:00
|
|
|
# Device configuration (Linux only)
|
2020-05-18 16:34:16 +00:00
|
|
|
###
|
|
|
|
|
2016-09-23 09:54:43 +00:00
|
|
|
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
2020-05-27 10:35:05 +00:00
|
|
|
## Install modprobe.d conf files to /etc/modprobe.d/ (explicitly hardcoded)
|
|
|
|
set(STLINK_MODPROBED_DIR "/etc/modprobe.d" CACHE PATH "modprobe.d directory")
|
2020-05-19 09:28:35 +00:00
|
|
|
install(FILES ${CMAKE_SOURCE_DIR}/config/modprobe.d/stlink_v1.conf DESTINATION ${STLINK_MODPROBED_DIR})
|
|
|
|
|
2020-05-27 10:35:05 +00:00
|
|
|
## Install udev rules files to /etc/udev/rules.d/ (explicitly hardcoded)
|
|
|
|
set(STLINK_UDEV_RULES_DIR "/etc/udev/rules.d" CACHE PATH "udev rules directory")
|
2020-05-19 09:28:35 +00:00
|
|
|
file(GLOB RULES_FILES ${CMAKE_SOURCE_DIR}/config/udev/rules.d/*.rules)
|
|
|
|
install(FILES ${RULES_FILES} DESTINATION ${STLINK_UDEV_RULES_DIR})
|
2020-04-05 12:25:45 +00:00
|
|
|
endif ()
|
2016-09-23 09:54:43 +00:00
|
|
|
|
2020-04-27 18:20:50 +00:00
|
|
|
|
2016-09-15 20:29:59 +00:00
|
|
|
###
|
2020-04-25 20:34:18 +00:00
|
|
|
# Additional build tasks
|
2016-09-15 20:29:59 +00:00
|
|
|
###
|
2020-04-05 12:57:59 +00:00
|
|
|
|
2020-04-25 20:34:18 +00:00
|
|
|
# ====
|
|
|
|
add_subdirectory(include) # contains subordinate CMakeLists for version config and old header includes
|
|
|
|
### TODO: Clean this up ...
|
2020-04-16 19:00:30 +00:00
|
|
|
# ====
|
|
|
|
|
2020-04-25 20:34:18 +00:00
|
|
|
add_subdirectory(src/stlink-gui) # contains subordinate CMakeLists to build GUI
|
|
|
|
add_subdirectory(tests) # contains subordinate CMakeLists to build test executables
|
|
|
|
add_subdirectory(cmake/packaging) # contains subordinate CMakeLists to build packages
|
2020-04-05 16:01:49 +00:00
|
|
|
|
2020-05-18 16:34:16 +00:00
|
|
|
option(STLINK_GENERATE_MANPAGES "Generate manpages with pandoc" OFF)
|
|
|
|
add_subdirectory(doc/man) # contains subordinate CMakeLists to generate manpages
|
|
|
|
|
2020-04-18 14:45:05 +00:00
|
|
|
|
2020-04-05 16:01:49 +00:00
|
|
|
###
|
|
|
|
# Uninstall target
|
|
|
|
###
|
|
|
|
|
|
|
|
if (NOT TARGET uninstall)
|
|
|
|
configure_file(
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
|
2020-04-18 14:45:05 +00:00
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake"
|
2020-04-05 16:01:49 +00:00
|
|
|
IMMEDIATE @ONLY
|
2020-04-12 16:26:46 +00:00
|
|
|
)
|
|
|
|
add_custom_target(
|
|
|
|
uninstall COMMAND ${CMAKE_COMMAND}
|
2020-04-18 14:45:05 +00:00
|
|
|
-P ${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake
|
2020-04-12 16:26:46 +00:00
|
|
|
)
|
2020-04-05 16:01:49 +00:00
|
|
|
endif ()
|