From ba49953cb00639282ceaaef9ea3f7f57b71174c7 Mon Sep 17 00:00:00 2001 From: Rye Date: Mon, 26 Jan 2026 03:06:02 -0500 Subject: [PATCH] Update cmake build system for modern usage --- libndofdev/CMakeLists.txt | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/libndofdev/CMakeLists.txt b/libndofdev/CMakeLists.txt index cbc243e..28c4d86 100644 --- a/libndofdev/CMakeLists.txt +++ b/libndofdev/CMakeLists.txt @@ -1,23 +1,17 @@ # -*- cmake -*- -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 3.18) project(libndofdev) -include_directories( include/ ../stage/packages/include ) +find_package(SDL3 CONFIG REQUIRED) -SET(LIBRARY_OUTPUT_PATH "lib/release/" ) -SET(EXECUTABLE_OUTPUT_PATH "bin" ) -ADD_DEFINITIONS("-m64 -pipe -DUSE_SDL2") +add_compile_definitions(USE_SDL3=1) - set(libndofdev_SOURCE_FILES - ndofdev.c - ) - - set(libndofdev_HEADER_FILES - ${CMAKE_CURRENT_SOURCE_DIR}/ndofdev_external.h - ${CMAKE_CURRENT_SOURCE_DIR}/../stage/packages/include/SDL2/SDL.h - ) +set(libndofdev_SOURCE_FILES + ndofdev.c + ndofdev_external.h +) if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") message(FATAL_ERROR "Windows configuration not implemented. Use the 3DConnexion library located at http://bitbucket.org/lindenlab/3p-libndofdev ") @@ -25,11 +19,12 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") message(FATAL_ERROR "Darwin configuration not implemented. Use the 3DConnexion library located at http://bitbucket.org/lindenlab/3p-libndofdev ") endif() -set_source_files_properties(${libndofdev_HEADER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) -list(APPEND libndofdev_SOURCE_FILES ${libndofdev_HEADER_FILES}) - add_library (ndofdev STATIC ${libndofdev_SOURCE_FILES}) target_link_libraries(ndofdev - ${libndofdev_LIBRARIES} + PUBLIC + SDL3::SDL3 ) + +install(TARGETS ndofdev) +install(FILES ndofdev_external.h TYPE INCLUDE) \ No newline at end of file