Skip to content

Commit 9519501

Browse files
author
Murilo M. Marinho
committed
[CMakeLists.txt] Standardizing with lower case.
1 parent b970d90 commit 9519501

File tree

1 file changed

+33
-36
lines changed

1 file changed

+33
-36
lines changed

CMakeLists.txt

Lines changed: 33 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Updated 2025.05 to 3.10 since compatibility with CMake < 3.10 will be removed from a future version of CMake.
2-
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)
2+
cmake_minimum_required(VERSION 3.10)
33
# https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html
44
option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
55

@@ -8,42 +8,13 @@ if(WIN32)
88
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
99
endif()
1010

11-
PROJECT(dqrobotics)
11+
project(dqrobotics)
1212
set (CMAKE_CXX_STANDARD 11)
1313

14-
INCLUDE_DIRECTORIES(include)
15-
16-
if(UNIX AND NOT APPLE)
17-
FIND_PACKAGE(Eigen3 REQUIRED)
18-
INCLUDE_DIRECTORIES(${EIGEN3_INCLUDE_DIR})
19-
ADD_COMPILE_OPTIONS(-Werror=return-type -Wall -Wextra -Wmissing-declarations -Wredundant-decls -Woverloaded-virtual)
20-
endif()
21-
22-
if(APPLE)
23-
INCLUDE_DIRECTORIES(
24-
/usr/local/include/
25-
/usr/local/include/eigen3
26-
# Most recent versions of brew install here
27-
/opt/homebrew/include
28-
/opt/homebrew/include/eigen3)
29-
ADD_COMPILE_OPTIONS(-Werror=return-type -Wall -Wextra -Wmissing-declarations -Wredundant-decls -Woverloaded-virtual)
30-
endif()
31-
32-
if(WIN32)
33-
ADD_DEFINITIONS(-D_USE_MATH_DEFINES)
34-
FIND_PACKAGE(Eigen3 CONFIG REQUIRED)
35-
INCLUDE_DIRECTORIES(${EIGEN3_INCLUDE_DIR})
36-
endif()
37-
38-
39-
################################################################
40-
# DEFINE AND INSTALL LIBRARY AND INCLUDE FOLDER
41-
################################################################
42-
4314
# As of 2025.05, Not using GLOB_RECURSE as it's explicitly discouraged.
4415
# https://stackoverflow.com/questions/3201154/automatically-add-all-files-in-a-folder-to-a-target-using-cmake
4516
# https://cmake.org/cmake/help/latest/command/file.html#filesystem
46-
ADD_LIBRARY(dqrobotics
17+
add_library(dqrobotics
4718
src/DQ.cpp
4819

4920
src/internal/_dq_linesegment.cpp
@@ -79,12 +50,38 @@ ADD_LIBRARY(dqrobotics
7950
src/robots/FrankaEmikaPandaRobot.cpp
8051
)
8152

82-
SET_TARGET_PROPERTIES(dqrobotics
53+
target_include_directories(
54+
include
55+
)
56+
57+
if(UNIX AND NOT APPLE)
58+
find_package(Eigen3 REQUIRED)
59+
include_directories(${EIGEN3_INCLUDE_DIR})
60+
add_compile_options(-Werror=return-type -Wall -Wextra -Wmissing-declarations -Wredundant-decls -Woverloaded-virtual)
61+
endif()
62+
63+
if(APPLE)
64+
include_directories(
65+
/usr/local/include/
66+
/usr/local/include/eigen3
67+
# Most recent versions of brew install here
68+
/opt/homebrew/include
69+
/opt/homebrew/include/eigen3)
70+
add_compile_options(-Werror=return-type -Wall -Wextra -Wmissing-declarations -Wredundant-decls -Woverloaded-virtual)
71+
endif()
72+
73+
if(WIN32)
74+
add_definitions(-D_USE_MATH_DEFINES)
75+
find_package(Eigen3 CONFIG REQUIRED)
76+
include_directories(${EIGEN3_INCLUDE_DIR})
77+
endif()
78+
79+
set_target_properties(dqrobotics
8380
PROPERTIES PUBLIC_HEADER
8481
include/dqrobotics/DQ.h
8582
)
8683

87-
INSTALL(TARGETS dqrobotics
84+
install(TARGETS dqrobotics
8885
# https://stackoverflow.com/questions/21592361/cmake-install-is-not-installing-libraries-on-windows
8986
RUNTIME DESTINATION "bin"
9087
LIBRARY DESTINATION "lib"
@@ -96,14 +93,14 @@ INSTALL(TARGETS dqrobotics
9693
# INSTALL HEADERS IN SUBFOLDERS
9794
################################################################
9895

99-
INSTALL(DIRECTORY
96+
install(DIRECTORY
10097
include/
10198
DESTINATION "include")
10299

103100
################################################################
104101
# INSTALL SOURCE FILES (So that the debugger can find them)
105102
################################################################
106103

107-
INSTALL(DIRECTORY
104+
install(DIRECTORY
108105
src/
109106
DESTINATION "src/dqrobotics")

0 commit comments

Comments
 (0)