$ ls /tmp/src/ CMakeLists.txt $ cat /tmp/src/CMakeLists.txt cmake_minimum_required(VERSION 3.3) add_custom_command(OUTPUT empty.txt COMMAND touch empty.txt) add_custom_target(mytarget DEPENDS empty.txt) export(TARGETS mytarget FILE export.cmake) $ mkdir /tmp/build $ cd /tmp/build $ ~/tmp/cmake-3.3.0-rc4-Linux-x86_64/bin/cmake /tmp/src -- The C compiler identification is GNU 4.9.2 -- The CXX compiler identification is GNU 4.9.2 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done CMake Error in CMakeLists.txt: Exporting the target "mytarget" is not allowed since its linker language cannot be determined CMake Internal Error (please report a bug) in CMakeLists.txt: cmTarget::GetOutputInfo called for mytarget which has type UTILITY Note: The stack trace will not use advanced capabilities because this is a release build. 0x80ac96 : cmsys::SystemInformationImplementation::GetProgramStack(int, int) [(cmake) ???:-1] 0x80bc79 : cmsys::SystemInformation::GetProgramStack(int, int) [(cmake) ???:-1] 0x601d83 : displayMessage(cmake::MessageType, std::basic_ostringstream, std::allocator >&) [(cmake) ???:-1] 0x609f9b : cmake::IssueMessage(cmake::MessageType, std::string const&, cmListFileContext const&) [(cmake) ???:-1] 0x575844 : cmMakefile::IssueMessage(cmake::MessageType, std::string const&) const [(cmake) ???:-1] 0x5de8f4 : cmTarget::GetOutputInfo(std::string const&) const [(cmake) ???:-1] 0x5e15b8 : cmTarget::GetDirectory(std::string const&, bool) const [(cmake) ???:-1] 0x5da483 : cmTarget::NormalGetFullPath(std::string const&, bool, bool) const [(cmake) ???:-1] 0x5e1549 : cmTarget::GetFullPath(std::string const&, bool, bool) const [(cmake) ???:-1] 0x70491b : cmExportBuildFileGenerator::SetImportLocationProperty(std::string const&, std::string const&, cmTarget*, std::map, std::allocator > >&) [(cmake) ???:-1] 0x704ea5 : cmExportBuildFileGenerator::GenerateImportTargetsConfig(std::ostream&, std::string const&, std::string const&, std::vector >&) [(cmake) ???:-1] 0x705f4a : cmExportFileGenerator::GenerateImportConfig(std::ostream&, std::string const&, std::vector >&) [(cmake) ???:-1] 0x703c33 : cmExportBuildFileGenerator::GenerateMainFile(std::ostream&) [(cmake) ???:-1] 0x707d5d : cmExportFileGenerator::GenerateImportFile() [(cmake) ???:-1] 0x54d205 : cmGlobalGenerator::Generate() [(cmake) ???:-1] 0x76abfe : cmGlobalUnixMakefileGenerator3::Generate() [(cmake) ???:-1] 0x53c38a : cmGlobalGenerator::DoGenerate() [(cmake) ???:-1] 0x609090 : cmake::Generate() [(cmake) ???:-1] 0x6093da : cmake::Run(std::vector > const&, bool) [(cmake) ???:-1] 0x50eb76 : do_cmake(int, char const* const*) [(cmake) ???:-1] 0x5103ee : main [(cmake) ???:-1] 0x7fd391029a40 : __libc_start_main [(libc.so.6) ???:-1] 0x50d4fa : ??? [(???) ???:-1] -- Generating done -- Build files have been written to: /tmp/build $