<p>I am using this cmake for compilation of code:</p>

<pre><code>cmake_minimum_required(VERSION 3.3)
project(hmm)
set(PROJECT_VERSION "0.0.1")

# Default configuration values. These must be before the project command or
# they won't work in Windows.
# If no build type is specified, default to "Release"
if (NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE Release CACHE STRING
            "None Debug Release RelWithDebInfo MinSizeRel"
            FORCE)
endif()
# Install to "dist" directory in Windows for testing and as a staging directory
# for the installer.
if (WIN32 AND NOT CMAKE_INSTALL_PREFIX)
    set(CMAKE_INSTALL_PREFIX dist CACHE STRING "Install path prefix.")
endif()

if (NOT MSVC)
    # Enable the C++11 standard
    set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -std=c++11)
endif()

set(CMAKE_BUILD_TYPE "Debug")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")

find_package(Boost REQUIRED)
find_package(MLPACK REQUIRED)


include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
add_definitions(${Boost_DEFINITIONS})

include_directories(${MLPACK_INCLUDE_DIRS})
link_directories(${MLPACK_LIBRARY_DIRS})
add_definitions(${MLPACK_DEFINITIONS})

# Global CMake options
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)

# Testing configuration
enable_testing()
#add_subdirectory(source)

file(GLOB SOURCE_FILES
        source/*.h
        source/*.cpp)

add_executable(${CMAKE_PROJECT_NAME} ${SOURCE_FILES})

MESSAGE(STATUS ${Boost_LIBRARIES})

target_link_libraries(${CMAKE_PROJECT_NAME}
        ${MLPACK_LIBRARIES}
        ${Boost_LIBRARIES} )
</code></pre>

<p>The cmake is able to detect boost. I dont know why its not able to link. How can I fix this?</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/mlpack/mlpack/issues/785#issuecomment-247300690">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJ4bFIzxiHvaOqZFuit34tQcLbcwpLAVks5qqSijgaJpZM4J9ffT">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFEZIbH75e18dlw-WKgWgYxX0Sfpjks5qqSijgaJpZM4J9ffT.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/mlpack/mlpack/issues/785#issuecomment-247300690"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/mlpack/mlpack","title":"mlpack/mlpack","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/mlpack/mlpack"}},"updates":{"snippets":[{"icon":"PERSON","message":"@daemonSlayer in #785: I am using this cmake for compilation of code:\r\n```\r\ncmake_minimum_required(VERSION 3.3)\r\nproject(hmm)\r\nset(PROJECT_VERSION \"0.0.1\")\r\n\r\n# Default configuration values. These must be before the project command or\r\n# they won't work in Windows.\r\n# If no build type is specified, default to \"Release\"\r\nif (NOT CMAKE_BUILD_TYPE)\r\n    set(CMAKE_BUILD_TYPE Release CACHE STRING\r\n            \"None Debug Release RelWithDebInfo MinSizeRel\"\r\n            FORCE)\r\nendif()\r\n# Install to \"dist\" directory in Windows for testing and as a staging directory\r\n# for the installer.\r\nif (WIN32 AND NOT CMAKE_INSTALL_PREFIX)\r\n    set(CMAKE_INSTALL_PREFIX dist CACHE STRING \"Install path prefix.\")\r\nendif()\r\n\r\nif (NOT MSVC)\r\n    # Enable the C++11 standard\r\n    set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -std=c++11)\r\nendif()\r\n\r\nset(CMAKE_BUILD_TYPE \"Debug\")\r\nset(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} \"${CMAKE_SOURCE_DIR}/cmake\")\r\n\r\nfind_package(Boost REQUIRED)\r\nfind_package(MLPACK REQUIRED)\r\n\r\n\r\ninclude_directories(${Boost_INCLUDE_DIRS})\r\nlink_directories(${Boost_LIBRARY_DIRS})\r\nadd_definitions(${Boost_DEFINITIONS})\r\n\r\ninclude_directories(${MLPACK_INCLUDE_DIRS})\r\nlink_directories(${MLPACK_LIBRARY_DIRS})\r\nadd_definitions(${MLPACK_DEFINITIONS})\r\n\r\n# Global CMake options\r\nset(CMAKE_INCLUDE_CURRENT_DIR ON)\r\nset(CMAKE_AUTOMOC ON)\r\n\r\n# Testing configuration\r\nenable_testing()\r\n#add_subdirectory(source)\r\n\r\nfile(GLOB SOURCE_FILES\r\n        source/*.h\r\n        source/*.cpp)\r\n\r\nadd_executable(${CMAKE_PROJECT_NAME} ${SOURCE_FILES})\r\n\r\nMESSAGE(STATUS ${Boost_LIBRARIES})\r\n\r\ntarget_link_libraries(${CMAKE_PROJECT_NAME}\r\n        ${MLPACK_LIBRARIES}\r\n        ${Boost_LIBRARIES} )\r\n```\r\nThe cmake is able to detect boost. I dont know why its not able to link. How can I fix this?"}],"action":{"name":"View Issue","url":"https://github.com/mlpack/mlpack/issues/785#issuecomment-247300690"}}}</script>