Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
cmake_minimum_required(VERSION 3.8)
project(qualisys_cpp_sdk)

# By default set release configuration
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding and forcing the compilation of the shared library you can simply add

Suggested change
option(SUFFIX_SO_VERSION "Suffix library name with its version" ON)

See suggestion below for the deletion of the SHARED parameter.

if(UNIX)
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif()
endif()

Comment on lines +9 to +14
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CMake equivalent of adding -fPIC is CMAKE_POSITION_INDEPENDENT_CODE
So it should be more like this:

Suggested change
if(UNIX)
if(CMAKE_COMPILER_IS_GNUCXX OR CV_ICC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif()
endif()
if(SUFFIX_SO_VERSION)
option(CMAKE_POSITION_INDEPENDENT_CODE "Use position independent code" ON)
endif()

option(BUILD_EXAMPLES "Build examples" OFF)

add_library(${PROJECT_NAME}
SHARED
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This above suggestions

Suggested change
SHARED

Markup.cpp
Network.cpp
RTPacket.cpp
Expand Down