Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix out-of-source building failing because pod2man #1832

Merged

Conversation

mastertheknife
Copy link
Contributor

Hello,

Building the master branch out-of-source on CentOS6 with cmake 2.8.12 fails when creating the pod files.

For example:

FATALERRORCould not find pod file /home/kfir/ZoneMinder/scripts/../../scripts/zmvideo.pl to generate man page
CMake Error at cmake/Modules/Pod2Man.cmake:56 (ADD_CUSTOM_TARGET):
  add_custom_target called with invalid target name
  "man-zoneminder-../../scripts/zmvideo.pl".  Target names may not contain a
  slash.  Use ADD_CUSTOM_COMMAND to generate files.  Set
  CMAKE_BACKWARDS_COMPATIBILITY to 2.2 or lower to skip this check.
Call Stack (most recent call first):
  scripts/CMakeLists.txt:31 (POD2MAN)

There are actually two errors here:

  1. POD2MAN fails to find the files because the path is incorrect.
  2. CMake complains the target name contains a slash.

The fix is to use absolute paths (remove the RELATIVE parameter when globbing), and to create target names that do not contain slashes, by using the filename only (strip the path from the filename).

Steps to reproduce:

  1. Clone the master branch (before this PR is merged)
  2. mkdir testbuild
  3. cd testbuild
  4. cmake ./..

…e files, and cmake complains about target name containing slahes
@mastertheknife mastertheknife changed the title Fixed out-of-source building failing because pod2man Fix out-of-source building failing because pod2man Mar 21, 2017
@connortechnology
Copy link
Member

Hey... side note, since you seem to know what you are doing.. an annoyance to me is that in order to generate the man pages, I have to do make install... seems to me they should be generated by make...

@mastertheknife
Copy link
Contributor Author

mastertheknife commented Mar 23, 2017

Well, i haven't got to make install yet, compilation breaks for me because i am using ffmpeg 0.6.5. It compiles on 1.26.5, but not master. I will have to upgrade it before i can see that.
Looking at the Pod2Man cmake module, it seems it was built like that.
It adds a target called man, so "make man" builds the man files, but it adds that target to the standard "make install", so when "make install" runs, it executes "make man":

MACRO(ADD_MANPAGE_TARGET)
	# It is not possible add a dependency to target 'install'
	# Run hard-coded 'make man' when 'make install' is invoked
	INSTALL(CODE "EXECUTE_PROCESS(COMMAND make man)")
	ADD_CUSTOM_TARGET(man)
ENDMACRO(ADD_MANPAGE_TARGET)

It feels dirty, but perhaps it was the only way it could be coded at the time. I don't know who wrote that module, or for what version of cmake it was intended. Perhaps now that the minimum cmake version is 2.8.7, things can be done differently.

@knight-of-ni
Copy link
Member

knight-of-ni commented Apr 14, 2017

cmake ./..

Shouldn't the command be cmake .. ?

@knight-of-ni knight-of-ni added this to the 1.30.3 milestone Apr 15, 2017
@mastertheknife
Copy link
Contributor Author

mastertheknife commented Apr 16, 2017

I guess both ways work :)
EDIT: closed by accident

@knight-of-ni knight-of-ni merged commit 24c50ea into ZoneMinder:master Apr 17, 2017
@mastertheknife mastertheknife deleted the cmake_pod2man_outofsource branch May 11, 2017 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants