Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
camtron
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
kr69sugu
camtron
Commits
74a7c29a
Commit
74a7c29a
authored
5 years ago
by
Andrews Sobral
Browse files
Options
Downloads
Patches
Plain Diff
Updated CMake file
parent
9220f565
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
+59
-37
59 additions, 37 deletions
CMakeLists.txt
with
59 additions
and
37 deletions
CMakeLists.txt
+
59
−
37
View file @
74a7c29a
cmake_minimum_required
(
VERSION 3.1
0
)
cmake_minimum_required
(
VERSION 3.1
)
project
(
bgslibrary
)
project
(
bgslibrary
)
# cmake -D BGS_PYTHON_SUPPORT=ON ..
include
(
CheckCXXCompilerFlag
)
if
(
NOT DEFINED BGS_PYTHON_SUPPORT
)
set
(
BGS_PYTHON_SUPPORT OFF
)
elseif
()
# add_definitions(-DBGS_PYTHON_SUPPORT)
endif
()
# cmake -D BGS_PYTHON_ONLY=ON ..
if
(
NOT DEFINED BGS_PYTHON_ONLY
)
set
(
BGS_PYTHON_ONLY OFF
)
elseif
()
# add_definitions(-DBGS_PYTHON_ONLY)
endif
()
# cmake -D BGS_CORE_STATIC=ON ..
if
(
NOT DEFINED BGS_CORE_STATIC
)
set
(
BGS_CORE_STATIC OFF
)
elseif
()
# add_definitions(-DBGS_CORE_STATIC)
endif
()
message
(
STATUS
""
)
message
(
STATUS
"BGS_PYTHON_SUPPORT:
${
BGS_PYTHON_SUPPORT
}
"
)
message
(
STATUS
"BGS_PYTHON_ONLY:
${
BGS_PYTHON_ONLY
}
"
)
message
(
STATUS
"BGS_CORE_STATIC:
${
BGS_CORE_STATIC
}
"
)
# cmake -D BGS_PYTHON_SUPPORT=ON -D BGS_PYTHON_VERSION=3 ..
if
(
NOT DEFINED BGS_PYTHON_VERSION
)
set
(
BGS_PYTHON_VERSION 3
)
endif
()
if
(
BGS_PYTHON_SUPPORT
)
message
(
STATUS
"PYTHON VERSION:
${
BGS_PYTHON_VERSION
}
"
)
endif
()
set
(
CMAKE_CXX_STANDARD 14
)
set
(
CMAKE_CXX_STANDARD 14
)
set
(
CMAKE_CXX_STANDARD_REQUIRED ON
)
set
(
CMAKE_CXX_EXTENSIONS OFF
)
set
(
CMAKE_POSITION_INDEPENDENT_CODE ON
)
function
(
append_if condition value
)
if
(
${
condition
}
)
foreach
(
variable
${
ARGN
}
)
set
(
${
variable
}
"
${${
variable
}}
${
value
}
"
PARENT_SCOPE
)
endforeach
(
variable
)
endif
()
endfunction
()
if
(
CMAKE_CXX_COMPILER_ID STREQUAL
"GNU"
OR
CMAKE_CXX_COMPILER_ID STREQUAL
"Clang"
OR
CMAKE_CXX_COMPILER_ID STREQUAL
"AppleClang"
)
check_cxx_compiler_flag
(
"-fvisibility-inlines-hidden"
SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG
)
append_if
(
SUPPORTS_FVISIBILITY_INLINES_HIDDEN_FLAG
"-fvisibility=hidden -fvisibility-inlines-hidden"
CMAKE_CXX_FLAGS
)
endif
()
if
(
UNIX
)
if
(
UNIX
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-std=gnu++0x"
)
#
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
set
(
CMAKE_MACOSX_RPATH 1
)
set
(
CMAKE_MACOSX_RPATH 1
)
endif
(
UNIX
)
endif
(
UNIX
)
...
@@ -46,8 +35,6 @@ if (POLICY CMP0042)
...
@@ -46,8 +35,6 @@ if (POLICY CMP0042)
cmake_policy
(
SET CMP0042 NEW
)
cmake_policy
(
SET CMP0042 NEW
)
endif
()
endif
()
set
(
CMAKE_POSITION_INDEPENDENT_CODE ON
)
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
#set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules)
#set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake-modules)
...
@@ -91,6 +78,37 @@ if(UNIX)
...
@@ -91,6 +78,37 @@ if(UNIX)
#ADD_DEFINITIONS(-Wconversion -Wfloat-equal)
#ADD_DEFINITIONS(-Wconversion -Wfloat-equal)
endif
(
UNIX
)
endif
(
UNIX
)
# cmake -D BGS_PYTHON_SUPPORT=ON ..
if
(
NOT DEFINED BGS_PYTHON_SUPPORT
)
set
(
BGS_PYTHON_SUPPORT OFF
)
else
()
# add_definitions(-DBGS_PYTHON_SUPPORT)
endif
()
# cmake -D BGS_PYTHON_ONLY=ON ..
if
(
NOT DEFINED BGS_PYTHON_ONLY
)
set
(
BGS_PYTHON_ONLY OFF
)
else
()
# add_definitions(-DBGS_PYTHON_ONLY)
endif
()
# cmake -D BGS_CORE_STATIC=ON ..
if
(
NOT DEFINED BGS_CORE_STATIC
)
set
(
BGS_CORE_STATIC OFF
)
else
()
# add_definitions(-DBGS_CORE_STATIC)
endif
()
message
(
STATUS
""
)
message
(
STATUS
"BGS_PYTHON_SUPPORT:
${
BGS_PYTHON_SUPPORT
}
"
)
message
(
STATUS
"BGS_PYTHON_ONLY:
${
BGS_PYTHON_ONLY
}
"
)
message
(
STATUS
"BGS_CORE_STATIC:
${
BGS_CORE_STATIC
}
"
)
# cmake -D BGS_PYTHON_SUPPORT=ON -D BGS_PYTHON_VERSION=3 ..
if
(
NOT DEFINED BGS_PYTHON_VERSION
)
set
(
BGS_PYTHON_VERSION 3
)
endif
()
if
(
BGS_PYTHON_SUPPORT
)
message
(
STATUS
"PYTHON VERSION:
${
BGS_PYTHON_VERSION
}
"
)
endif
()
set
(
OpenCV_STATIC OFF
)
set
(
OpenCV_STATIC OFF
)
find_package
(
OpenCV REQUIRED
)
find_package
(
OpenCV REQUIRED
)
if
(
OpenCV_FOUND
)
if
(
OpenCV_FOUND
)
...
@@ -196,9 +214,13 @@ if(${OpenCV_VERSION} VERSION_LESS 2.4.3)
...
@@ -196,9 +214,13 @@ if(${OpenCV_VERSION} VERSION_LESS 2.4.3)
endif
()
endif
()
if
(
BGS_CORE_STATIC
)
if
(
BGS_CORE_STATIC
)
message
(
STATUS
"Bulding bgslibrary_core STATIC"
)
add_library
(
bgslibrary_core STATIC
${
bgs_src
}
${
tools_src
}
${
utils_src
}
${
bgs_inc
}
${
tools_inc
}
${
utils_inc
}
)
add_library
(
bgslibrary_core STATIC
${
bgs_src
}
${
tools_src
}
${
utils_src
}
${
bgs_inc
}
${
tools_inc
}
${
utils_inc
}
)
elseif
()
#set_property(TARGET bgslibrary_core PROPERTY POSITION_INDEPENDENT_CODE ON)
else
()
message
(
STATUS
"Bulding bgslibrary_core SHARED"
)
add_library
(
bgslibrary_core SHARED
${
bgs_src
}
${
tools_src
}
${
utils_src
}
${
bgs_inc
}
${
tools_inc
}
${
utils_inc
}
)
add_library
(
bgslibrary_core SHARED
${
bgs_src
}
${
tools_src
}
${
utils_src
}
${
bgs_inc
}
${
tools_inc
}
${
utils_inc
}
)
target_link_libraries
(
bgslibrary_core
${
OpenCV_LIBS
}
)
# generates the export header bgslibrary_core_EXPORTS.h automatically
# generates the export header bgslibrary_core_EXPORTS.h automatically
include
(
GenerateExportHeader
)
include
(
GenerateExportHeader
)
GENERATE_EXPORT_HEADER
(
bgslibrary_core
GENERATE_EXPORT_HEADER
(
bgslibrary_core
...
@@ -206,8 +228,7 @@ elseif()
...
@@ -206,8 +228,7 @@ elseif()
EXPORT_MACRO_NAME bgslibrary_core_EXPORTS
EXPORT_MACRO_NAME bgslibrary_core_EXPORTS
EXPORT_FILE_NAME bgslibrary_core_EXPORTS.h
EXPORT_FILE_NAME bgslibrary_core_EXPORTS.h
STATIC_DEFINE BGSLIBRARY_CORE_EXPORTS_BUILT_AS_STATIC
)
STATIC_DEFINE BGSLIBRARY_CORE_EXPORTS_BUILT_AS_STATIC
)
target_link_libraries
(
bgslibrary_core
${
OpenCV_LIBS
}
)
#set_property(TARGET bgslibrary_core PROPERTY PUBLIC_HEADER ${bgs_inc} ${tools_inc} ${utils_inc})
set_property
(
TARGET bgslibrary_core PROPERTY PUBLIC_HEADER
${
bgs_inc
}
${
tools_inc
}
${
utils_inc
}
)
endif
()
endif
()
if
(
BGS_PYTHON_SUPPORT
)
if
(
BGS_PYTHON_SUPPORT
)
...
@@ -227,6 +248,7 @@ if(BGS_PYTHON_SUPPORT)
...
@@ -227,6 +248,7 @@ if(BGS_PYTHON_SUPPORT)
# Set the output library name to bgslibrary because that's what setup.py and distutils expects.
# Set the output library name to bgslibrary because that's what setup.py and distutils expects.
set_property
(
TARGET bgs_python PROPERTY OUTPUT_NAME
"pybgs"
)
set_property
(
TARGET bgs_python PROPERTY OUTPUT_NAME
"pybgs"
)
#set_property(TARGET bgs_python PROPERTY POSITION_INDEPENDENT_CODE ON)
endif
()
endif
()
#if(WIN32)
#if(WIN32)
...
...
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