Blog
Cmake stupidity...
Date: 1/12/2017
Tags: cmake
So given this snippit:
add_dependencies(my_target jansson)
I get this error:
The dependency target "jansson" of target "my_target" does not exist.
Ok so I did 'add_directory' that, so what if I did this:
add_library(jansson)
add_dependencies(my_target jansson)
Now I get:
add_library cannot create imported target "jansson" because another target with the same name already exists.
Really? It just errored out because it didn't exist? You can't have it both ways Cmake!!!

Cmake: you get what you paid for!
Comments:
fret
01/12/2017 1:44pm
For reference jansson is defined like this:
add_library(jansson STATIC IMPORTED)
set_target_properties(jansson PROPERTIES
	IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/lib/Release/${CMAKE_VS_PLATFORM_NAME}/jansson.lib
	IMPORTED_LOCATION_DEBUG ${CMAKE_CURRENT_LIST_DIR}/lib/Debug/${CMAKE_VS_PLATFORM_NAME}/jansson_d.lib
	INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_LIST_DIR}/include
)
Not that it should matter.
 
Reply
From:
Email (optional): (Will be HTML encoded to evade harvesting)
Message:
 
Remember username and/or email in a cookie.
Notify me of new posts in this thread via email.
BBcode:
[q]text[/q]
[url=link]description[/url]
[img]url_to_image[/img]
[pre]some_code[/pre]
[b]bold_text[/b]