[CMake] nonstandard C++ source filename extension

Bill Hoffman bill.hoffman at kitware.com
Thu Mar 19 11:42:49 EDT 2015


This works for me:

---CMakeLists.txt----
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(asm CXX)
add_executable(foo foo.bar)
set_source_files_properties(foo.bar PROPERTIES LANGUAGE CXX)

---foo.bar---
int main() { return 0;}


$ /cygdrive/c/Program\ Files\ \(x86\)/CMake/bin/cmake -GNinja ..
-- The CXX compiler identification is MSVC 16.0.40219.1
-- Check for working CXX compiler using: Ninja
-- Check for working CXX compiler using: Ninja -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/hoffman/foo/b

hoffman at quasar ~/foo/b
$ ninja
[1/2] Building CXX object CMakeFiles\foo.dir\foo.bar.obj
foo.bar
[2/2] Linking CXX executable foo.exe



More information about the CMake mailing list