From b9c1517a0d713cd6fa641e00fc9d19a5245e3619 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Wed, 6 Apr 2016 17:41:58 +0200 Subject: Fix build if the source was exported from bazaar as zip archive (i.e. .bzr directory is missing and build.h is not present) --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ca89b6b..ef7d21d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ project(pcitool C) -set(RELEASE "0") +set(RELEASE "3") set(PCILIB_VERSION "0.2.7") set(PCILIB_ABI_VERSION "2") @@ -168,7 +168,7 @@ set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSIO include(CPack) # In releases, we just keep the pre-generated build.h -if(EXISTS ${CMAKE_SOURCE_DIR}/.bzr/) +if(EXISTS ${CMAKE_SOURCE_DIR}/.bzr/ OR NOT EXISTS ${CMAKE_SOURCE_DIR}/pcilib/build.h) add_custom_target(build COMMAND ${CMAKE_COMMAND} -DPCILIB_SOURCE_DIR=${CMAKE_SOURCE_DIR} -DPCILIB_BINARY_DIR=${CMAKE_BINARY_DIR} -P ${CMAKE_SOURCE_DIR}/cmake/build.cmake WORKING_DIRECTORY ${CMAKE_BINARY_DIR} @@ -189,7 +189,7 @@ if(EXISTS ${CMAKE_SOURCE_DIR}/.bzr/) set_source_files_properties(${CMAKE_BINARY_DIR}/pcilib/build.h PROPERTIES GENERATED TRUE) set_source_files_properties(${CMAKE_SOURCE_DIR}/pcilib/build.h PROPERTIES GENERATED TRUE) -endif(EXISTS ${CMAKE_SOURCE_DIR}/.bzr/) +endif(EXISTS ${CMAKE_SOURCE_DIR}/.bzr/ OR NOT EXISTS ${CMAKE_SOURCE_DIR}/pcilib/build.h) if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) file(COPY ${CMAKE_SOURCE_DIR}/xml DESTINATION ${CMAKE_BINARY_DIR}) -- cgit v1.2.1