summaryrefslogtreecommitdiffstats
path: root/Source/CMakeLists.txt
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2022-08-21 02:45:30 (GMT)
committerBrad King <brad.king@kitware.com>2022-09-22 13:24:48 (GMT)
commit3b32a1a8208812dde24f5f6be30e7f9361f01cab (patch)
tree174d3f698d5bef535245d2d55285676271a5469f /Source/CMakeLists.txt
parenta392df50b3cebdaa52da9df4b0547384a9d82668 (diff)
downloadCMake-3b32a1a8208812dde24f5f6be30e7f9361f01cab.zip
CMake-3b32a1a8208812dde24f5f6be30e7f9361f01cab.tar.gz
CMake-3b32a1a8208812dde24f5f6be30e7f9361f01cab.tar.bz2
Build: Introduce `ManifestLib` interface library
… instead of `MANIFEST_FILE` variable.
Diffstat (limited to 'Source/CMakeLists.txt')
-rw-r--r--Source/CMakeLists.txt22
1 files changed, 13 insertions, 9 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 424cb5f..67b2fd9 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -71,8 +71,12 @@ configure_file(
@ONLY
)
+# Add a dummy library and add sources later depends on condition
+add_library(ManifestLib INTERFACE)
+
#
# create a library used by the command line and the GUI
+#
add_library(
CMakeLib
# Lexers/Parsers
@@ -866,7 +870,7 @@ if(WIN32)
# Add a manifest file to executables on Windows to allow for
# GetVersion to work properly on Windows 8 and above.
- set(MANIFEST_FILE ${CMAKE_CURRENT_SOURCE_DIR}/cmake.version.manifest)
+ target_sources(ManifestLib INTERFACE cmake.version.manifest)
endif()
endif()
@@ -902,9 +906,9 @@ set(_tools)
if(WIN32 AND NOT CYGWIN)
set_source_files_properties(cmcldeps.cxx PROPERTIES COMPILE_DEFINITIONS _WIN32_WINNT=0x0501)
- add_executable(cmcldeps cmcldeps.cxx ${MANIFEST_FILE})
+ add_executable(cmcldeps cmcldeps.cxx)
+ target_link_libraries(cmcldeps PRIVATE CMakeLib ManifestLib)
list(APPEND _tools cmcldeps)
- target_link_libraries(cmcldeps PRIVATE CMakeLib)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR MATCHES "sparc")
@@ -1155,19 +1159,19 @@ if(CPACK_ENABLE_FREEBSD_PKG AND FREEBSD_PKG_INCLUDE_DIRS AND FREEBSD_PKG_LIBRARI
endif()
# Build CMake executable
-add_executable(cmake cmakemain.cxx cmcmd.cxx cmcmd.h ${MANIFEST_FILE})
+add_executable(cmake cmakemain.cxx cmcmd.cxx cmcmd.h)
+target_link_libraries(cmake PRIVATE CMakeLib ManifestLib)
list(APPEND _tools cmake)
-target_link_libraries(cmake PRIVATE CMakeLib)
# Build CTest executable
-add_executable(ctest ctest.cxx ${MANIFEST_FILE})
+add_executable(ctest ctest.cxx)
+target_link_libraries(ctest PRIVATE CTestLib ManifestLib)
list(APPEND _tools ctest)
-target_link_libraries(ctest PRIVATE CTestLib)
# Build CPack executable
-add_executable(cpack CPack/cpack.cxx ${MANIFEST_FILE})
+add_executable(cpack CPack/cpack.cxx)
+target_link_libraries(cpack PRIVATE CPackLib ManifestLib)
list(APPEND _tools cpack)
-target_link_libraries(cpack PRIVATE CPackLib)
# Curses GUI
if(BUILD_CursesDialog)