Commit 5fa41aab authored by Ghislain MARY's avatar Ghislain MARY

Fix definition of BCTBX_STATIC and export BCTOOLBOX_CPPFLAGS with CMake.

parent 9396af5e
......@@ -147,6 +147,12 @@ if(POLARSSL_FOUND)
include_directories(${POLARSSL_INCLUDE_DIRS})
endif()
set(BCTOOLBOX_CPPFLAGS )
if(ENABLE_STATIC)
set(BCTBX_STATIC 1)
list(APPEND BCTOOLBOX_CPPFLAGS "-DBCTBX_STATIC")
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/config.h PROPERTIES GENERATED ON)
add_definitions("-DHAVE_CONFIG_H")
......@@ -194,7 +200,6 @@ if(APPLE)
endif()
string(REPLACE ";" " " LINK_FLAGS_STR "${LINK_FLAGS}")
if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
set(EXPORT_TARGETS_NAME "LinphoneBuilder")
else()
......
......@@ -28,6 +28,7 @@
# BCTOOLBOX_FOUND - system has bctoolbox
# BCTOOLBOX_INCLUDE_DIRS - the bctoolbox include directory
# BCTOOLBOX_LIBRARIES - The libraries needed to use bctoolbox
# BCTOOLBOX_CPPFLAGS - The compilation flags needed to use bctoolbox
# BCTOOLBOX_LDFLAGS - The linking flags needed to use bctoolbox
# BCTOOLBOX_${comp}_FOUND - system has bctoolbox "comp" component
# BCTOOLBOX_${comp}_INCLUDE_DIRS - the bctoolbox "comp" component include directory
......@@ -48,6 +49,7 @@ else()
set(BCTOOLBOX_INCLUDE_DIRS "${BCTOOLBOX_CMAKE_DIR}/../../../include")
endif()
set(BCTOOLBOX_CPPFLAGS @BCTOOLBOX_CPPFLAGS@)
set(BCTOOLBOX_LDFLAGS "@LINK_FLAGS_STR@")
set(BCTOOLBOX_LIBRARIES )
foreach(comp ${BcToolbox_FIND_COMPONENTS})
......
......@@ -27,3 +27,5 @@
#cmakedefine HAVE_CU_SET_TRACE_HANDLER 1
#cmakedefine HAVE_LIBRT 1
#cmakedefine BCTBX_STATIC
......@@ -59,7 +59,6 @@ if(ENABLE_STATIC)
target_link_libraries(bctoolbox-static ${CMAKE_THREAD_LIBS_INIT})
if(WIN32)
target_link_libraries(bctoolbox-static "Winmm" "Ws2_32")
target_compile_definitions(bctoolbox-static PUBLIC "-DBCTBX_STATIC")
endif()
set_target_properties(bctoolbox-static PROPERTIES LINKER_LANGUAGE "CXX")
if(NOT CMAKE_VERSION VERSION_LESS 3.1)
......@@ -76,9 +75,6 @@ if(ENABLE_STATIC)
add_library(bctoolbox-tester-static STATIC ${BCTOOLBOX_TESTER_SOURCE_FILES})
set_target_properties(bctoolbox-tester-static PROPERTIES OUTPUT_NAME bctoolbox-tester)
target_link_libraries(bctoolbox-tester-static bctoolbox-static)
if(WIN32)
target_compile_definitions(bctoolbox-tester-static PUBLIC "-DBCTBX_STATIC")
endif()
endif()
endif()
if(ENABLE_SHARED)
......
......@@ -16,6 +16,9 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#define _CRT_RAND_S
#include <stddef.h>
......
......@@ -15,6 +15,11 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "bctoolbox/logging.h"
#include "bctoolbox/map.h"
#include <map>
......
......@@ -18,6 +18,10 @@ License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "bctoolbox/logging.h"
#include "bctoolbox/list.h"
#include <time.h>
......
......@@ -18,7 +18,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "bctoolbox/logging.h"
#include "bctoolbox/port.h"
......
......@@ -17,6 +17,10 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "bctoolbox/vfs.h"
#include "bctoolbox/port.h"
#include "bctoolbox/logging.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment