From 73921613ddddc8d1f8e0caed21ab8dd490a74eb1 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 1 Nov 2015 08:35:17 +0100 Subject: cmake: add current module name to preprocessor vars --- cmake/opentrack-macros.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/opentrack-macros.cmake b/cmake/opentrack-macros.cmake index e171a6fb..e43dc3b5 100644 --- a/cmake/opentrack-macros.cmake +++ b/cmake/opentrack-macros.cmake @@ -66,6 +66,8 @@ macro(opentrack_library n dir) set_target_properties(${n} PROPERTIES LINK_FLAGS "${link-flags} ${opentrack-foolib_LINK}" COMPILE_FLAGS "${opentrack-foolib_COMPILE}") set(link-flags) endif() + string(REPLACE "-" "_" n_ ${n}) + target_compile_definitions(${n} PRIVATE "BUILD_${n_}") if(NOT opentrack-foolib_STATIC) install(TARGETS ${n} RUNTIME DESTINATION . LIBRARY DESTINATION .) endif() -- cgit v1.2.3