How do I add objects with a custom extension to a cmake library?
问题 I'd like to add some object files to a CMake static library, but they have a custom extension. Here's what I've tried: set(SRCS testfile.cxx jsobj.js) add_library(testlib STATIC ${SRCS}) When made, CMake invokes ar testfile.cxx.o (ie the other file is completely ignored). How do I get it included in the archive? Here are some other tricks I've tried: list(APPEND CMAKE_CXX_SOURCE_FILE_EXTENSIONS js) list(APPEND CMAKE_C_SOURCE_FILE_EXTENSIONS js) # no luck add_custom_command(OUTPUT ${CMAKE