Skip to content

Conversation

@yboumenir
Copy link

No description provided.

Copy link

@usagi usagi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I'm a user of cmdline with CMake.

I think, those source file and executables are test project. Then, I'd suggest use CTest for it. see: https://cmake.org/Wiki/CMake/Testing_With_CTest

And, this pull-requested CMakeLists.txt is not useful for CMake users. Because, cmdline is header-only library project, therefore we need the below cmake install command:

install( FILES cmdline.h DESTINATION include )

Would you please include my suggests.


@tanakh I use the library with CMake ExternalProject. But, In currently, we need a little trciks:

ExternalProject_Add( external_cmdline
  GIT_REPOSITORY git@github.com:tanakh/cmdline.git
  PREFIX            ${CMAKE_CURRENT_BINARY_DIR}/external
  # trick-1: empty configure directive
  CONFIGURE_COMMAND ""
  # trick-2: empty build directive
  BUILD_COMMAND     ""
  # trick-3: custom install command
  INSTALL_COMMAND
    COMMAND ${CMAKE_COMMAND}
      -E copy_if_different
        ${CMAKE_CURRENT_BINARY_DIR}/external/src/external_cmdline/cmdline.h
        ${CMAKE_CURRENT_BINARY_DIR}/include/cmdline.h
)

It's helpful to CMake users if you merge and add supporting CMake with this proposes.

Thank you.

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.

2 participants