summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2026-01-13 17:02:51 +0100
committerAlbrecht Schlosser <albrechts.fltk@online.de>2026-01-13 17:02:51 +0100
commitd38b699432ab9c69a9e1a257cc4544db8ba1217e (patch)
tree5fd5368bd588a69517512ab57bd35a7f43c31c3e
parentafacd1b8fecfec1996747748eba9e5510800e69b (diff)
util/cmap: link against libm only if it was found
-rw-r--r--util/CMakeLists.txt10
1 files changed, 7 insertions, 3 deletions
diff --git a/util/CMakeLists.txt b/util/CMakeLists.txt
index 565d52e86..0e140a263 100644
--- a/util/CMakeLists.txt
+++ b/util/CMakeLists.txt
@@ -1,7 +1,7 @@
#
# CMakeLists.txt to build utilities for the FLTK project using CMake (www.cmake.org)
#
-# Copyright 1998-2025 by Bill Spitzak and others.
+# Copyright 1998-2026 by Bill Spitzak and others.
#
# This library is free software. Distribution and use rights are outlined in
# the file "COPYING" which should have been included with this file. If this
@@ -31,8 +31,12 @@
add_executable(cmap cmap.cxx)
-# cmap doesn't need to link against FLTK libraries - it's a standalone tool
-target_link_libraries(cmap PRIVATE m)
+# cmap doesn't need to link against FLTK libraries - it's a standalone tool,
+# but it requires libm on Unix/Linux - link against libm, but only if found.
+
+if(LIB_m)
+ target_link_libraries(cmap PRIVATE m)
+endif()
# Set properties
set_target_properties(cmap PROPERTIES