From bbae6384e103cc8bdba5b7242e1ba64cafbf1655 Mon Sep 17 00:00:00 2001 From: nswain Date: Fri, 4 May 2018 13:27:15 -0600 Subject: [PATCH] Fixes for conda build. --- CMakeLists.txt | 21 +++++---------------- condabuildinfo.cmake | 2 +- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dd84ee0c1..75c0da6fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,5 @@ +set(CMAKE_CXX_STANDARD 11) +set(POSITION_INDEPENDENT_CODE True) cmake_minimum_required(VERSION 3.1.2) cmake_policy(SET CMP0015 NEW) # Link Directory Pathing set(CMAKE_DEBUG_POSTFIX _d) @@ -18,12 +20,9 @@ endif() IF(IS_CONDA_BUILD) include(${CMAKE_CURRENT_LIST_DIR}/condabuildinfo.cmake) - if(CMAKE_COMPILER_IS_GNUCXX) - add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) - endif() + ELSE() # If we are not using conda, we are using conan # C++11 Support - set (CMAKE_CXX_STANDARD 11) # Conan setup include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) @@ -121,14 +120,6 @@ if(BUILD_TESTING) else() set(RUNNERNAME "runner") endif() - -# install( -# FILES "${CMAKE_BINARY_DIR}/${RUNNERNAME}" -# DESTINATION "bin" -# PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE -# OWNER_READ GROUP_READ -# OWNER_WRITE GROUP_WRITE -# ) endif() endif() @@ -143,10 +134,8 @@ target_link_libraries(${PROJECT_NAME} target_link_libraries(${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT} ) -if(NOT WIN32) - set_target_properties(${PROJECT_NAME} PROPERTIES - COMPILE_FLAGS "-fPIC" - ) +if(UNIX AND NOT APPLE) + target_link_libraries(${PROJECT_NAME} rt) endif() # Install recipe diff --git a/condabuildinfo.cmake b/condabuildinfo.cmake index 1674ca7bd..ad021db00 100644 --- a/condabuildinfo.cmake +++ b/condabuildinfo.cmake @@ -1,6 +1,6 @@ set(BOOST_ROOT ${CMAKE_INSTALL_PREFIX}) set(Boost_USE_STATIC_LIBS TRUE) -find_package(Boost REQUIRED log_setup log timer) +find_package(Boost REQUIRED log_setup log timer thread) set(EXT_INCLUDE_DIRS ${Boost_INCLUDE_DIRS}) set(EXT_LIB_DIRS ${Boost_LIBRARY_DIRS}) set(EXT_LIBS ${Boost_LIBRARIES})