Re: [CMake] Building with Cmake using Boost problem

2016-03-19 Thread Hendrik Sattler


Am 16. März 2016 22:13:14 MEZ, schrieb Karel Geiregat :

>According to the cmake documentation of FindBoost
> you have to
>name
>the required libraries as described;
>
>"date_time" for "libboost_date_time"

You do NOT have to rename any files! Doing so completely defeats the purpose of 
a find module.

Additionally, .lib files for Microsoft compilers do NOT start like libxxx.lib 
but only xxx.lib
Building boost with your compiler should give you the right files as-is.

Why are you reading documentation of cmake 3.0 when using cmake 3.5? I cannot 
find anything in the documentation of the boost find module about renaming.
However it documents steps to debug problems.

HS

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

[CMake] Building with Cmake using Boost problem

2016-03-19 Thread Karel Geiregat
Dear people at cmake


Today, I have a problem with using cmake and Boost to build up Apache Avro
, which is a data-serializer.I have to use that
"avro" which can be built with cmake and boost. However, there is a problem
when building up the component by using the CMakeLists.txt file.

I have put an SO question

on this matter, but there, I didn't have gotten an useful answer/comment so
far. After placing the question, i have done further searches in the
meanwhile to find a solution. I have now the latest, stable builds, but
still no success.

First, the versions of Cmake and Boost and my OS:

   - cmake: v3.5.0
   - Boost: v1.60.0
   - OS: Windows 10 64 bit

cmake is a part of the system path:

PS C:\Users\geire> cmake -version
> cmake version 3.5.0
>
> CMake suite maintained and supported by Kitware (kitware.com/cmake).
>


Now, I want to build up avro, you have to use cmake. My target platform is
C++, so i used the C++ version there. The CMakeLists.txt content is here
below;

#
> # Licensed to the Apache Software Foundation (ASF) under one
> # or more contributor license agreements.  See the NOTICE file
> # distributed with this work for additional information
> # regarding copyright ownership.  The ASF licenses this file
> # to you under the Apache License, Version 2.0 (the
> # "License"); you may not use this file except in compliance
> # with the License.  You may obtain a copy of the License at
> #
> #   http://www.apache.org/licenses/LICENSE-2.0
> #
> # Unless required by applicable law or agreed to in writing,
> # software distributed under the License is distributed on an
> # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> # KIND, either express or implied.  See the License for the
> # specific language governing permissions and limitations
> # under the License.
> #
> cmake_minimum_required (VERSION 2.6)
>
> set (CMAKE_LEGACY_CYGWIN_WIN32 0)
>
> if (NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
> set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
> endif()
>
> if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/VERSION.txt)
> file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION.txt" AVRO_VERSION)
> else (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/VERSION.txt)
> file(READ "${CMAKE_CURRENT_SOURCE_DIR}/../../share/VERSION.txt"
> AVRO_VERSION)
> endif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/VERSION.txt)
>
> set (AVRO_VERSION_MAJOR ${AVRO_VERSION})
> set (AVRO_VERSION_MINOR "0")
>
> project (Avro-cpp)
>
> if (WIN32 AND NOT CYGWIN AND NOT MSYS)
> add_definitions (/EHa)
> add_definitions (
> -DBOOST_REGEX_DYN_LINK
> -DBOOST_FILESYSTEM_DYN_LINK
> -DBOOST_SYSTEM_DYN_LINK
> -DBOOST_IOSTREAMS_DYN_LINK
> -DBOOST_PROGRAM_OPTIONS_DYN_LINK
> -DBOOST_ALL_NO_LIB)
> endif()
>
> if (CMAKE_COMPILER_IS_GNUCXX)
> set(CMAKE_CXX_FLAGS "-Wall")
> endif ()
>
>
>
> #  edit, these 2 lines here below are original
> # find_package (Boost 1.38 REQUIRED
> #COMPONENTS filesystem system program_options iostreams)
> # === commented these 2 lines here above and added the following here
> below till "end edit"


>
set(BOOST_ROOT D:/software/boost_1_60_0)
> set(BOOST_INCLUDEDIR D:/software/boost_1_60_0/boost)
> set(BOOST_LIBRARYDIR D:/software/boost_1_60_0/stage/lib)
>
> find_package(Boost 1.54.0
>COMPONENTS filesystem system program_options iostreams REQUIRED
> )
>
> # end edit
>
> add_definitions (${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
>
> include_directories (api ${CMAKE_CURRENT_BINARY_DIR} ${Boost_INCLUDE_DIRS})
>
> set (AVRO_SOURCE_FILES
> impl/Compiler.cc impl/Node.cc
> impl/NodeImpl.cc impl/ResolverSchema.cc impl/Schema.cc
> impl/Types.cc impl/ValidSchema.cc impl/Zigzag.cc
> impl/BinaryEncoder.cc impl/BinaryDecoder.cc
> impl/Stream.cc impl/FileStream.cc
> impl/Generic.cc impl/GenericDatum.cc
> impl/DataFile.cc
> impl/parsing/Symbol.cc
> impl/parsing/ValidatingCodec.cc
> impl/parsing/JsonCodec.cc
> impl/parsing/ResolvingDecoder.cc
> impl/json/JsonIO.cc
> impl/json/JsonDom.cc
> impl/Resolver.cc impl/Validator.cc
> )
>
> add_library (avrocpp SHARED ${AVRO_SOURCE_FILES})
>
> set_property (TARGET avrocpp
> APPEND PROPERTY COMPILE_DEFINITIONS AVRO_DYN_LINK)
>
> add_library (avrocpp_s STATIC ${AVRO_SOURCE_FILES})
>
> set_property (TARGET avrocpp avrocpp_s
> APPEND PROPERTY COMPILE_DEFINITIONS AVRO_SOURCE)
>
> set_target_properties (avrocpp PROPERTIES
> VERSION ${AVRO_VERSION_MAJOR}.${AVRO_VERSION_MINOR})
>
> set_target_properties (avrocpp_s PROPERTIES
> VERSION ${AVRO_VERSION_MAJOR}.${AVRO_VERSION_MINOR})
>
> target_link_libraries (avrocpp ${Boost_LIBRARIES})
>
> add_executable (precompile test/precompile.cc)
>
> target_link_libraries (precompile avrocpp_s ${Boost_LIBRARIES})
>
> macro (gen file ns)
> add_custom_command (OUTPUT ${file}.h

Re: [CMake] Building with Cmake using Boost problem (Karel Geiregat)

2016-03-19 Thread Karel Geiregat
OH GOD !

Just saying, i have spent 3 days finding a solution to this problem since
the files got provided from a 3th party provider. The team that got
assigned to this project asked me (i'm senior QA and responsible for
further development). In the meanwhile, this project has to be set in
standby phase because of the building problems.

We, all, and especially I certainly have overlooked on that part. I didn't
understood it well. When i have generated the dll's using the build process
described in Boost manuals ... cmake found the libraries !
Now, an other issue arises. But at least cmake is now able to find the
boost libraries ^^

Thanks !

2016-03-16 22:35 GMT+01:00 Knox, Kent :

> It looks like you built static libraries with b2:
> PS D:\software\boost_1_60_0\stage\lib> Get-ChildItem libboost_filesystem*
> > -name
> > libboost_filesystem-vc140-mt-1_60.lib
> > libboost_filesystem-vc140-mt-gd-1_60.lib
>
> But I believe you are telling cmake (or boost preprocessor?) to search for
> dynamic libraries:
> > add_definitions (
> > -DBOOST_REGEX_DYN_LINK
> > -DBOOST_FILESYSTEM_DYN_LINK
> > -DBOOST_SYSTEM_DYN_LINK
>
> Try building dynamic (.dll w/ import libs) boost libraries and see if
> cmake finds them.
>
> Kent
> 
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] Building with Cmake using Boost problem (Karel Geiregat)

2016-03-18 Thread Knox, Kent
It looks like you built static libraries with b2:
PS D:\software\boost_1_60_0\stage\lib> Get-ChildItem libboost_filesystem*
> -name
> libboost_filesystem-vc140-mt-1_60.lib
> libboost_filesystem-vc140-mt-gd-1_60.lib

But I believe you are telling cmake (or boost preprocessor?) to search for 
dynamic libraries:
> add_definitions (
> -DBOOST_REGEX_DYN_LINK
> -DBOOST_FILESYSTEM_DYN_LINK
> -DBOOST_SYSTEM_DYN_LINK

Try building dynamic (.dll w/ import libs) boost libraries and see if cmake 
finds them.

Kent

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake