[CMake] Copy two files into one file

Bo Thorsen bo at askmonty.org
Fri Jul 9 09:48:24 EDT 2010


Hi all,

Is there an elegant way of copying two files into one?

Right now, I have this:

ADD_CUSTOM_COMMAND(OUTPUT privilege_tables.sql
                    COMMAND copy /b
                      ${CMAKE_CURRENT_SOURCE_DIR}/system_tables.sql
                      + ${CMAKE_CURRENT_SOURCE_DIR}/tables_fix.sql
                      fix_privilege_tables.sql
                    DEPENDS
                    ${CMAKE_CURRENT_SOURCE_DIR}/system_tables.sql
                    ${CMAKE_CURRENT_SOURCE_DIR}/tables_fix.sql)

That's hardly elegant and it doesn't work :(

The problem with this is that the Windows copy command wants \ instead of /.

So, one of two fixes are possible for me: Either there is a much cleaner 
way to do this, or I have to replace / with \ in the path.

If I have to do the replacement, is there a better way to do this than 
to use the STRING command with a char replace?

Cheers,

Bo Thorsen.
Monty Program AB.

-- 

MariaDB: MySQL replacement
Community developed. Feature enhanced. Backward compatible.


More information about the CMake mailing list