Linking against libi2ncommon
authorGuilherme Maciel Ferreira <guilherme.maciel.ferreira@intra2net.com>
Wed, 23 Mar 2011 12:48:53 +0000 (13:48 +0100)
committerGuilherme Maciel Ferreira <guilherme.maciel.ferreira@intra2net.com>
Wed, 23 Mar 2011 12:48:53 +0000 (13:48 +0100)
src/CMakeLists.txt

index dd72446..aadb2a3 100644 (file)
@@ -3,17 +3,19 @@ set(Boost_USE_STATIC_LIBS ON)
 set(Boost_USE_MULTITHREADED ON)
 set(Boost_USE_STATIC_RUNTIME OFF)
 find_package(Boost COMPONENTS filesystem program_options REQUIRED)
+include_directories(${Boost_INCLUDE_DIRS})
+link_directories(${Boost_LIBRARY_DIRS})
 
 # package: find external packages
 include(FindPkgConfig)
+
+# package: libi2ncommon
 pkg_check_modules(I2NCOMMON REQUIRED libi2ncommon)
+include_directories(${I2NCOMMON_INCLUDE_DIRS})
+link_directories(${I2NCOMMON_LIBRARY_DIRS})
 
 # compiler: include directories where the source code is located
-include_directories(
-    ${Boost_INCLUDE_DIRS}
-    ${I2NCOMMON_INCLUDE_DIRS}
-    ${CMAKE_CURRENT_SOURCE_DIR}
-)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
 
 # compiler: source code files
 set(SOURCES
@@ -35,17 +37,11 @@ set(SOURCES
 # compiler: creates the binary
 add_executable(${TARGET} ${SOURCES})
 
-# linker: libraries search path
-link_directories(
-    ${Boost_LIBRARY_DIRS}
-#    ${I2NCOMMON_LIBRARY_DIRS}
-)
-
 # linker: link the program against the libraries
 target_link_libraries(
     ${TARGET}
     ${Boost_LIBRARIES}
-#    ${I2NCOMMON_LIBRARIES}
+    ${I2NCOMMON_LIBRARIES}
 )
 
 # creates the install rule for the binary