aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt11
1 files changed, 8 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6216b2cde..f0eec53f7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,6 +10,8 @@ find_package(Boost COMPONENTS graph REQUIRED)
add_definitions(${QT_DEFINITIONS})
+option(AVOID_PROTECTED_HACK "Avoid protected hack on generated bindings." FALSE)
+
if (MSVC)
set(CMAKE_CXX_FLAGS "/DWIN32 /D_WINDOWS /w /EHsc- /GS- /GR- /DLIBSHIBOKEN_BUILD -D_SCL_SECURE_NO_WARNINGS")
else()
@@ -19,9 +21,12 @@ else()
set(CMAKE_CXX_FLAGS "-g -Wall -fvisibility=hidden")
endif()
endif()
-if (WIN32)
-add_definitions("-DAVOID_PROTECTED_HACK")
-endif(WIN32)
+if (WIN32 OR AVOID_PROTECTED_HACK)
+ message(STATUS "Avoiding protected hack!")
+ add_definitions("-DAVOID_PROTECTED_HACK")
+else()
+ message(STATUS "Using protected hack!")
+endif()
set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is /lib${LIB_SUFFIX})" FORCE)