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

custom function for build step #170

Closed
smanders opened this issue Feb 23, 2018 · 2 comments
Closed

custom function for build step #170

smanders opened this issue Feb 23, 2018 · 2 comments
Assignees
Milestone

Comments

@smanders
Copy link
Owner

there are times when it would be cleaner to specify a cmake function for the build step...

currently, a build step function has to match a proper naming format

# build
if(COMMAND build_${cmdp})
  file(APPEND ${stepBuild} "build_${cmdp}()\n")
endif()

where cmdp comes from the name of the project, with - and . replaced with _

get_filename_component(pro ${proj} NAME)
string(REPLACE ".cmake" "" pro ${pro}) # name w/o .cmake extension
string(REPLACE "-" "_" cmdp ${pro})
string(REPLACE "." "_" cmdp ${cmdp})

which means that a build-step function for ffmpeg_2.6.2.cmake https://github.com/smanders/externpro/blob/18.01.1/projects/ffmpeg_2.6.2.cmake would need to be build_ffmpeg_2_6_2()

  • if the version of ffmpeg is updated one would need to remember to also change the build function name and the required underscores are also ugly and hard to remember

not ideal -- and the reason I currently build multiple versions of ffmpeg from one build-step function https://github.com/smanders/externpro/blob/18.01.1/projects/ffmpeg.cmake#L36

  • which is also not ideal, especially given how different it currently is to build ffmpeg 2.6.2 and 2.6.2.1...

it would be more convenient (and something I will use to build glew) to specify the cmake function for the build step with a BUILD_FUNC argument in the PRO_${PRO} variable that is defined for each project

@smanders smanders added this to the current milestone Feb 23, 2018
@smanders smanders self-assigned this Feb 23, 2018
smanders pushed a commit that referenced this issue Feb 23, 2018
@smanders
Copy link
Owner Author

completed with commit to dev branch referenced above

@smanders
Copy link
Owner Author

examples of using custom BUILD_FUNC

@smanders smanders mentioned this issue Mar 2, 2018
46 tasks
@smanders smanders mentioned this issue Mar 28, 2018
53 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant