From 68b0f3bddc3c4aaffe34caa6a3201029edd8ad56 Mon Sep 17 00:00:00 2001 From: Jerry Jacobs Date: Sat, 22 Oct 2016 09:44:37 +0200 Subject: [PATCH] Initial work to fix cygwin builds --- CMakeLists.txt | 5 +++-- Makefile | 2 +- cmake/modules/FindLibUSB.cmake | 2 -- doc/man/CMakeLists.txt | 4 +++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f648843a7..04717e0a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8.7) project(stlink C) set(PROJECT_DESCRIPTION "Open source version of the STMicroelectronics Stlink Tools") -include(CheckIncludeFile) +option(STLINK_GENERATE_MANPAGES "Generate manpages with pandoc" OFF) if (POLICY CMP0042) # Newer cmake on MacOS should use @rpath @@ -22,6 +22,7 @@ if (NOT APPLE AND NOT WIN32) pkg_check_modules(gtk gtk+-3.0) endif () +include(CheckIncludeFile) CHECK_INCLUDE_FILE(sys/mman.h STLINK_HAVE_SYS_MMAN_H) if (STLINK_HAVE_SYS_MMAN_H) add_definitions(-DSTLINK_HAVE_SYS_MMAN_H) @@ -95,7 +96,7 @@ else() endif() install(TARGETS ${PROJECT_NAME} - LIBRARY DESTINATION lib/${CMAKE_LIBRARY_PATH} + DESTINATION lib/${CMAKE_LIBRARY_PATH} ) ### diff --git a/Makefile b/Makefile index 2ddfceee8..7f81488bb 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ MAKEFLAGS += -s all: release -ci: lint debug release test +ci: debug release test help: @echo " release: Run a release build" diff --git a/cmake/modules/FindLibUSB.cmake b/cmake/modules/FindLibUSB.cmake index 90aafb3a2..45472b96e 100644 --- a/cmake/modules/FindLibUSB.cmake +++ b/cmake/modules/FindLibUSB.cmake @@ -44,8 +44,6 @@ else () ) endif() -message(STATUS "LIBUSB_INCLUDE_DIR: ${LIBUSB_INCLUDE_DIR}") - if (APPLE) set(LIBUSB_NAME libusb-1.0.a) elseif(MSYS OR MINGW) diff --git a/doc/man/CMakeLists.txt b/doc/man/CMakeLists.txt index 55b419361..83bb008cf 100644 --- a/doc/man/CMakeLists.txt +++ b/doc/man/CMakeLists.txt @@ -5,7 +5,7 @@ set(MANPAGES ) # Only generate manpages with pandoc in Debug builds -if(${CMAKE_BUILD_TYPE} MATCHES "Debug") +if(${STLINK_GENERATE_MANPAGES}) include(pandocology) foreach(manpage ${MANPAGES}) @@ -16,6 +16,8 @@ if(${CMAKE_BUILD_TYPE} MATCHES "Debug") PRODUCT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) endforeach() +else() + message(STATUS "Manpage generation disabled") endif() # Install from output folder or this folder