Skip to content
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

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

Draft
wants to merge 153 commits into
base: develop
Choose a base branch
from
Draft
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
9ccadfe
feat: Add CMake configuration for Wren library and FileUtils utility
Kreijstal Dec 22, 2024
0d9caa6
build: Add root include directory to CMake target include paths
Kreijstal Dec 22, 2024
cf27775
fix: Add top-level CMakeLists.txt to resolve include path issues
Kreijstal Dec 22, 2024
dc818e3
fix: Add GLM experimental features and external include path
Kreijstal Dec 22, 2024
8e6f8d0
build: Update CMake configuration to resolve deprecation and OpenGL w…
Kreijstal Dec 22, 2024
b489659
build: Add siphash include directory to wren CMakeLists.txt
Kreijstal Dec 22, 2024
ce13c7f
build: Add Freetype support to CMake configuration
Kreijstal Dec 22, 2024
79e1911
feat: Add assimp package support in CMake configuration
Kreijstal Dec 22, 2024
aee2ea7
build: Add CMakeLists.txt for Wren demo executables
Kreijstal Dec 22, 2024
f8e2da8
feat: Add glad library and update demo CMakeLists for linking
Kreijstal Dec 22, 2024
b22d345
build: Add CMakeLists.txt for project configuration and dependencies
Kreijstal Dec 22, 2024
b8b5801
refactor: Resolve CMake configuration conflicts and clean up build files
Kreijstal Dec 22, 2024
62bbd96
refactor: Simplify root CMakeLists.txt to only add src subdirectory
Kreijstal Dec 22, 2024
179b556
feat: Add Qt6 package finding to root CMakeLists.txt
Kreijstal Dec 22, 2024
71b4a8a
fix: Add include directory and enable GLM experimental features
Kreijstal Dec 22, 2024
672b775
build: Add glad library and include directories
Kreijstal Dec 22, 2024
51b432a
fix: Link phong_demo with glad library to resolve undefined reference
Kreijstal Dec 22, 2024
5743ae5
fix: Link GLUT and OpenGL libraries for phong_demo
Kreijstal Dec 22, 2024
1c6299f
fix: Add core directory to wren library include paths
Kreijstal Dec 22, 2024
e1a81ed
fix: Add core directory to include paths for wren_lib target
Kreijstal Dec 22, 2024
b2f5d0b
feat: Add VRML directory to library include paths in FileUtils.cmake
Kreijstal Dec 22, 2024
f547f49
feat: Add src/webots/util to include paths in FileUtils.cmake
Kreijstal Dec 22, 2024
0bd3b05
fix: Add compilation_timestamp directory to include paths
Kreijstal Dec 22, 2024
308fbdb
refactor: Conditionally filter Windows-specific source files in CMake…
Kreijstal Dec 22, 2024
773e776
fix: Update Qt6 method signature handling in WbQtObjectSpy
Kreijstal Dec 22, 2024
261c210
build: Add widgets directory to CMake include paths
Kreijstal Dec 22, 2024
4633dce
build: Add CMakeLists.txt for user_commands library with Qt6 and edit…
Kreijstal Dec 22, 2024
189ef94
refactor: Add user_commands directory to include paths in FileUtils.c…
Kreijstal Dec 22, 2024
35d6c5a
feat: Add src/webots/maths to include paths in FileUtils.cmake
Kreijstal Dec 22, 2024
a2ca36a
feat: Add nodes/utils directory to include paths in FileUtils.cmake
Kreijstal Dec 22, 2024
37f61c5
feat: Add src/webots/wren to include paths in FileUtils.cmake
Kreijstal Dec 22, 2024
4136070
feat: Add src/webots/ode to include paths in FileUtils.cmake
Kreijstal Dec 22, 2024
cbffa11
feat: Add ./src/webots/nodes to include paths in FileUtils.cmake
Kreijstal Dec 22, 2024
e503184
feat: Add src/webots/app to include paths in FileUtils.cmake
Kreijstal Dec 22, 2024
ab6f5c7
feat: Add top-level include directory to CMake include paths
Kreijstal Dec 22, 2024
9bf33fc
fix: Add include/ode directory to CMake include paths
Kreijstal Dec 22, 2024
35a518e
feat: Add src/webots/sound to include paths in FileUtils.cmake
Kreijstal Dec 22, 2024
e5e533a
feat: Add stb include paths to CMake configuration
Kreijstal Dec 22, 2024
ecafa64
fix: Add FreeType2 include paths to CMake configuration
Kreijstal Dec 22, 2024
b84dad0
refactor: Use CMake's FindFreetype module for FreeType2 include paths
Kreijstal Dec 22, 2024
38dbbe3
fix: Add siphash include directory to CMake configuration
Kreijstal Dec 22, 2024
50785d7
feat: Add src/webots/plugins to CMake include paths
Kreijstal Dec 22, 2024
1900f91
feat: Add controller C API include directory to CMake configuration
Kreijstal Dec 22, 2024
c1c7ced
feat: Add src/webots/engine to CMake include paths
Kreijstal Dec 22, 2024
7cae7d1
feat: Add src/webots/control to CMake include paths
Kreijstal Dec 22, 2024
9b4dec8
feat: Add src/webots/editor to CMake include paths
Kreijstal Dec 22, 2024
82d6547
feat: Add scene_tree directory to CMake include paths
Kreijstal Dec 22, 2024
d6f998f
feat: Add PicoTTS dependency with ExternalProject in CMake build system
Kreijstal Dec 22, 2024
f1e4440
build: Update picotts to CMake-based build with new repository
Kreijstal Dec 22, 2024
9ff428a
fix: Add SOURCE_SUBDIR to picotts ExternalProject_Add configuration
Kreijstal Dec 22, 2024
56849ae
fix: Update PicoTTS include paths in ExternalDependencies.cmake
Kreijstal Dec 22, 2024
eba6974
fix: Add extern "C" wrapper and compile flags for PicoTTS integration
Kreijstal Dec 22, 2024
9a8c04d
feat: Add PicoTTS integration with C/C++ wrapper and build configurat…
Kreijstal Dec 22, 2024
fa9d10d
fix: Resolve PicoTTS C/C++ compilation conflicts with keyword renaming
Kreijstal Dec 22, 2024
124826a
build: Add CMakeLists.txt for core library with Qt6::Network linkage
Kreijstal Dec 22, 2024
6a2da7b
fix: Add Qt MOC support and header for WbWebotsUpdateManager
Kreijstal Dec 22, 2024
b1dd8d6
fix: Add Qt6::QmlIntegration to resolve QJSEngine linking error
Kreijstal Dec 22, 2024
7992061
feat: Add missing Qt6 modules to core library linking
Kreijstal Dec 22, 2024
dfd6df7
refactor: Remove Qt6::Concurrent from core library dependencies
Kreijstal Dec 22, 2024
970224e
refactor: Add default Qt dependencies to all libraries via FileUtils.…
Kreijstal Dec 22, 2024
f9b3ffa
build: Add CMakeLists.txt for Webots project with Qt6 and OpenGL depe…
Kreijstal Dec 22, 2024
b146a76
fix: Resolve linking order and add missing Qt6 library in CMakeLists.txt
Kreijstal Dec 22, 2024
02be755
fix: Resolve linking errors by adjusting library dependencies and vis…
Kreijstal Dec 22, 2024
f5f0331
build: Add CMakeLists.txt for app library with Qt6 dependencies
Kreijstal Dec 22, 2024
e4d1c36
fix: Update CMakeLists.txt to resolve Qt library linking issues
Kreijstal Dec 22, 2024
8996031
build: Add nodes/utils library to build system
Kreijstal Dec 22, 2024
c88b73f
build: Add CMakeLists.txt for nodes library with core and vrml depend…
Kreijstal Dec 22, 2024
5ab67d1
feat: Add nodes_utils_lib to nodes_lib target and create utils subdir…
Kreijstal Dec 22, 2024
29fedcf
fix: Resolve CMake library linking issue in nodes/utils directory
Kreijstal Dec 22, 2024
249448d
fix: Add missing include paths for nodes_utils_lib
Kreijstal Dec 22, 2024
93f49dd
feat: Link vrml_lib to nodes_utils_lib for header and implementation …
Kreijstal Dec 22, 2024
aa11770
build: Add util_lib and core_lib dependencies to nodes_utils_lib
Kreijstal Dec 22, 2024
e32d334
fix: Add OIS dependency to CMake build configuration
Kreijstal Dec 22, 2024
97acb08
fix: Update CMake configuration to find OIS library directly
Kreijstal Dec 22, 2024
5f4fe66
fix: Update CMake OIS library path detection to search /usr/include
Kreijstal Dec 22, 2024
9ee2eab
build: Use pkg-config to find OIS library
Kreijstal Dec 22, 2024
ed5fd02
fix: Correct pkg-config module name for OIS from lowercase to uppercase
Kreijstal Dec 22, 2024
b20b8c0
feat: Add base include paths for OIS headers in FileUtils.cmake
Kreijstal Dec 22, 2024
b71b9a2
fix: Add OIS include directory to nodes_utils_lib target
Kreijstal Dec 22, 2024
300707b
feat: Add more OIS include paths for better library detection
Kreijstal Dec 22, 2024
4982aa0
feat: Add MINGW_PREFIX paths for OIS in CMake include directories
Kreijstal Dec 22, 2024
0dbe91c
fix: Update OIS include and linking configuration in CMake build system
Kreijstal Dec 22, 2024
192135e
fix: Add /usr/include to OIS include directories for compilation
Kreijstal Dec 22, 2024
65544eb
refactor: Improve OIS include directory configuration for better cros…
Kreijstal Dec 22, 2024
e3846cb
refactor: Remove OIS prefix from OISJoyStick.h include
Kreijstal Dec 22, 2024
c3d2a16
build: Add additional include directories for MinGW and system paths
Kreijstal Dec 22, 2024
1138b99
refactor: Remove explicit OIS include paths from CMake configuration
Kreijstal Dec 22, 2024
74f5849
fix: Update OIS header include path and CMake configuration
Kreijstal Dec 22, 2024
7e498c7
fix: Revert OIS include path to use pkg-config flags
Kreijstal Dec 22, 2024
09cac82
fix: Update CMake configuration to properly use OIS pkg-config target
Kreijstal Dec 22, 2024
4596080
build: Conditionally compile WbVirtualRealityHeadset.cpp for Windows …
Kreijstal Dec 22, 2024
0c13f2b
fix: Add engine_lib dependency to app_lib for resolving linking errors
Kreijstal Dec 22, 2024
c604d34
build: Add CMakeLists.txt for engine library with target dependencies
Kreijstal Dec 22, 2024
ecc43fa
build: Update engine CMakeLists.txt to include all sources and Qt dep…
Kreijstal Dec 22, 2024
077052b
feat: Add vrml_lib to engine library dependencies
Kreijstal Dec 22, 2024
01402c6
build: Add CMakeLists.txt for vrml library with maths_lib linkage
Kreijstal Dec 22, 2024
04ab145
build: Update vrml_lib CMakeLists.txt to fix source inclusion and dep…
Kreijstal Dec 22, 2024
896f5d1
build: Switch from pkg-config to pkgconf for OIS module discovery
Kreijstal Dec 22, 2024
a5b7ffb
build: Add pkgconf support for ODE dependency in CMake
Kreijstal Dec 22, 2024
7894ebe
fix: Update CMake configuration to use pkg-config for OIS and ODE
Kreijstal Dec 22, 2024
b3f3736
build: Add wren_lib dependency to app_lib in CMakeLists.txt
Kreijstal Dec 22, 2024
aca1d5b
build: Add CMakeLists.txt for wren library with Qt6 and OpenGL depend…
Kreijstal Dec 22, 2024
4fd1e4c
feat: Improve wren_lib CMake export configuration
Kreijstal Dec 22, 2024
a17dbff
fix: Add missing source files and Qt dependencies to wren_lib CMakeLi…
Kreijstal Dec 22, 2024
c5aab42
build: Add wren library dependency to wren_lib and build order
Kreijstal Dec 22, 2024
effbeb7
refactor: Remove unnecessary wren subdirectory from CMake configuration
Kreijstal Dec 22, 2024
586f52a
feat: Add wren subdirectory to src/CMakeLists.txt
Kreijstal Dec 22, 2024
4a02457
feat: Add CMakeLists.txt for ODE library with comprehensive configura…
Kreijstal Dec 22, 2024
0e65f88
build: Add ODE library as a subdirectory
Kreijstal Dec 22, 2024
d79ccbc
feat: Add root include directory to ODE library include paths
Kreijstal Dec 22, 2024
bd88c41
build: Add dependency on root include directory for ODE target
Kreijstal Dec 22, 2024
2406a3c
refactor: Remove add_dependencies() and add root include directory to…
Kreijstal Dec 22, 2024
61e45f8
fix: Reorder include directories to prioritize root include path
Kreijstal Dec 22, 2024
51c2e7d
feat: Add include directory as compile option for ODE library
Kreijstal Dec 22, 2024
70a36b5
feat: Add ./include/ode to ODE CMake include directories
Kreijstal Dec 22, 2024
8e4534e
fix: Remove duplicate macro definitions in ODE CMakeLists.txt
Kreijstal Dec 22, 2024
1b1633a
fix: Add custom CCD directory to include paths in CMakeLists.txt
Kreijstal Dec 22, 2024
7bdd283
feat: Add ODE library dependency to app_lib target
Kreijstal Dec 22, 2024
f78d43d
feat: Add fluid dynamics source file to ODE library compilation
Kreijstal Dec 22, 2024
0cdfd4d
feat: Add fluid dynamics source files to ODE library compilation
Kreijstal Dec 22, 2024
cce6e51
refactor: Use file globbing to find ODE source files recursively
Kreijstal Dec 22, 2024
a662ece
feat: Add nodes_lib dependency to app_lib target
Kreijstal Dec 22, 2024
e727e87
refactor: Resolve potential circular dependency between app_lib and n…
Kreijstal Dec 22, 2024
879cbd4
refactor: Remove circular dependency between nodes_lib and app_lib
Kreijstal Dec 22, 2024
d62bd38
fix: Enable RTTI and symbol export for nodes_lib to resolve linker er…
Kreijstal Dec 22, 2024
d90e24b
fix: Resolve linking issues by updating CMake library configuration
Kreijstal Dec 22, 2024
377db83
build: Configure nodes_utils_lib with RTTI, visibility, and export se…
Kreijstal Dec 22, 2024
0b8ac90
fix: Resolve undefined reference by adjusting library linking and vis…
Kreijstal Dec 22, 2024
a54ae90
fix: Resolve RTTI linking issues by adjusting library build configura…
Kreijstal Dec 22, 2024
131515d
build: Fix PIC linking issues for nodes_utils_lib
Kreijstal Dec 22, 2024
ae41929
fix: Resolve CMake PIC settings to fix library compilation errors
Kreijstal Dec 22, 2024
b67d6f1
fix: Resolve RTTI linking issues by updating CMake configuration
Kreijstal Dec 22, 2024
15bdf34
last minute fix
Kreijstal Dec 22, 2024
8d359f5
it fuken worked
Kreijstal Dec 26, 2024
7e892a6
add cmakefiles
Kreijstal Dec 26, 2024
f4fa7ba
Fixing pico
Kreijstal Dec 26, 2024
3feae94
fix stuff on msys2
Kreijstal Dec 26, 2024
8e3f6b4
add msys2 compatibility for pico
Kreijstal Dec 26, 2024
4521a2b
reordering deps
Kreijstal Dec 26, 2024
ef9d467
make node utils static
Kreijstal Dec 26, 2024
6d1c52f
Fixing msys2 bugs
Kreijstal Dec 26, 2024
6756db4
It can't find symbols: CLSID_SpVoice CLSID_SpVoice CLSID_SpStream Ge…
Kreijstal Dec 26, 2024
7476ee3
finally build on msys2
Kreijstal Dec 26, 2024
eb274a2
adding c and cpp controler to cmake
Kreijstal Dec 27, 2024
21d9ae0
adding winsock
Kreijstal Dec 27, 2024
ba91908
woops
Kreijstal Dec 27, 2024
cce7785
Controllers compile on windows now
Kreijstal Dec 27, 2024
6844931
Attempting to add java
Kreijstal Dec 27, 2024
942b3e9
close
Kreijstal Dec 27, 2024
ed27b5a
only jni.h is missing
Kreijstal Dec 28, 2024
9b323de
works in linux
Kreijstal Dec 28, 2024
fd5e56c
now installable
Kreijstal Dec 28, 2024
25b9b0e
Merge branch 'develop' into NEW
Kreijstal Jan 5, 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