Skip to content

Commit

Permalink
Merge pull request #206 from Olllom/cmake_fixes
Browse files Browse the repository at this point in the history
update cmake files for conda build
  • Loading branch information
beniz authored May 27, 2020
2 parents 1d3b64a + 9aad782 commit 4083409
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ option (USE_OPENMP "Use OpenMP for multithreading" ON)
option (ENABLE_SURROG "support for surrogates" ON)
set (HAVE_SURROG ${ENABLE_SURROG})
option (USE_COMPILE_FEATURES "use cmake>=3.1 cxx11 detection" ON)
option (LINK_PYTHON "link python libraries" ON)

# Offer the user the choice of overriding the installation directories
set (INSTALL_LIB_DIR lib${LIB_SUFFIX} CACHE PATH "Installation directory for libraries")
Expand Down
7 changes: 6 additions & 1 deletion python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ include_directories (${NUMPY_INCLUDE_DIRS})
include_directories (${Boost_INCLUDE_DIRS})

python_add_module (lcmaes lcmaes.cc)

target_link_libraries(lcmaes cmaes ${Boost_LIBRARIES})
if (LINK_PYTHON)

if (WIN32)
target_link_libraries(lcmaes ${PYTHON_LIBRARIES})
elseif (APPLE)
set_target_properties(lcmaes PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
endif ()


install (TARGETS lcmaes DESTINATION ${PYTHON_SITE_PACKAGES})

set (PYINSTALLCHECK_ENVIRONMENT "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}")
Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ macro (cmaes_add_test name)
target_link_libraries (t_${name} cmaes)
add_test (NAME ${name} COMMAND t_${name})
if (WIN32)
set_tests_properties (${name} PROPERTIES ENVIRONMENT "PATH=${PROJECT_BINARY_DIR}\\src\\${CMAKE_BUILD_TYPE};$ENV{PATH}") # to load dll
set_tests_properties (${name} PROPERTIES ENVIRONMENT "PATH=${PROJECT_BINARY_DIR}\\src\\${CMAKE_BUILD_TYPE};${PROJECT_BINARY_DIR}\\src;$ENV{PATH}") # to load dll
endif ()
endmacro ()

Expand Down

0 comments on commit 4083409

Please sign in to comment.