build: include and link to globally searched libraries
This commit is contained in:
@@ -110,9 +110,7 @@ function(build_lib)
|
||||
endif()
|
||||
|
||||
# Split ns and non-ns libraries to manage their propagation properly
|
||||
set(non_ns_libraries_to_link
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
)
|
||||
set(non_ns_libraries_to_link ${CMAKE_THREAD_LIBS_INIT})
|
||||
|
||||
set(ns_libraries_to_link)
|
||||
|
||||
|
||||
@@ -536,6 +536,9 @@ macro(process_options)
|
||||
|
||||
if(${SQLite3_FOUND})
|
||||
set(ENABLE_SQLITE True)
|
||||
add_definitions(-DHAVE_SQLITE3)
|
||||
include_directories(${SQLite3_INCLUDE_DIRS})
|
||||
link_libraries(${SQLite3_LIBRARIES})
|
||||
else()
|
||||
message(${HIGHLIGHTED_STATUS} "SQLite was not found")
|
||||
endif()
|
||||
@@ -635,6 +638,11 @@ macro(process_options)
|
||||
)
|
||||
else()
|
||||
message(STATUS "GTK3 was found.")
|
||||
if(${GCC})
|
||||
add_definitions(-Wno-parentheses)
|
||||
endif()
|
||||
include_directories(${GTK3_INCLUDE_DIRS} ${HarfBuzz_INCLUDE_DIRS})
|
||||
link_libraries(${GTK3_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -660,6 +668,8 @@ macro(process_options)
|
||||
else()
|
||||
message(STATUS "LibXML2 was found.")
|
||||
add_definitions(-DHAVE_LIBXML2)
|
||||
include_directories(${LIBXML2_INCLUDE_DIR})
|
||||
link_libraries(${LIBXML2_LIBRARIES})
|
||||
endif()
|
||||
|
||||
# LibRT
|
||||
@@ -678,6 +688,7 @@ macro(process_options)
|
||||
message(STATUS "LibRT was found.")
|
||||
set(ENABLE_REALTIME TRUE)
|
||||
set(HAVE_RT TRUE) # for core-config.h
|
||||
link_libraries(${LIBRT_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
@@ -735,6 +746,8 @@ macro(process_options)
|
||||
set(CMAKE_INSTALL_RPATH "${DEVELOPER_DIR}" CACHE STRING "")
|
||||
endif()
|
||||
endif()
|
||||
include_directories(${Python3_INCLUDE_DIRS})
|
||||
link_libraries(${Python3_LIBRARIES})
|
||||
else()
|
||||
message(${HIGHLIGHTED_STATUS}
|
||||
"Python: development libraries were not found"
|
||||
@@ -863,6 +876,8 @@ macro(process_options)
|
||||
else()
|
||||
message(STATUS "MPI was found.")
|
||||
add_definitions(-DNS3_MPI)
|
||||
include_directories(${MPI_CXX_INCLUDE_DIRS})
|
||||
link_libraries(${MPI_CXX_LIBRARIES})
|
||||
set(ENABLE_MPI TRUE)
|
||||
endif()
|
||||
endif()
|
||||
@@ -891,6 +906,8 @@ macro(process_options)
|
||||
else()
|
||||
message(STATUS "GSL was found.")
|
||||
add_definitions(-DHAVE_GSL)
|
||||
include_directories(${GSL_INCLUDE_DIRS})
|
||||
link_libraries(${GSL_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -2079,6 +2096,7 @@ endfunction()
|
||||
function(get_target_includes target output)
|
||||
set(include_directories)
|
||||
get_target_property(include_dirs ${target} INCLUDE_DIRECTORIES)
|
||||
list(REMOVE_DUPLICATES include_dirs)
|
||||
foreach(include_dir ${include_dirs})
|
||||
if(include_dir MATCHES "<")
|
||||
# Skip CMake build and install interface includes
|
||||
|
||||
@@ -94,7 +94,7 @@ int main (int argc, char *argv[]) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifndef STATS_HAS_SQLITE3
|
||||
#ifndef HAVE_SQLITE3
|
||||
if (format == "db") {
|
||||
NS_LOG_ERROR ("sqlite support not compiled in.");
|
||||
return -1;
|
||||
@@ -300,7 +300,7 @@ int main (int argc, char *argv[]) {
|
||||
NS_LOG_INFO ("Creating omnet formatted data output.");
|
||||
output = CreateObject<OmnetDataOutput>();
|
||||
} else if (format == "db") {
|
||||
#ifdef STATS_HAS_SQLITE3
|
||||
#ifdef HAVE_SQLITE3
|
||||
NS_LOG_INFO ("Creating sqlite formatted data output.");
|
||||
output = CreateObject<SqliteDataOutput>();
|
||||
#endif
|
||||
|
||||
@@ -20,10 +20,5 @@ if(${ENABLE_MPI})
|
||||
${libnix-vector-routing}
|
||||
${libapplications}
|
||||
${libmpi}
|
||||
${MPI_CXX_LIBRARIES}
|
||||
)
|
||||
target_include_directories(
|
||||
brite-MPI-example
|
||||
PUBLIC ${MPI_CXX_INCLUDE_DIRS}
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -9,26 +9,12 @@ if(${GTK3_FOUND})
|
||||
set(gtk3_headers
|
||||
model/gtk-config-store.h
|
||||
)
|
||||
include_directories(
|
||||
${GTK3_INCLUDE_DIRS}
|
||||
${HarfBuzz_INCLUDE_DIRS}
|
||||
)
|
||||
set(gtk_libraries
|
||||
${GTK3_LIBRARIES}
|
||||
)
|
||||
if(${GCC})
|
||||
add_definitions(-Wno-parentheses)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(${LIBXML2_FOUND})
|
||||
set(xml2_sources
|
||||
model/xml-config.cc
|
||||
)
|
||||
set(xml2_libraries
|
||||
${LIBXML2_LIBRARIES}
|
||||
)
|
||||
include_directories(${LIBXML2_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
build_lib(
|
||||
@@ -45,9 +31,6 @@ build_lib(
|
||||
${gtk3_headers}
|
||||
model/file-config.h
|
||||
model/config-store.h
|
||||
LIBRARIES_TO_LINK
|
||||
${libcore}
|
||||
${libnetwork}
|
||||
${xml2_libraries}
|
||||
${gtk_libraries}
|
||||
LIBRARIES_TO_LINK ${libcore}
|
||||
${libnetwork}
|
||||
)
|
||||
|
||||
@@ -3,11 +3,6 @@ set(libraries_to_link)
|
||||
|
||||
set(gsl_test_sources)
|
||||
if(${GSL_FOUND})
|
||||
include_directories(${GSL_INCLUDE_DIRS})
|
||||
set(libraries_to_link
|
||||
${libraries_to_link}
|
||||
${GSL_LIBRARIES}
|
||||
)
|
||||
set(gsl_test_sources
|
||||
test/rng-test-suite.cc
|
||||
test/random-variable-stream-test-suite.cc
|
||||
@@ -74,13 +69,8 @@ if(${ENABLE_REALTIME})
|
||||
model/realtime-simulator-impl.h
|
||||
model/wall-clock-synchronizer.h
|
||||
)
|
||||
set(libraries_to_link
|
||||
${libraries_to_link}
|
||||
${LIBRT}
|
||||
)
|
||||
endif()
|
||||
|
||||
set(osclock_sources)
|
||||
set(osclock_sources
|
||||
model/unix-system-wall-clock-ms.cc
|
||||
)
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
include_directories(${MPI_CXX_INCLUDE_DIRS})
|
||||
|
||||
set(example_as_test_suite)
|
||||
if(${ENABLE_EXAMPLES})
|
||||
set(example_as_test_suite
|
||||
@@ -23,9 +21,7 @@ build_lib(
|
||||
model/mpi-interface.h
|
||||
model/mpi-receiver.h
|
||||
model/parallel-communication-interface.h
|
||||
LIBRARIES_TO_LINK
|
||||
${libcore}
|
||||
${libnetwork}
|
||||
${MPI_CXX_LIBRARIES}
|
||||
LIBRARIES_TO_LINK ${libcore}
|
||||
${libnetwork}
|
||||
TEST_SOURCES ${example_as_test_suite}
|
||||
)
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
include_directories(${MPI_CXX_INCLUDE_DIRS})
|
||||
link_libraries(${MPI_CXX_LIBRARIES})
|
||||
|
||||
set(base_examples
|
||||
simple-distributed
|
||||
simple-distributed-mpi-comm
|
||||
|
||||
@@ -11,9 +11,7 @@ if(${ENABLE_MPI})
|
||||
)
|
||||
set(mpi_libraries
|
||||
${libmpi}
|
||||
${MPI_CXX_LIBRARIES}
|
||||
)
|
||||
include_directories(${MPI_CXX_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
build_lib(
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
set(sqlite_sources)
|
||||
set(sqlite_header)
|
||||
set(sqlite_libraries)
|
||||
if(${ENABLE_SQLITE})
|
||||
set(sqlite_sources
|
||||
model/sqlite-data-output.cc
|
||||
@@ -10,10 +9,6 @@ if(${ENABLE_SQLITE})
|
||||
model/sqlite-data-output.h
|
||||
model/sqlite-output.h
|
||||
)
|
||||
include_directories(${SQLite3_INCLUDE_DIRS})
|
||||
set(sqlite_libraries
|
||||
${SQLite3_LIBRARIES}
|
||||
)
|
||||
endif()
|
||||
|
||||
set(source_files
|
||||
@@ -74,7 +69,6 @@ build_lib(
|
||||
SOURCE_FILES ${source_files}
|
||||
HEADER_FILES ${header_files}
|
||||
LIBRARIES_TO_LINK ${libcore}
|
||||
${sqlite_libraries}
|
||||
TEST_SOURCES
|
||||
test/average-test-suite.cc
|
||||
test/basic-data-calculators-test-suite.cc
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
include_directories(${Python3_INCLUDE_DIRS})
|
||||
|
||||
build_lib(
|
||||
LIBNAME visualizer
|
||||
SOURCE_FILES model/pyviz.cc
|
||||
model/visual-simulator-impl.cc
|
||||
HEADER_FILES model/pyviz.h
|
||||
LIBRARIES_TO_LINK
|
||||
${Python3_LIBRARIES}
|
||||
${libcore}
|
||||
${libinternet}
|
||||
${libwifi}
|
||||
|
||||
@@ -1,11 +1,3 @@
|
||||
set(gsl_libraries)
|
||||
if(${GSL_FOUND})
|
||||
include_directories(${GSL_INCLUDE_DIRS})
|
||||
set(gsl_libraries
|
||||
${GSL_LIBRARIES}
|
||||
)
|
||||
endif()
|
||||
|
||||
set(source_files
|
||||
helper/athstats-helper.cc
|
||||
helper/spectrum-wifi-helper.cc
|
||||
@@ -291,7 +283,6 @@ build_lib(
|
||||
${libspectrum}
|
||||
${libantenna}
|
||||
${libmobility}
|
||||
${gsl_libraries}
|
||||
TEST_SOURCES
|
||||
test/block-ack-test-suite.cc
|
||||
test/channel-access-manager-test.cc
|
||||
|
||||
Reference in New Issue
Block a user