From c081ce1f393605b706ad0b6e29f6117d9499579e Mon Sep 17 00:00:00 2001 From: Denes Matetelki Date: Mon, 29 Jul 2013 15:13:11 +0200 Subject: [PATCH] library is build by CMakeLists.txt in lib/cpp_utils and not by one under build --- CMakeLists.txt | 9 ++++++++- build/CMakeLists.txt | 19 ------------------- lib/CMakeLists.txt | 1 + lib/cpp_utils/CMakeLists.txt | 5 +++++ test/CMakeLists.txt | 2 +- 5 files changed, 15 insertions(+), 21 deletions(-) delete mode 100644 build/CMakeLists.txt create mode 100644 lib/CMakeLists.txt create mode 100644 lib/cpp_utils/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 6353a2a..0fd5b0d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,14 @@ cmake_minimum_required (VERSION 2.6) project (CPP_UTILS_LIB) -add_subdirectory (build) +set(CMAKE_CXX_COMPILER "/usr/bin/g++-4.7") + +set (CXX_FLAGS "-Wall -Wextra -pedantic -Weffc++ -Wshadow " + "-Wpointer-arith -Wcast-qual " + "-ggdb -fprofile-arcs -ftest-coverage -std=c++0x") +add_definitions( ${CXX_FLAGS} ) + +add_subdirectory (lib) add_subdirectory (test EXCLUDE_FROM_ALL) add_subdirectory (other EXCLUDE_FROM_ALL) diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt deleted file mode 100644 index 5c9a9f3..0000000 --- a/build/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -cmake_minimum_required (VERSION 2.6) -project (CPP_UTILS_LIB) - -set(CMAKE_CXX_COMPILER "/usr/lib/colorgcc/bin/g++") - -set (CXX_FLAGS "-Wall -Wextra -pedantic -Weffc++ -Wshadow " - "-Wpointer-arith -Wcast-qual " - "-ggdb -fprofile-arcs -ftest-coverage -std=c++0x") -add_definitions( ${CXX_FLAGS} ) - -include_directories (../lib/cpp_utils/) -aux_source_directory(../lib/cpp_utils/ CPP_UTILS_LIB_SOURCES) - -add_library (CppUtils SHARED ${CPP_UTILS_LIB_SOURCES}) - -add_library( mysqlclient SHARED IMPORTED ) -set_target_properties( mysqlclient PROPERTIES IMPORTED_LOCATION /usr/lib/mysql/libmysqlclient.so ) - -target_link_libraries(CppUtils pthread rt gcov ssl mysqlclient) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt new file mode 100644 index 0000000..26c2b3b --- /dev/null +++ b/lib/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory (cpp_utils) \ No newline at end of file diff --git a/lib/cpp_utils/CMakeLists.txt b/lib/cpp_utils/CMakeLists.txt new file mode 100644 index 0000000..099bab3 --- /dev/null +++ b/lib/cpp_utils/CMakeLists.txt @@ -0,0 +1,5 @@ +include_directories (.) +aux_source_directory(. CPPUTILS_SOURCES) + +add_library (CppUtils SHARED ${CPPUTILS_SOURCES}) +target_link_libraries(CppUtils pthread rt gcov ssl mysqlclient) \ No newline at end of file diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index b7b6fec..413f4b2 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,5 +1,5 @@ -set(CMAKE_CXX_COMPILER "/usr/lib/colorgcc/bin/g++") +set(CMAKE_CXX_COMPILER "/usr/bin/g++-4.7") set (CXX_FLAGS "-Wall -Wextra -pedantic -Weffc++ -Wshadow " "-Wpointer-arith -Wcast-qual "