2012-11-02 18:47:40 +04:00
|
|
|
|
|
|
|
cmake_minimum_required(VERSION 2.8)
|
|
|
|
|
|
|
|
project(InterfaceLibrary)
|
|
|
|
|
|
|
|
add_library(iface_nodepends INTERFACE)
|
|
|
|
target_compile_definitions(iface_nodepends INTERFACE IFACE_DEFINE)
|
|
|
|
|
2013-12-30 17:35:08 +04:00
|
|
|
add_subdirectory(headerdir)
|
|
|
|
|
2012-11-02 18:47:40 +04:00
|
|
|
add_executable(InterfaceLibrary definetestexe.cpp)
|
2013-12-30 17:35:08 +04:00
|
|
|
target_link_libraries(InterfaceLibrary iface_nodepends headeriface)
|
2012-11-02 18:47:40 +04:00
|
|
|
|
|
|
|
add_subdirectory(libsdir)
|
|
|
|
|
|
|
|
add_executable(sharedlibtestexe sharedlibtestexe.cpp)
|
2013-12-31 17:52:07 +04:00
|
|
|
target_link_libraries(sharedlibtestexe shared_iface imported::iface)
|
2013-12-10 20:16:08 +04:00
|
|
|
|
|
|
|
add_library(broken EXCLUDE_FROM_ALL broken.cpp)
|
|
|
|
|
|
|
|
add_library(iface_broken INTERFACE)
|
|
|
|
# This is not a dependency, so broken will not be built (and the error in
|
|
|
|
# it will not be hit)
|
|
|
|
target_link_libraries(iface_broken INTERFACE broken)
|
|
|
|
|
|
|
|
add_library(iface_whitelist INTERFACE)
|
|
|
|
# The target property CUSTOM will never be evaluated on the INTERFACE library.
|
|
|
|
target_link_libraries(iface_whitelist INTERFACE $<$<BOOL:$<TARGET_PROPERTY:CUSTOM>>:irrelevant>)
|
|
|
|
|
|
|
|
add_executable(exec_whitelist dummy.cpp)
|
|
|
|
target_link_libraries(exec_whitelist iface_whitelist)
|
2014-01-09 15:41:29 +04:00
|
|
|
|
|
|
|
add_library(iface_imported INTERFACE IMPORTED)
|
|
|
|
set_property(TARGET iface_imported PROPERTY
|
|
|
|
INTERFACE_COMPILE_DEFINITIONS
|
|
|
|
$<$<CONFIG:SPECIAL>:SPECIAL_MODE>
|
|
|
|
$<$<CONFIG:Debug>:DEBUG_MODE>
|
|
|
|
)
|
|
|
|
set_property(TARGET iface_imported PROPERTY
|
|
|
|
MAP_IMPORTED_CONFIG_DEBUG SPECIAL
|
|
|
|
)
|
|
|
|
|
|
|
|
add_executable(map_config map_config.cpp)
|
|
|
|
target_link_libraries(map_config iface_imported)
|