Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iriutils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
labrobotica
algorithms
iriutils
Commits
c64778e9
Commit
c64778e9
authored
14 years ago
by
Guillem Alenyà
Browse files
Options
Downloads
Patches
Plain Diff
MACOS adaptation
parent
fe88a681
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/CMakeLists.txt
+6
-1
6 additions, 1 deletion
src/CMakeLists.txt
src/examples/CMakeLists.txt
+5
-1
5 additions, 1 deletion
src/examples/CMakeLists.txt
src/time/ctime.cpp
+8
-1
8 additions, 1 deletion
src/time/ctime.cpp
with
19 additions
and
3 deletions
src/CMakeLists.txt
+
6
−
1
View file @
c64778e9
...
...
@@ -11,7 +11,12 @@ INCLUDE_DIRECTORIES(./exceptions ./mutex ./events ./threads ./logs ./time)
ADD_LIBRARY
(
iriutils SHARED
${
sources
}
)
#edit the following line to add the necessary system libraries (if any)
TARGET_LINK_LIBRARIES
(
iriutils pthread rt
)
IF
(
APPLE
)
MESSAGE
(
"APPLE SYSTEM FOUND"
)
TARGET_LINK_LIBRARIES
(
iriutils pthread
)
ELSE
(
APPLE
)
TARGET_LINK_LIBRARIES
(
iriutils pthread rt
)
ENDIF
(
APPLE
)
INSTALL
(
TARGETS iriutils
RUNTIME DESTINATION bin
...
...
This diff is collapsed.
Click to expand it.
src/examples/CMakeLists.txt
+
5
−
1
View file @
c64778e9
...
...
@@ -32,7 +32,11 @@ TARGET_LINK_LIBRARIES(test_both iriutils pthread)
ADD_EXECUTABLE
(
test_time test_time.cpp
)
# edit the following line to add the necessary libraries
TARGET_LINK_LIBRARIES
(
test_time iriutils pthread rt
)
IF
(
APPLE
)
TARGET_LINK_LIBRARIES
(
test_time iriutils pthread
)
ELSE
(
APPLE
)
TARGET_LINK_LIBRARIES
(
test_time iriutils pthread rt
)
ENDIF
(
APPLE
)
# edit the following line to add the source code for the example and the name of the executable
ADD_EXECUTABLE
(
test_logs test_logs.cpp
)
...
...
This diff is collapsed.
Click to expand it.
src/time/ctime.cpp
+
8
−
1
View file @
c64778e9
...
...
@@ -104,7 +104,14 @@ void CTime::set(double milliseconds)
if
(
milliseconds
<
0.0
)
{
clock_gettime
(
CLOCK_REALTIME
,
&
time_temp
);
#if defined __APPLE__
struct
timeval
tv
;
gettimeofday
(
&
tv
,
NULL
);
time_temp
.
tv_sec
=
tv
.
tv_sec
;
time_temp
.
tv_nsec
=
tv
.
tv_usec
*
1000
;
#else
clock_gettime
(
CLOCK_REALTIME
,
&
time_temp
);
#endif
}
else
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment