diff options
-rw-r--r-- | CMakeLists.txt | 27 | ||||
-rw-r--r-- | src/3rd_party/fast_align/CMakeLists.txt | 4 | ||||
-rwxr-xr-x | src/CMakeLists.txt | 2 |
3 files changed, 20 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a967d89f..38bb502a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,11 @@ cmake_minimum_required(VERSION 3.5.1) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) -project(amunn C CXX) +project(amunmt C CXX) + +set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/build) +set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}) +set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}) set(CMAKE_CXX_FLAGS_RELEASE "-std=c++14 -fPIC -O3 -Ofast -m64 -march=native -funroll-loops -ffinite-math-only -Wno-unused-result -Wno-deprecated -pthread") set(CMAKE_CXX_FLAGS_DEBUG "-std=c++14 -fPIC -g -O0 -m64 -march=native -funroll-loops -ffinite-math-only -Wno-unused-result -Wno-deprecated -pthread") @@ -29,6 +33,13 @@ if(CUDA) add_definitions(-DCUDA) SET(CUDA_PROPAGATE_HOST_FLAGS OFF) message("-- Compiling with CUDA support") + + if (MARIAN) + execute_process(COMMAND git submodule update --init --recursive + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + add_subdirectory(marian) + endif(MARIAN) + else(CUDA_FOUND) add_definitions(-DNO_CUDA) message("-- Cannot find CUDA libraries. Compiling without them." ) @@ -38,10 +49,6 @@ else(CUDA) add_definitions(-DNO_CUDA) endif(CUDA) -if (MARIAN) - add_subdirectory(marian) -endif(MARIAN) - find_package(Boost COMPONENTS system filesystem program_options timer iostreams python thread) if(Boost_FOUND) include_directories(${Boost_INCLUDE_DIRS}) @@ -69,11 +76,11 @@ IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git) FIND_PACKAGE(Git) IF(GIT_FOUND) EXECUTE_PROCESS( - COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" - OUTPUT_VARIABLE "AMUNMT_BUILD_VERSION" - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) + COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + OUTPUT_VARIABLE "AMUNMT_BUILD_VERSION" + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) MESSAGE( STATUS "Git version: ${AMUNMT_BUILD_VERSION}" ) ELSE(GIT_FOUND) SET(AMUNMT_BUILD_VERSION 0) diff --git a/src/3rd_party/fast_align/CMakeLists.txt b/src/3rd_party/fast_align/CMakeLists.txt index 20d7b199..9380dff4 100644 --- a/src/3rd_party/fast_align/CMakeLists.txt +++ b/src/3rd_party/fast_align/CMakeLists.txt @@ -18,5 +18,5 @@ endif(OPENMP_FOUND) add_executable(fast_align src/fast_align.cc src/ttables.cc) add_executable(atools src/alignment_io.cc src/atools.cc) -set_target_properties(fast_align PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") -set_target_properties(atools PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") +set_target_properties(fast_align PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") +set_target_properties(atools PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cabd6e0a..89f2ed7c 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -145,7 +145,7 @@ foreach(exec ${EXES}) else(CUDA_FOUND) target_link_libraries(${exec} ${EXT_LIBS}) endif(CUDA_FOUND) - set_target_properties(${exec} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") + set_target_properties(${exec} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") endforeach(exec) add_subdirectory(3rd_party) |