|
From: <kin...@us...> - 2025-09-12 09:38:38
|
Revision: 7420
http://sourceforge.net/p/teem/code/7420
Author: kindlmann
Date: 2025-09-12 09:38:35 +0000 (Fri, 12 Sep 2025)
Log Message:
-----------
first stab at handling windows
Modified Paths:
--------------
teem/trunk/CMakeLists-v2.txt
teem/trunk/src/bin/CMakeLists-v2.txt
Modified: teem/trunk/CMakeLists-v2.txt
===================================================================
--- teem/trunk/CMakeLists-v2.txt 2025-09-12 09:03:45 UTC (rev 7419)
+++ teem/trunk/CMakeLists-v2.txt 2025-09-12 09:38:35 UTC (rev 7420)
@@ -17,7 +17,7 @@
# along with this library; if not, see <https://www.gnu.org/licenses/>.
#
-# Teem/CMakeLists.txt Version 11
+# Teem/CMakeLists.txt Version 11.2
# This CMakeLists.txt describes a Teem package that contains:
# (1) a library ("libteem" on unix) and
@@ -303,15 +303,17 @@
target_compile_definitions(Teem PUBLIC "$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:TEEM_STATIC>")
# Do we need to link with -lm? This finishes by setting LIBM_NEEDED
-include(CheckLibmNeeded)
-if(LIBM_NEEDED)
- message(STATUS "Will explicitly link with -lm")
- target_link_libraries(Teem
- PRIVATE m # Teem itself links (especially for shared library)
- INTERFACE m # Consumers (especially for static builds) automatically link
- )
-else()
- message(STATUS "Do not need to link with -lm")
+if(NOT WIN32) # this is all moot on Windows, which has no "m"
+ include(CheckLibmNeeded)
+ if(LIBM_NEEDED)
+ message(STATUS "Will explicitly link with -lm")
+ target_link_libraries(Teem
+ PRIVATE m # Teem itself links (especially for shared library)
+ INTERFACE m # Consumers (especially for static builds) automatically link
+ )
+ else()
+ message(STATUS "Do not need to link with -lm")
+ endif()
endif()
# Set remaining target properties
@@ -445,13 +447,13 @@
###-------------------------------------------------------------------------------------
# Describe Teem's command-line executables (e.g. "unu")
-# Only on Mac with shared libraries: clean out old installed RPATH-aware files before
-# installing new ones, because getting the RPATH stuff to be set correctly after the
-# first "make install", but *not* modified after a second "make install", is just too
-# annoying to figure out. This hack has to *precede* any other install() commands, which
-# is why this shows up here, before src/bin/CMakeLists.txt's teem_add_executable() can
-# call install()
if(BUILD_SHARED_LIBS)
+ # Only on Mac with shared libraries: clean out old installed RPATH-aware files before
+ # installing new ones, because getting the RPATH stuff to be set correctly after the
+ # first "make install", but *not* modified after a second "make install", is just too
+ # annoying to figure out. This hack has to *precede* any other install() commands,
+ # which is why this shows up here, before src/bin/CMakeLists.txt's
+ # teem_add_executable() can call install()
if(APPLE)
install(CODE "
file(GLOB old_bins \"\$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/*\")
@@ -467,6 +469,13 @@
endif()
")
endif()
+ if(WIN32)
+ # Ensure Teem.dll and import library go to a common bin directory
+ set_target_properties(Teem PROPERTIES
+ RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
+ LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
+ )
+ endif()
endif()
# Describe all the command-line tools (unu and friends)
@@ -569,34 +578,36 @@
RENAME LICENSE)
###-------------------------------------------------------------------------------------
-# For non-CMake consumers: create teem.pc for pkg-config, and teem-config script
+# For non-CMake non-Windows users: create teem.pc for pkg-config, and teem-config script
-# Collect all private -llib dependency flags
-set(_pc_private_libs "")
-foreach(_tdep IN LISTS _Teem_DEPS)
- if(Teem_HAVE_${_tdep})
- string(APPEND _pc_private_libs " ${_Teem_dep_llink_${_tdep}}")
+if(NOT WIN32)
+ # Collect all private -llib dependency flags
+ set(_pc_private_libs "")
+ foreach(_tdep IN LISTS _Teem_DEPS)
+ if(Teem_HAVE_${_tdep})
+ string(APPEND _pc_private_libs " ${_Teem_dep_llink_${_tdep}}")
+ endif()
+ endforeach()
+ if(LIBM_NEEDED)
+ string(APPEND _pc_private_libs " -lm")
endif()
-endforeach()
-if(LIBM_NEEDED)
- string(APPEND _pc_private_libs " -lm")
-endif()
-set(Teem_PC_PRIVATE_LIBS "${_pc_private_libs}")
+ set(Teem_PC_PRIVATE_LIBS "${_pc_private_libs}")
-# Generate pkg-config teem.pc file
-configure_file(
- ${CMAKE_CURRENT_SOURCE_DIR}/CMake/teem.pc.in
- ${CMAKE_CURRENT_BINARY_DIR}/teem.pc @ONLY
-)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/teem.pc
- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
-)
+ # Generate pkg-config teem.pc file
+ configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/CMake/teem.pc.in
+ ${CMAKE_CURRENT_BINARY_DIR}/teem.pc @ONLY
+ )
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/teem.pc
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
+ )
-# Generate teem-config helper script
-configure_file(
- ${CMAKE_CURRENT_SOURCE_DIR}/CMake/teem-config.in
- ${CMAKE_CURRENT_BINARY_DIR}/teem-config @ONLY
-)
-install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/teem-config
- DESTINATION ${CMAKE_INSTALL_BINDIR}
-)
+ # Generate teem-config helper script
+ configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/CMake/teem-config.in
+ ${CMAKE_CURRENT_BINARY_DIR}/teem-config @ONLY
+ )
+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/teem-config
+ DESTINATION ${CMAKE_INSTALL_BINDIR}
+ )
+endif()
Modified: teem/trunk/src/bin/CMakeLists-v2.txt
===================================================================
--- teem/trunk/src/bin/CMakeLists-v2.txt 2025-09-12 09:03:45 UTC (rev 7419)
+++ teem/trunk/src/bin/CMakeLists-v2.txt 2025-09-12 09:38:35 UTC (rev 7420)
@@ -7,6 +7,14 @@
RUNTIME DESTINATION ${BIN_INSTALL_DIR}
COMPONENT Runtime
)
+ if(WIN32 AND BUILD_SHARED_LIBS)
+ # Ensure every exe ${name} sees the DLL by copying it to their output folder
+ add_custom_command(TARGET ${name} POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ $<TARGET_FILE:Teem>
+ $<TARGET_FILE_DIR:${name}>
+ )
+ endif()
endfunction()
# List of all Teem command-line tools. TeemV2 stripped down the number of tools built;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|