pavelliavonau / cmakeconverter

This project aims to facilitate the conversion of Visual Studio to CMake projects.
GNU Affero General Public License v3.0
858 stars 109 forks source link

Wildcard support #123

Open jaenster opened 4 years ago

jaenster commented 4 years ago

First of all; Great project!

The issue: While it was an easy fix for me to do, you might consider adding this automatically.

Some projects, like the one i been converting, use the visual studio specific method of wildcards in the source files.

In this case it loads features\*.cpp and framework\*.cpp

The CMakeList file that comes out contains this;

set(no_group_source_files
    "features/*.cpp"
    "framework/*.cpp"
)

Which is invalid, as CMake cant find the file features/*.cpp, as it doesn't understand wildcards, it tries to load the literal file feature/*.cpp, which obviously don't exists

I converted this to

file(GLOB_RECURSE no_group_source_files RELATIVE ${CMAKE_SOURCE_DIR} "features/*.cpp" "framework/*.cpp")

Which works flawlessly, however i have to reload it after adding a file, in this use case not a big issue.

Maybe its an idea to automatically convert wildcards to GLOB's?