Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dynamic-graph
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
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
Stack Of Tasks
dynamic-graph
Commits
de5e4ed5
Commit
de5e4ed5
authored
14 years ago
by
Olivier Stasse
Browse files
Options
Downloads
Patches
Plain Diff
Add detection of boost.
parent
3265f81d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CMakeLists.txt
+46
-1
46 additions, 1 deletion
CMakeLists.txt
with
46 additions
and
1 deletion
CMakeLists.txt
+
46
−
1
View file @
de5e4ed5
...
...
@@ -61,7 +61,52 @@ ENDIF (\"${CMAKE_BUILD_TYPE}\" STREQUAL \"\")
OPTION
(
BUILD_SHARED_LIBS
"Build
${
PROJECT_NAME
}
with shared libraries."
ON
)
OPTION
(
GENERATE_DOC
"Generate html documentation"
OFF
)
OPTION
(
USE_BOOST
"Compile with boost."
ON
)
# --- BOOST ---------------------------------------------------
SET
(
Boost_THREAD_FOUND 0
)
FIND_PACKAGE
(
Boost COMPONENTS thread
)
IF
(
Boost_THREAD_FOUND
)
#MESSAGE(STATUS "Boost_THREAD_LIBRARY:" ${Boost_THREAD_LIBRARY})
#MESSAGE(STATUS "Boost_THREAD_LIBRARY_RELEASE:" ${Boost_THREAD_LIBRARY_RELEASE})
#MESSAGE(STATUS "Boost_THREAD_LIBRARY_DEBUG:" ${Boost_THREAD_LIBRARY_DEBUG})
# Look for the type of pattern to find.
SET
(
BOOST_PATTERN_TOFIND
""
)
IF
(
${
CMAKE_BUILD_TYPE
}
MATCHES RELEASE
)
SET
(
BOOST_PATTERN_TOFIND optimized
)
ENDIF
(
${
CMAKE_BUILD_TYPE
}
MATCHES RELEASE
)
IF
(
${
CMAKE_BUILD_TYPE
}
MATCHES DEBUG
)
SET
(
BOOST_PATTERN_TOFIND debug
)
ENDIF
(
${
CMAKE_BUILD_TYPE
}
MATCHES DEBUG
)
IF
(
BOOST_PATTERN_TOFIND
)
SET
(
BOOST_THREAD_LIST_LENGTH 0
)
LIST
(
LENGTH Boost_THREAD_LIBRARY BOOST_THREAD_LIST_LENGTH
)
# Debug or optimized library.
IF
(
${
BOOST_THREAD_LIST_LENGTH
}
MATCHES 4
)
LIST
(
FIND Boost_THREAD_LIBRARY
${
BOOST_PATTERN_TOFIND
}
BTLB_index
)
LIST
(
REMOVE_AT Boost_THREAD_LIBRARY
${
BTLB_index
}
)
LIST
(
GET Boost_THREAD_LIBRARY
${
BTLB_index
}
BOOST_THREAD_LIB_NAME
)
# Default strategy
ELSE
(
${
BOOST_THREAD_LIST_LENGTH
}
MATCHES 4
)
SET
(
BOOST_THREAD_LIB_NAME
${
Boost_THREAD_LIBRARY
}
)
ENDIF
(
${
BOOST_THREAD_LIST_LENGTH
}
MATCHES 4
)
# Default strategy
ELSE
(
BOOST_PATTERN_TOFIND
)
SET
(
BOOST_THREAD_LIB_NAME
${
Boost_THREAD_LIBRARY
}
)
ENDIF
(
BOOST_PATTERN_TOFIND
)
ELSE
(
Boost_THREAD_FOUND
)
MESSAGE
(
"WARNING: Boost thread not found. Trying without the thread library"
)
FIND_PACKAGE
(
Boost
)
IF
(
NOT Boost_FOUND
)
MESSAGE
(
SEND_ERROR
"!! ERROR: Boost not found."
)
ENDIF
(
NOT Boost_FOUND
)
ENDIF
(
Boost_THREAD_FOUND
)
MESSAGE
(
STATUS
"Boost thread lib name:
${
BOOST_THREAD_LIB_NAME
}
${
Boost_THREAD_LIBRARY
}
"
)
INCLUDE_DIRECTORIES
(
${
Boost_INCLUDE_DIRS
}
)
LINK_DIRECTORIES
(
${
Boost_LIBRARY_DIRS
}
)
#
# Look for dependencies
...
...
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