Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CMake Error: CMake can not determine linker language for target: myapp

Tags:

c++

cmake

I am trying to compile vMime by cmake, but I am getting error above, I am using graphical interface of cmake and my makefiles.txt is below. It configures properly but do not generate

cmake_minimum_required(VERSION 2.8)
PROJECT(CXX)#vmime
enable_language(CXX)
set(VerifyCXX VerifyCXX.cxx)
add_definitions(-DVERIFY_CXX)
set_target_properties(${TARGET} PROPERTIES LINKER_LANGUAGE Cxx)
add_executable(myapp vmime)
install(TARGETS myapp DESTINATION bin)

Help will be highly appreciated as I am stuck at point for couple of days.

like image 639
Ahsan Roy Avatar asked Jun 30 '15 05:06

Ahsan Roy


1 Answers

CMake probably can not determine linker language for target myapp, because the target does not contain any source files with recognized extensions.

add_executable(myapp vmime)

should be probably replaced by

add_executable(myapp ${VerifyCXX})

Also this command

set_target_properties(${TARGET} PROPERTIES LINKER_LANGUAGE Cxx) 

cannot be succesfull, because ${TARGET} is used-before-set. You should call it after add_executable

set_target_properties(myapp PROPERTIES LINKER_LANGUAGE CXX)

Note that usually it is not needed at all.

like image 103
Peter Avatar answered Oct 13 '22 04:10

Peter