Skip to content

Attempting to use cmake instead of make (example) #6749

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 153 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
f7d7cba
feat: Add CMake configuration for Wren library and FileUtils utility
Kreijstal Dec 22, 2024
54f46dd
build: Add root include directory to CMake target include paths
Kreijstal Dec 22, 2024
e5819ab
fix: Add top-level CMakeLists.txt to resolve include path issues
Kreijstal Dec 22, 2024
9683b8f
fix: Add GLM experimental features and external include path
Kreijstal Dec 22, 2024
5030d90
build: Update CMake configuration to resolve deprecation and OpenGL w…
Kreijstal Dec 22, 2024
ef23c4e
build: Add siphash include directory to wren CMakeLists.txt
Kreijstal Dec 22, 2024
3a8f666
build: Add Freetype support to CMake configuration
Kreijstal Dec 22, 2024
844b0fa
feat: Add assimp package support in CMake configuration
Kreijstal Dec 22, 2024
26e0852
build: Add CMakeLists.txt for Wren demo executables
Kreijstal Dec 22, 2024
1e9d612
feat: Add glad library and update demo CMakeLists for linking
Kreijstal Dec 22, 2024
9e14d49
build: Add CMakeLists.txt for project configuration and dependencies
Kreijstal Dec 22, 2024
c7a4357
refactor: Resolve CMake configuration conflicts and clean up build files
Kreijstal Dec 22, 2024
853cbbd
refactor: Simplify root CMakeLists.txt to only add src subdirectory
Kreijstal Dec 22, 2024
591f34d
feat: Add Qt6 package finding to root CMakeLists.txt
Kreijstal Dec 22, 2024
6335c2a
fix: Add include directory and enable GLM experimental features
Kreijstal Dec 22, 2024
2bc4513
build: Add glad library and include directories
Kreijstal Dec 22, 2024
bdda538
fix: Link phong_demo with glad library to resolve undefined reference
Kreijstal Dec 22, 2024
10eab14
fix: Link GLUT and OpenGL libraries for phong_demo
Kreijstal Dec 22, 2024
9746c81
fix: Add core directory to wren library include paths
Kreijstal Dec 22, 2024
447f700
fix: Add core directory to include paths for wren_lib target
Kreijstal Dec 22, 2024
b2e6fdd
feat: Add VRML directory to library include paths in FileUtils.cmake
Kreijstal Dec 22, 2024
a4498d5
feat: Add src/webots/util to include paths in FileUtils.cmake
Kreijstal Dec 22, 2024
018f6f1
fix: Add compilation_timestamp directory to include paths
Kreijstal Dec 22, 2024
0f6e4ab
refactor: Conditionally filter Windows-specific source files in CMake…
Kreijstal Dec 22, 2024
9d76fcf
fix: Update Qt6 method signature handling in WbQtObjectSpy
Kreijstal Dec 22, 2024
7fe6043
build: Add widgets directory to CMake include paths
Kreijstal Dec 22, 2024
278dcd6
build: Add CMakeLists.txt for user_commands library with Qt6 and edit…
Kreijstal Dec 22, 2024
196e282
refactor: Add user_commands directory to include paths in FileUtils.c…
Kreijstal Dec 22, 2024
8f54ac7
feat: Add src/webots/maths to include paths in FileUtils.cmake
Kreijstal Dec 22, 2024
0dae7a1
feat: Add nodes/utils directory to include paths in FileUtils.cmake
Kreijstal Dec 22, 2024
1faeefd
feat: Add src/webots/wren to include paths in FileUtils.cmake
Kreijstal Dec 22, 2024
9834a17
feat: Add src/webots/ode to include paths in FileUtils.cmake
Kreijstal Dec 22, 2024
e6abbd0
feat: Add ./src/webots/nodes to include paths in FileUtils.cmake
Kreijstal Dec 22, 2024
dda22aa
feat: Add src/webots/app to include paths in FileUtils.cmake
Kreijstal Dec 22, 2024
16c7a30
feat: Add top-level include directory to CMake include paths
Kreijstal Dec 22, 2024
27834fc
fix: Add include/ode directory to CMake include paths
Kreijstal Dec 22, 2024
4e8a3c5
feat: Add src/webots/sound to include paths in FileUtils.cmake
Kreijstal Dec 22, 2024
e62403c
feat: Add stb include paths to CMake configuration
Kreijstal Dec 22, 2024
3f4fe8b
fix: Add FreeType2 include paths to CMake configuration
Kreijstal Dec 22, 2024
833d59e
refactor: Use CMake's FindFreetype module for FreeType2 include paths
Kreijstal Dec 22, 2024
4facee4
fix: Add siphash include directory to CMake configuration
Kreijstal Dec 22, 2024
34996b1
feat: Add src/webots/plugins to CMake include paths
Kreijstal Dec 22, 2024
2c49bcc
feat: Add controller C API include directory to CMake configuration
Kreijstal Dec 22, 2024
91cef61
feat: Add src/webots/engine to CMake include paths
Kreijstal Dec 22, 2024
54ea7ec
feat: Add src/webots/control to CMake include paths
Kreijstal Dec 22, 2024
1d679ad
feat: Add src/webots/editor to CMake include paths
Kreijstal Dec 22, 2024
3c14e5f
feat: Add scene_tree directory to CMake include paths
Kreijstal Dec 22, 2024
7301111
feat: Add PicoTTS dependency with ExternalProject in CMake build system
Kreijstal Dec 22, 2024
21e8572
build: Update picotts to CMake-based build with new repository
Kreijstal Dec 22, 2024
aff2f39
fix: Add SOURCE_SUBDIR to picotts ExternalProject_Add configuration
Kreijstal Dec 22, 2024
c0da6ff
fix: Update PicoTTS include paths in ExternalDependencies.cmake
Kreijstal Dec 22, 2024
3a746b9
fix: Add extern "C" wrapper and compile flags for PicoTTS integration
Kreijstal Dec 22, 2024
13f46ab
feat: Add PicoTTS integration with C/C++ wrapper and build configurat…
Kreijstal Dec 22, 2024
d49e87e
fix: Resolve PicoTTS C/C++ compilation conflicts with keyword renaming
Kreijstal Dec 22, 2024
7dbe34f
build: Add CMakeLists.txt for core library with Qt6::Network linkage
Kreijstal Dec 22, 2024
9cba1b4
fix: Add Qt MOC support and header for WbWebotsUpdateManager
Kreijstal Dec 22, 2024
45d111b
fix: Add Qt6::QmlIntegration to resolve QJSEngine linking error
Kreijstal Dec 22, 2024
85a6258
feat: Add missing Qt6 modules to core library linking
Kreijstal Dec 22, 2024
af0911b
refactor: Remove Qt6::Concurrent from core library dependencies
Kreijstal Dec 22, 2024
df8048e
refactor: Add default Qt dependencies to all libraries via FileUtils.…
Kreijstal Dec 22, 2024
4d1bc17
build: Add CMakeLists.txt for Webots project with Qt6 and OpenGL depe…
Kreijstal Dec 22, 2024
33e28f8
fix: Resolve linking order and add missing Qt6 library in CMakeLists.txt
Kreijstal Dec 22, 2024
6dad54b
fix: Resolve linking errors by adjusting library dependencies and vis…
Kreijstal Dec 22, 2024
83fb5bb
build: Add CMakeLists.txt for app library with Qt6 dependencies
Kreijstal Dec 22, 2024
a9c56c2
fix: Update CMakeLists.txt to resolve Qt library linking issues
Kreijstal Dec 22, 2024
f714dbe
build: Add nodes/utils library to build system
Kreijstal Dec 22, 2024
0f38c49
build: Add CMakeLists.txt for nodes library with core and vrml depend…
Kreijstal Dec 22, 2024
899d0ec
feat: Add nodes_utils_lib to nodes_lib target and create utils subdir…
Kreijstal Dec 22, 2024
b7fb1a5
fix: Resolve CMake library linking issue in nodes/utils directory
Kreijstal Dec 22, 2024
5d84332
fix: Add missing include paths for nodes_utils_lib
Kreijstal Dec 22, 2024
5f9b5e3
feat: Link vrml_lib to nodes_utils_lib for header and implementation …
Kreijstal Dec 22, 2024
0c6fa98
build: Add util_lib and core_lib dependencies to nodes_utils_lib
Kreijstal Dec 22, 2024
2c40921
fix: Add OIS dependency to CMake build configuration
Kreijstal Dec 22, 2024
7dce0fe
fix: Update CMake configuration to find OIS library directly
Kreijstal Dec 22, 2024
ad878f2
fix: Update CMake OIS library path detection to search /usr/include
Kreijstal Dec 22, 2024
192264c
build: Use pkg-config to find OIS library
Kreijstal Dec 22, 2024
3b5a5a1
fix: Correct pkg-config module name for OIS from lowercase to uppercase
Kreijstal Dec 22, 2024
8d4a9e1
feat: Add base include paths for OIS headers in FileUtils.cmake
Kreijstal Dec 22, 2024
46bab3c
fix: Add OIS include directory to nodes_utils_lib target
Kreijstal Dec 22, 2024
0a30a47
feat: Add more OIS include paths for better library detection
Kreijstal Dec 22, 2024
c20f83a
feat: Add MINGW_PREFIX paths for OIS in CMake include directories
Kreijstal Dec 22, 2024
e57b547
fix: Update OIS include and linking configuration in CMake build system
Kreijstal Dec 22, 2024
1e0a81a
fix: Add /usr/include to OIS include directories for compilation
Kreijstal Dec 22, 2024
1760f06
refactor: Improve OIS include directory configuration for better cros…
Kreijstal Dec 22, 2024
1a7905c
refactor: Remove OIS prefix from OISJoyStick.h include
Kreijstal Dec 22, 2024
3b44c6a
build: Add additional include directories for MinGW and system paths
Kreijstal Dec 22, 2024
0640b01
refactor: Remove explicit OIS include paths from CMake configuration
Kreijstal Dec 22, 2024
271c15d
fix: Update OIS header include path and CMake configuration
Kreijstal Dec 22, 2024
f3c524f
fix: Revert OIS include path to use pkg-config flags
Kreijstal Dec 22, 2024
3408676
fix: Update CMake configuration to properly use OIS pkg-config target
Kreijstal Dec 22, 2024
066a8a0
build: Conditionally compile WbVirtualRealityHeadset.cpp for Windows …
Kreijstal Dec 22, 2024
3ff6010
fix: Add engine_lib dependency to app_lib for resolving linking errors
Kreijstal Dec 22, 2024
9c78e1f
build: Add CMakeLists.txt for engine library with target dependencies
Kreijstal Dec 22, 2024
7a7716d
build: Update engine CMakeLists.txt to include all sources and Qt dep…
Kreijstal Dec 22, 2024
a7f6ab8
feat: Add vrml_lib to engine library dependencies
Kreijstal Dec 22, 2024
e7ef0f6
build: Add CMakeLists.txt for vrml library with maths_lib linkage
Kreijstal Dec 22, 2024
6cf5be1
build: Update vrml_lib CMakeLists.txt to fix source inclusion and dep…
Kreijstal Dec 22, 2024
4b249cd
build: Switch from pkg-config to pkgconf for OIS module discovery
Kreijstal Dec 22, 2024
bfcda00
build: Add pkgconf support for ODE dependency in CMake
Kreijstal Dec 22, 2024
430b80f
fix: Update CMake configuration to use pkg-config for OIS and ODE
Kreijstal Dec 22, 2024
45dc72e
build: Add wren_lib dependency to app_lib in CMakeLists.txt
Kreijstal Dec 22, 2024
d836ba9
build: Add CMakeLists.txt for wren library with Qt6 and OpenGL depend…
Kreijstal Dec 22, 2024
5d04191
feat: Improve wren_lib CMake export configuration
Kreijstal Dec 22, 2024
6387833
fix: Add missing source files and Qt dependencies to wren_lib CMakeLi…
Kreijstal Dec 22, 2024
a05c80e
build: Add wren library dependency to wren_lib and build order
Kreijstal Dec 22, 2024
a52ba91
refactor: Remove unnecessary wren subdirectory from CMake configuration
Kreijstal Dec 22, 2024
dd1e149
feat: Add wren subdirectory to src/CMakeLists.txt
Kreijstal Dec 22, 2024
d448cef
feat: Add CMakeLists.txt for ODE library with comprehensive configura…
Kreijstal Dec 22, 2024
a3cdb95
build: Add ODE library as a subdirectory
Kreijstal Dec 22, 2024
ec148be
feat: Add root include directory to ODE library include paths
Kreijstal Dec 22, 2024
345b1f0
build: Add dependency on root include directory for ODE target
Kreijstal Dec 22, 2024
15667a0
refactor: Remove add_dependencies() and add root include directory to…
Kreijstal Dec 22, 2024
706ec89
fix: Reorder include directories to prioritize root include path
Kreijstal Dec 22, 2024
68acad6
feat: Add include directory as compile option for ODE library
Kreijstal Dec 22, 2024
2ded06d
feat: Add ./include/ode to ODE CMake include directories
Kreijstal Dec 22, 2024
1291fe9
fix: Remove duplicate macro definitions in ODE CMakeLists.txt
Kreijstal Dec 22, 2024
1c60af8
fix: Add custom CCD directory to include paths in CMakeLists.txt
Kreijstal Dec 22, 2024
015f970
feat: Add ODE library dependency to app_lib target
Kreijstal Dec 22, 2024
c1cac90
feat: Add fluid dynamics source file to ODE library compilation
Kreijstal Dec 22, 2024
bca14aa
feat: Add fluid dynamics source files to ODE library compilation
Kreijstal Dec 22, 2024
626e457
refactor: Use file globbing to find ODE source files recursively
Kreijstal Dec 22, 2024
53a43f2
feat: Add nodes_lib dependency to app_lib target
Kreijstal Dec 22, 2024
778ae9f
refactor: Resolve potential circular dependency between app_lib and n…
Kreijstal Dec 22, 2024
43f6443
refactor: Remove circular dependency between nodes_lib and app_lib
Kreijstal Dec 22, 2024
ab91350
fix: Enable RTTI and symbol export for nodes_lib to resolve linker er…
Kreijstal Dec 22, 2024
83a5a6a
fix: Resolve linking issues by updating CMake library configuration
Kreijstal Dec 22, 2024
35675d5
build: Configure nodes_utils_lib with RTTI, visibility, and export se…
Kreijstal Dec 22, 2024
998650b
fix: Resolve undefined reference by adjusting library linking and vis…
Kreijstal Dec 22, 2024
4288b06
fix: Resolve RTTI linking issues by adjusting library build configura…
Kreijstal Dec 22, 2024
1fd827c
build: Fix PIC linking issues for nodes_utils_lib
Kreijstal Dec 22, 2024
7781aa9
fix: Resolve CMake PIC settings to fix library compilation errors
Kreijstal Dec 22, 2024
6fade0b
fix: Resolve RTTI linking issues by updating CMake configuration
Kreijstal Dec 22, 2024
7734e32
last minute fix
Kreijstal Dec 22, 2024
ad17c75
it fuken worked
Kreijstal Dec 26, 2024
4a0cf2a
add cmakefiles
Kreijstal Dec 26, 2024
d09d47b
Fixing pico
Kreijstal Dec 26, 2024
927d02b
fix stuff on msys2
Kreijstal Dec 26, 2024
4a21f7a
add msys2 compatibility for pico
Kreijstal Dec 26, 2024
fde1b7e
reordering deps
Kreijstal Dec 26, 2024
e8bd6d7
make node utils static
Kreijstal Dec 26, 2024
29af657
Fixing msys2 bugs
Kreijstal Dec 26, 2024
519353c
It can't find symbols: CLSID_SpVoice CLSID_SpVoice CLSID_SpStream Ge…
Kreijstal Dec 26, 2024
ecd8dc0
finally build on msys2
Kreijstal Dec 26, 2024
a5b534c
adding c and cpp controler to cmake
Kreijstal Dec 27, 2024
3a47fba
adding winsock
Kreijstal Dec 27, 2024
842b948
woops
Kreijstal Dec 27, 2024
d25cdf2
Controllers compile on windows now
Kreijstal Dec 27, 2024
9a9e57a
Attempting to add java
Kreijstal Dec 27, 2024
63ed697
close
Kreijstal Dec 27, 2024
30b6b1f
only jni.h is missing
Kreijstal Dec 28, 2024
43e2b73
works in linux
Kreijstal Dec 28, 2024
b8969ec
now installable
Kreijstal Dec 28, 2024
1690650
Merge branch 'develop' into NEW
Kreijstal Apr 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 76 additions & 74 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,74 +1,76 @@
# Global rules #
################

# Build directories
build
com
webots_catkin_ws

# Compiled source
*.exe
*.o
*.d
*.class
*.so
*.dylib
*.dll
*.lib
*.a
*.cof
*.hex
*.pyc
*.gch

# Packages
*.7z
*.bz2
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.xz
*.zip

# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
.directory
ehthumbs.db
Thumbs.db
*.swp

# Text editor backup files
*~

# Log files
*.log

# Blender cache
*.blend1

# Webots generated files
*.cache

# IDE files
.vscode

# Local rules #
###############

/.clang-format
/msys64
/webots
/webots-controller
/webots.lnk
/webots_debug_output.txt
/util

# world thumbnail files
.*.jpg
# Global rules #
################

# Build directories
build
com
webots_catkin_ws

# Compiled source
*.exe
*.o
*.d
*.class
*.so
*.dylib
*.dll
*.lib
*.a
*.cof
*.hex
*.pyc
*.gch

# Packages
*.7z
*.bz2
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.xz
*.zip

# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
.directory
ehthumbs.db
Thumbs.db
*.swp

# Text editor backup files
*~

# Log files
*.log

# Blender cache
*.blend1

# Webots generated files
*.cache

# IDE files
.vscode

# Local rules #
###############

/.clang-format
/msys64
/webots
/webots-controller
/webots.lnk
/webots_debug_output.txt
/util

# world thumbnail files
.*.jpg
.aider*
.env
38 changes: 38 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
cmake_minimum_required(VERSION 3.10)
project(webots)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
# Set C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Find Qt6 components
find_package(Qt6 REQUIRED COMPONENTS
Core
Gui
OpenGL
Qml
QmlIntegration
PrintSupport
Widgets
Xml
OpenGLWidgets
WebSockets
Test
Network
)
file(READ ${CMAKE_SOURCE_DIR}/resources/version.txt WEBOTS_VERSION)
string(STRIP ${WEBOTS_VERSION} WEBOTS_VERSION)
# Find other required packages
find_package(OpenAL REQUIRED)
find_package(OpenGL REQUIRED)
find_package(PkgConfig REQUIRED)
find_package(Freetype REQUIRED)
find_package(assimp REQUIRED)
pkg_check_modules(OPENVR REQUIRED IMPORTED_TARGET openvr)
# Include external dependencies
include(src/webots/cmake/ExternalDependencies.cmake)

# Add subdirectories
add_subdirectory(src)
51 changes: 51 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Find required packages

# Add glad library
add_library(glad glad/glad.c)
target_include_directories(glad PUBLIC ${CMAKE_SOURCE_DIR}/include)
target_compile_options(glad PUBLIC -fPIC)

add_custom_target(stb
COMMAND git submodule update --init --recursive src/stb
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Initializing stb submodule"
)

# --- Handle stb_image.h ---

# Check for system installation of stb
find_path(STB_INCLUDE_DIR
NAMES stb_image.h
PATHS
/usr/include/stb
/usr/local/include/stb
$ENV{MSYSTEM_PREFIX}/include/stb
$ENV{MSYSTEM_PREFIX}/local/include/stb
)

# If not found, use the stb submodule
if(NOT STB_INCLUDE_DIR)
message(STATUS "System installation of stb not found. Using stb submodule.")

# Initialize and update the stb submodule
execute_process(
COMMAND ${CMAKE_COMMAND} --build . --target stb
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)

# Set STB_INCLUDE_DIR to the submodule's include path
set(STB_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/stb)

# Cache the variable so it persists across CMake runs
set(STB_INCLUDE_DIR ${STB_INCLUDE_DIR} CACHE PATH "Path to stb include directory")
endif()

message(STATUS "STB_INCLUDE_DIR: ${STB_INCLUDE_DIR}")

# Make STB_INCLUDE_DIR available to other CMake files (e.g., in src/controller/c)
set(STB_INCLUDE_DIR ${STB_INCLUDE_DIR} CACHE PATH "Path to stb include directory" FORCE)

add_subdirectory(ode)
add_subdirectory(wren)
add_subdirectory(webots)
add_subdirectory(controller)
4 changes: 4 additions & 0 deletions src/controller/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Add subdirectories for C and C++ controllers
add_subdirectory(c)
add_subdirectory(cpp)
add_subdirectory(java)
150 changes: 150 additions & 0 deletions src/controller/c/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
# Name of the library to be created
set(CONTROLLER_LIBRARY_NAME Controller)

# Source files for the controller library
set(CONTROLLER_SOURCES
abstract_camera.c
accelerometer.c
altimeter.c
ansi_codes.c
base64.c
brake.c
camera.c
compass.c
connector.c
console.c
default_robot_window.c
device.c
display.c
distance_sensor.c
dynamic_library.c
emitter.c
file.c
g_image.c
g_pipe.c
gps.c
gyro.c
html_robot_window.c
image.c
inertial_unit.c
joystick.c
keyboard.c
led.c
lidar.c
light_sensor.c
microphone.c
motion.c
motor.c
mouse.c
node.c
pen.c
percent.c
position_sensor.c
radar.c
radio.c
range_finder.c
receiver.c
remote_control.c
request.c
robot.c
robot_window.c
scheduler.c
sha1.c
skin.c
speaker.c
string.c
supervisor.c
system.c
tcp_client.c
touch_sensor.c
vacuum_gripper.c
)

# Header files for internal use within the library
set(CONTROLLER_HEADERS
abstract_camera.h
base64.h
camera_private.h
default_robot_window_private.h
device_private.h
display_private.h
dynamic_library.h
file.h
g_image.h
g_pipe.h
html_robot_window_private.h
image_private.h
joystick_private.h
keyboard_private.h
messages.h
motion_private.h
mouse_private.h
percent.h
remote_control_private.h
request.h
robot_private.h
robot_window_private.h
scheduler.h
sha1.h
supervisor_private.h
tcp_client.h
)

# Create the shared library
add_library(${CONTROLLER_LIBRARY_NAME} SHARED ${CONTROLLER_SOURCES} ${CONTROLLER_HEADERS})

# Include directories for the controller library
target_include_directories(${CONTROLLER_LIBRARY_NAME}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${STB_INCLUDE_DIR}>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include/controller/c>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include/controller/c>
)
# Find libraries on Windows (using MSYS2)
if (WIN32)
# Directly use MSYSTEM_PREFIX for library paths
set(winsock_LIBRARY_PATH "$ENV{MSYSTEM_PREFIX}/lib/libws2_32.a")

# Check if winsock library exists and link it
if (EXISTS ${winsock_LIBRARY_PATH})
message(STATUS "winsock library found: ${winsock_LIBRARY_PATH}")
else()
message(FATAL_ERROR "winsock library not found at ${winsock_LIBRARY_PATH}. Please ensure it is installed in your MSYS2 environment.")
endif()

# Link libraries if found
target_link_libraries(Controller
PRIVATE
${winsock_LIBRARY_PATH}
)
endif()

target_compile_definitions(${CONTROLLER_LIBRARY_NAME}
PUBLIC
"LIBCONTROLLER_VERSION=\"${WEBOTS_VERSION}\""
)
# Link necessary libraries to the controller
target_link_libraries(${CONTROLLER_LIBRARY_NAME}
PUBLIC
# glad
# ${Freetype_LIBRARIES}
)

# Set properties for the library (adjust as needed)
#set_target_properties(${CONTROLLER_LIBRARY_NAME} PROPERTIES
# VERSION 0.1
# SOVERSION 0
# PUBLIC_HEADER "${CONTROLLER_HEADERS}"
#)

# Install rules
install(TARGETS ${CONTROLLER_LIBRARY_NAME}
DESTINATION lib
)

install(FILES ${CONTROLLER_HEADERS}
DESTINATION include
)
Loading
Loading