/alps/pcitool

To get this branch, use:
bzr branch http://darksoft.org/webbzr/alps/pcitool

« back to all changes in this revision

Viewing changes to CMakeLists.txt

  • Committer: Suren A. Chilingaryan
  • Date: 2016-04-06 15:41:58 UTC
  • Revision ID: csa@suren.me-20160406154158-iksws951o3revo0t
Fix build if the source was exported from bazaar as zip archive (i.e. .bzr directory is missing and build.h is not present)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
project(pcitool C)
2
2
 
3
 
set(RELEASE "0")
 
3
set(RELEASE "3")
4
4
set(PCILIB_VERSION "0.2.7")
5
5
set(PCILIB_ABI_VERSION "2")
6
6
 
168
168
include(CPack)
169
169
 
170
170
# In releases, we just keep the pre-generated build.h 
171
 
if(EXISTS ${CMAKE_SOURCE_DIR}/.bzr/)
 
171
if(EXISTS ${CMAKE_SOURCE_DIR}/.bzr/ OR NOT EXISTS ${CMAKE_SOURCE_DIR}/pcilib/build.h)
172
172
    add_custom_target(build
173
173
        COMMAND ${CMAKE_COMMAND} -DPCILIB_SOURCE_DIR=${CMAKE_SOURCE_DIR} -DPCILIB_BINARY_DIR=${CMAKE_BINARY_DIR} -P ${CMAKE_SOURCE_DIR}/cmake/build.cmake
174
174
        WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
189
189
 
190
190
    set_source_files_properties(${CMAKE_BINARY_DIR}/pcilib/build.h PROPERTIES GENERATED TRUE)
191
191
    set_source_files_properties(${CMAKE_SOURCE_DIR}/pcilib/build.h PROPERTIES GENERATED TRUE)
192
 
endif(EXISTS ${CMAKE_SOURCE_DIR}/.bzr/)
 
192
endif(EXISTS ${CMAKE_SOURCE_DIR}/.bzr/ OR NOT EXISTS ${CMAKE_SOURCE_DIR}/pcilib/build.h)
193
193
 
194
194
if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
195
195
    file(COPY ${CMAKE_SOURCE_DIR}/xml DESTINATION ${CMAKE_BINARY_DIR})