diff --git a/CMakeLists.txt b/CMakeLists.txt index b94424e9e..23ba0110f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,14 @@ endif() # license set(LICENSE "GPL3") +# add definitions for version and license +if(COMMAND cmake_policy) + cmake_policy(SET CMP0005 NEW) + add_definitions(-DWEECHAT_VERSION="${VERSION}" -DWEECHAT_LICENSE="${LICENSE}") +else() + add_definitions(-DWEECHAT_VERSION='"${VERSION}"' -DWEECHAT_LICENSE='"${LICENSE}"') +endif() + # package string set(PKG_STRING "${PROJECT_NAME} ${VERSION}") string(REPLACE "\";\"" "\ " PKG_STRING ${PKG_STRING}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 516b3b0fb..b044f8b96 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -19,13 +19,6 @@ # along with WeeChat. If not, see . # -if(COMMAND cmake_policy) - cmake_policy(SET CMP0005 NEW) - add_definitions(-DWEECHAT_VERSION="${VERSION}" -DWEECHAT_LICENSE="${LICENSE}") -else() - add_definitions(-DWEECHAT_VERSION='"${VERSION}"' -DWEECHAT_LICENSE='"${LICENSE}"') -endif() - add_subdirectory(core) list(APPEND STATIC_LIBS weechat_core)