Updated cmake-settings

- Changed header installation path
- Fix for cpack output directory
pull/987/head
nightwalker-87 2020-06-17 15:15:33 +02:00
rodzic e250773b88
commit 3f20a25cc0
4 zmienionych plików z 14 dodań i 15 usunięć

Wyświetl plik

@ -32,15 +32,6 @@ else ()
set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MT /Zi /O2 /Ob1 /D NDEBUG")
endif ()
## Set installation directories for header files ### TODO: Clean this up...
if (IS_DIRECTORY ${INCLUDE_INSTALL_DIR})
set(INCLUDE_INSTALL_DIR ${INCLUDE_INSTALL_DIR} CACHE PATH "Main include directory")
set(STLINK_INCLUDE_PATH "${INCLUDE_INSTALL_DIR}")
else ()
set(INCLUDE_INSTALL_DIR "include" CACHE PATH "Main include directory")
set(STLINK_INCLUDE_PATH "${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR}")
endif ()
###
# Dependencies
@ -94,12 +85,19 @@ include_directories(src)
include_directories(src/st-flash)
include_directories(src/stlink-lib)
## Set installation directory for header files
set(STLINK_INCLUDE_PATH ${CMAKE_INSTALL_INCLUDEDIR} CACHE PATH "Main include install directory")
## Subordinate CMakeLists for version config & header installation
add_subdirectory(inc)
## Define source- and headerfiles for stlink library
set(STLINK_HEADERS
inc/backend.h
inc/stlink.h
src/stlink-lib/commands.h
src/stlink-lib/libusb_settings.h
src/stlink-lib/reg.h
inc/stlink.h
src/stlink-lib/chipid.h
src/stlink-lib/flash_loader.h
src/stlink-lib/logging.h
@ -279,7 +277,6 @@ endif ()
# Additional build tasks
###
add_subdirectory(inc) # contains subordinate CMakeLists for version config
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

Wyświetl plik

@ -52,7 +52,7 @@ if (GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
# ...the version does not match with git-version string
if (NOT __version_str STREQUAL __version_file)
message(STATUS "Rewrite ${PROJECT_SOURCE_DIR}/.version with ${__version_str}.")
message(STATUS "Rewrite ${PROJECT_SOURCE_DIR}/.version with ${__version_str}!")
endif ()
else (NOT EXISTS "${PROJECT_SOURCE_DIR}/.version")

Wyświetl plik

@ -12,6 +12,7 @@ set(CPACK_PACKAGE_VENDOR "stlink-org")
set(CMAKE_PROJECT_HOMEPAGE_URL "https://github.com/stlink-org/stlink")
set(CPACK_SET_DESTDIR "ON")
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/dist)
set(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_BINARY_DIR}/dist")
if (APPLE) # macOS

Wyświetl plik

@ -3,7 +3,8 @@ configure_file(
"${CMAKE_BINARY_DIR}/inc/version.h"
)
file(GLOB STLINK_HEADERS "src/st-link-lib/*.h" "${CMAKE_BINARY_DIR}/inc/version.h")
file(GLOB STLINK_HEADERS
"${CMAKE_SOURCE_DIR}/inc/*.h"
"${CMAKE_SOURCE_DIR}/src/stlink-lib/*.h"
"${CMAKE_BINARY_DIR}/inc/version.h")
install(FILES ${STLINK_HEADERS} DESTINATION ${STLINK_INCLUDE_PATH})
install(FILES ${CMAKE_SOURCE_DIR}/inc/stlink.h DESTINATION ${STLINK_INCLUDE_PATH})
install(FILES ${CMAKE_SOURCE_DIR}/inc/stm32.h DESTINATION ${STLINK_INCLUDE_PATH})