Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
core
tarantool
Commits
2c97da81
Commit
2c97da81
authored
11 years ago
by
Roman Tsisyk
Browse files
Options
Downloads
Patches
Plain Diff
CMake fix for find_optional_package
parent
381f7f3e
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
cmake/FindOptionalPackage.cmake
+15
-8
15 additions, 8 deletions
cmake/FindOptionalPackage.cmake
src/plugin/mysql/CMakeLists.txt
+2
-0
2 additions, 0 deletions
src/plugin/mysql/CMakeLists.txt
src/plugin/pg/CMakeLists.txt
+1
-1
1 addition, 1 deletion
src/plugin/pg/CMakeLists.txt
with
18 additions
and
9 deletions
cmake/FindOptionalPackage.cmake
+
15
−
8
View file @
2c97da81
...
...
@@ -8,17 +8,24 @@ endif()
macro
(
find_optional_package _package
)
string
(
TOUPPER
${
_package
}
_packageUpper
)
if
(
WITH_
${
_packageUpper
}
)
# WITH_${_packageUpper} option requested by the user
if
(
NOT DEFINED WITH_
${
_packageUpper
}
)
# First run and WITH_${_packageUpper} option is not set by the user.
# Enable auto-mode and try to find package.
find_package
(
${
_package
}
${
ARGN
}
)
elseif
(
WITH_
${
_packageUpper
}
)
# Non-first run or WITH_${_packageUpper} was set by the user.
# Force error if the package will not be found.
set
(
${
_packageUpper
}
_FIND_REQUIRED ON
)
endif
()
option
(
WITH_
${
_packageUpper
}
"Search for
${
_package
}
package"
ON
)
if
(
WITH_
${
_packageUpper
}
)
find_package
(
${
_package
}
${
ARGN
}
)
else
(
WITH_
${
_packageUpper
}
)
set
(
${
_package
}
_FOUND OFF
)
set
(
${
_packageUpper
}
_FOUND OFF
)
endif
()
if
(
${
_package
}
_FOUND OR
${
_packageUpper
}
_FOUND
)
set
(
_default ON
)
else
()
set
(
_default OFF
)
endif
()
# Add the user option and (!) update the cache
option
(
WITH_
${
_packageUpper
}
"Search for
${
_package
}
package"
${
_default
}
)
# Now ${WITH_${_packageUpper}} is either ON or OFF
file
(
APPEND
"
${
_OptionalPackagesFile
}
"
"-- WITH_
${
_packageUpper
}
=
${
WITH_
${
_packageUpper
}}
\n
"
)
endmacro
(
find_optional_package
)
...
...
This diff is collapsed.
Click to expand it.
src/plugin/mysql/CMakeLists.txt
+
2
−
0
View file @
2c97da81
...
...
@@ -8,4 +8,6 @@ if (MYSQL_FOUND)
add_library
(
mysql SHARED mysql.cc
)
target_link_libraries
(
mysql
${
MYSQL_LIBRARIES
}
)
install
(
TARGETS mysql LIBRARY DESTINATION
${
PLUGIN_DIR
}
)
else
()
message
(
STATUS
"MySQL client not found, box.net.sql(mysql) disabled"
)
endif
()
This diff is collapsed.
Click to expand it.
src/plugin/pg/CMakeLists.txt
+
1
−
1
View file @
2c97da81
...
...
@@ -11,6 +11,6 @@ if (PostgreSQL_FOUND)
install
(
TARGETS pg LIBRARY DESTINATION
${
PLUGIN_DIR
}
)
else
()
message
(
STATUS
"PostgreSQL client not found"
)
message
(
STATUS
"PostgreSQL client not found
, box.net.sql(pg) disabled
"
)
endif
()
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