summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Dyer <cdyer@allegro.clab.cs.cmu.edu>2015-04-02 00:36:01 -0400
committerChris Dyer <cdyer@allegro.clab.cs.cmu.edu>2015-04-02 00:36:01 -0400
commit737ed7a7f932b1a7e40d2755bcdee6bc0aa2de63 (patch)
tree4b96f0bb309b85ae53e3044f4d9cd6de050cd6c1
parentb5d04f4c8a734796c347e5cb5a5053dd75696533 (diff)
fix PIC flag on old version of cmake
-rw-r--r--decoder/CMakeLists.txt8
-rw-r--r--utils/CMakeLists.txt6
2 files changed, 11 insertions, 3 deletions
diff --git a/decoder/CMakeLists.txt b/decoder/CMakeLists.txt
index ac07e9fe..b49d6477 100644
--- a/decoder/CMakeLists.txt
+++ b/decoder/CMakeLists.txt
@@ -3,9 +3,13 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../mteval)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../klm)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/..)
-PROJECT(decoder C CXX)
+PROJECT(decoder CXX)
-set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+if (CMAKE_VERSION VERSION_LESS 2.8.9) # TODO remove once we increase the cmake requirement
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -DPIC")
+else()
+ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+endif()
find_package(FLEX REQUIRED)
diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt
index 58668254..6982fa11 100644
--- a/utils/CMakeLists.txt
+++ b/utils/CMakeLists.txt
@@ -1,4 +1,8 @@
-set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+if (CMAKE_VERSION VERSION_LESS 2.8.9) # TODO remove once we increase the cmake requirement
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -DPIC")
+else()
+ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+endif()
set(TEST_SRCS dict_test.cc
logval_test.cc