Re: [CMake] Freetype on linux systems in non-standard directories

2016-06-07 Thread Kristian
Hey Andreas,

thanks for your answer. Yes, that also works :)

2016-06-07 16:58 GMT-04:00 Andreas Naumann :

> Hey Kristian,
>
> as the documentation
> https://github.com/Kitware/CMake/blob/master/Modules/FindFreetype.cmake
> at line 21 states, FREETYPE_DIR is an environment variable.
> So, if you change your line
> set(FREETYPE_DIR "/home/kristian/Documents/freetype/freetype")
> to
> set(ENV{FREETYPE_DIR} "/home/kristian/Documents/freetype/freetype")
> I would assume, your script will work.
>
> Hth,
> Andreas
>
> Am 07.06.2016 um 22:47 schrieb Kristian:
>
>> Hey guys,
>>
>> I wanted to try something out with CMake and latest version of freetype
>> (2.6.3). So I downloaded freetype, compiled it with the commands
>>
>> > ./configure --prefix=/home/kristian/Documents/freetype/freetype
>> > make
>> > make install
>>
>> After that, I created a small C++-file and a CMakeLists.txt. The C++-file
>> depends on freetype, so my CMakeLists.txt looks like this:
>>
>> =
>>
>> > cmake_minimum_required(VERSION 3.5)
>> > project(freetype_ex)
>> >
>> > set(FREETYPE_DIR "/home/kristian/Documents/freetype/freetype")
>> > find_package(Freetype)
>> >
>> > set(SOURCES main.cpp)
>> >
>> > include_directories(${FREETYPE_INCLUDE_DIRS})
>> >
>> > add_executable(${PROJECT_NAME} ${SOURCES})
>> > target_link_libraries(${PROJECT_NAME} ${FREETYPE_LIBRARIES})
>>
>> =
>>
>> But when calling cmake, I am getting this error:
>> =
>>
>> > -- Could NOT find Freetype (missing: FREETYPE_LIBRARY
>> FREETYPE_INCLUDE_DIRS)
>> > CMake Error: The following variables are used in this project, but they
>> are set to NOTFOUND.
>> > Please set them or make sure they are set and tested correctly in the
>> CMake files:
>> > FREETYPE_LIBRARY (ADVANCED)
>> > linked by target "freetype_ex" in directory
>> /home/kristian/Documents/freetype/cmake
>> >
>> > -- Configuring incomplete, errors occurred!
>> > See also
>> "/home/kristian/Documents/freetype/cmake/CMakeFiles/CMakeOutput.log".
>>
>> =
>>
>> This sort of error seems for me to be a bug, because I would assume, that
>> when I set the variable FREETYPE_DIR, then CMake would also look at this
>> dir.
>>
>> I looked at the FindFreetype.cmake file (
>> https://github.com/Kitware/CMake/blob/master/Modules/FindFreetype.cmake)
>> and my first assumption is, that it would help, to add something like
>> ${FREETYPE_DIR} the the find_path calls.
>>
>> What do you think of this? Another idea is, to add another variable
>> instead of FREETYPE_DIR, e.g. FREETYPE_ROOT_DIR...
>>
>>
>>
> --
>
> 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

[CMake] CPack and executable permissions on linux

2016-06-08 Thread Kristian
Hey guys,

I am creating a RPM package with CMake. Here is a small example of how it
looks:



cmake_minimum_required(VERSION 3.5)

set(BOOST_LIB "${CMAKE_CURRENT_SOURCE_DIR}/boost")

file(GLOB_RECURSE BOOST_LIBRARIES ${BOOST_LIB}/*)

install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/usr/bin/executable DESTINATION
bin)
install(FILES ${BOOST_LIBRARIES} DESTINATION lib)

set(CPACK_GENERATOR "RPM")
set(CPACK_PACKAGE_VERSION 6.5)
set(CPACK_PACKAGE_NAME "executable-proj")
# set(CPACK_RPM_PACKAGE_NAME "executable-proj")
set(CPACK_RPM_PACKAGE_SUMMARY "Simple executable project")
set(CPACK_RPM_PACKAGE_ARCHITECTURE x86_64)
set(CPACK_PACKAGE_VENDOR "Some Vendor Limited")
set(CPACK_RPM_PACKAGE_MAINTAINER "Some Vendor Limited")
set(CPACK_RPM_PACKAGE_AUTOREQ "NO")
set(CPACK_PACKAGE_EXECUTABLES "executable")

INCLUDE(CPack)

==

Before running this cmake script, I am setting executable permissions on
the build machine, where the package is created.

Then, I create a docker image, where this RPM is downloaded and installed.
But when I want to start the executable within a docker container, then I
am getting the message "permission denied".
When I look at the permissions of my installed package, then I see, I only
have read permissions.

So the question is: What can I do for getting executable permissions for
this executable? Is this a CMake/CPack problem?
-- 

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] CPack and executable permissions on linux

2016-06-09 Thread Kristian
Thanks for all answers. I had to read the documentation before asking :-D

I changed the line for the executable from
> install(FILES ...
into
> install(PROGRAMS ...

That worked and as far as i can see is sufficient for my requirements.

2016-06-08 20:09 GMT+02:00 Domen Vrankar :

> > This could probably be supported by adding USE_SOURCE_PERMISSIONS for
> > install(FILES ...) would you be willing to contribute a patch?
>
> Misses that this is not cmake-dev mailing list... Patch would still be
> appreciated but you could also file a feature request (for extending
> the documentation regarding default permissions and adding
> USE_SOURCE_PERMISSIONS) here:
> https://cmake.org/Bug/view_all_bug_page.php
> Currently registration is disabled so if you don't have an account I
> could do it for you.
>
> Regards,
> Domen
>
-- 

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] execute_process, cmd /c and vcvarsall

2016-06-10 Thread Kristian
After some tries I found maybe a solution for you. In my small example, I
had these lines, which are working:


> set(HELLO1 "C:/Program Files (x86)/Microsoft Visual Studio
14.0/VC/vcvarsall.bat")
> execute_process(COMMAND ${HELLO1} && msbuild /help WORKING_DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}")

So for you, it would look like this (I am not very sure about it):

==


execute_process( COMMAND $ENV{VS${VS_IDE_VERSION}
0COMNTOOLS}../../VC/vcvarsall.bat x86_amd64 &&  ${CUDA_NVCC_EXECUTABLE}
${OpenCV_SOURCE_DIR}/cmake/checks/OpenCVDetectCudaArch.cu --run

 WORKING_DIRECTORY
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/"

 RESULT_VARIABLE _nvcc_res OUTPUT_VARIABLE _nvcc_out

 OUTPUT_STRIP_TRAILING_WHITESPACE)

==

Anyhow, when I tried several types of your presentation, I got always some
errors. I do not know, if this is a bug or not, but I will write them down
here. Maybe some of the others could write something about it.


*** First try ***

> set(HELLO1 "C:/Program Files (x86)/Microsoft Visual Studio
14.0/VC/vcvarsall.bat")
> execute_process(COMMAND cmd /c "call ${HELLO1}" WORKING_DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}" RESULT_VARIABLE _nvcc_res OUTPUT_VARIABLE
_nvcc_out)
> message("${_nvcc_out}")

When I call these lines on a windows machine, I am getting the error

> 'C:/Program' is not recognized as an internal or external command,
operable program or batch file.

*** Second try ***

When I change the execute_process to this

> execute_process(COMMAND cmd /c "call \"${HELLO1}\"" WORKING_DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}" RESULT_VARIABLE _nvcc_res OUTPUT_VARIABLE
_nvcc_out)

then I am getting this error

> '\"C:/Program Files (x86)/Microsoft Visual Studio
14.0/VC/vcvarsall.bat\"' is not recognized as an internal or external
command, operable program or batch file.

So now, CMake / Batch recognizes the right path, but somehow there are the
characters \".

*** Third try ***

I changed the definition of the variable HELLO1 into (because of some hints
here
https://superuser.com/questions/279008/how-do-i-escape-spaces-in-command-line-in-windows-without-using-quotation-marks
)

> set(HELLO1 "C:/Program^ Files^ (x86)/Microsoft^ Visual^ Studio^
14.0/VC/vcvarsall.bat")

But here, I am also getting the error

> 'C:/Program' is not recognized as an internal or external command,
operable program or batch file.

Even, when I double the carets ^^, then the same error occurs


2016-06-09 22:41 GMT+02:00 Adam Rankin :

> Hello all,
>
>
>
> I am trying to develop a execute_process command that will first load the
> env variables set by the appropriate vcvarsall, and then run a compile
> command. See here for my progress so far:
>
>
>
> set(cuda_generation_command cmd /c "\"call
> \"$ENV{VS${VS_IDE_VERSION}0COMNTOOLS}../../VC/vcvarsall.bat\" x86_amd64 &&
> \"${CUDA_NVCC_EXECUTABLE}\"
> \"${OpenCV_SOURCE_DIR}/cmake/checks/OpenCVDetectCudaArch.cu\" \"--run\"\"")
>
>
>
> execute_process( COMMAND ${cuda_generation_command}
>
>  WORKING_DIRECTORY
> "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/"
>
>  RESULT_VARIABLE _nvcc_res OUTPUT_VARIABLE _nvcc_out
>
>  OUTPUT_STRIP_TRAILING_WHITESPACE)
>
>
>
> When run at a command prompt, the command works as expected. When called
> from CMake, the output is:
>
> The filename, directory name, or volume label syntax is incorrect.
>
>
>
> Has anyone ever succeeded with something like this?
>
>
>
> Cheers,
>
> Adam
>
> --
>
> 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] cmake targeting vs2015 error

2016-06-15 Thread Kristian
Could you give us either the CMakeLists.txt or the whole cl command, which
was called?

Without of some more information, I could not give you a hint, where the
problem is.

2016-06-15 14:43 GMT-04:00 Welson Sun :

> cmake 3.4.3 on windows 7 targeting vs2015 error out:
>
> cl : Command line error D8021: invalid numeric argument
> '/Wno-variadic-macros'
>
>
> Thanks,
> Welson
>
> --
>
> 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] first WARNING message swallows all previous STATUS messages in cmake configure

2016-06-18 Thread Kristian
I have some questions for clarification:

Which CMake-Version do you use?
Which OS do you use? And where is the output of CMake written to?


2016-06-18 8:31 GMT-04:00 Ilias Miroslav :

> Dear experts,
>
>
> we are employing CMake buildup system in our project
> http://www.diracprogram.org. 
>
>
> We have a system of cmake files, many of them containing printouts in the
> form message(STATUS "...") .
>
>
> What happens, however, is when message (WARNING ...) appears during
> configure step all the previous  message(STATUS "...")- output
> statutes are gone. On the screen there is only the WARNING message, but no
> previous STATUS messages.
>
>
> Any help, how to fix it ? I would be glad to have all STATUS, WARNING
> (even FATAL) messages on the screen as it  helps the CMake development.
>
>
> Thanks, Miro
>
>
>
>
> --
>
> 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] Wrong version of cl.exe for x64

2016-08-22 Thread Kristian
Did you already tried to use the "Visual Studio 10 2010 Win64" generator?

*
https://cmake.org/cmake/help/v3.6/generator/Visual%20Studio%2010%202010.html
* https://cmake.org/cmake/help/v3.6/manual/cmake-generators.7.html

2016-08-22 9:27 GMT+02:00 tonka tonka :

> Hey,
>
> I have recently switched to cmake (instead of plain visual studio).
> Now i discovered a problem.cmake choose the wrong cl.exe for my x64
> project.
> Cmake choose bin/x86_amd64/cl.exe which is the “x64 Cross Tools“. This
> create x64 binaries, but with my big project I reach a out of memory linker
> error, because the cl.exe is wrong (this cl.exe is an 32bit compiler which
> can create x64 binaries).
> Cmake should choose bin/amd64/cl.exe to use a “real“ x64 compiler.
>
> Does anybody know how I can tell cmake to do that?
>
> Compiler: visual studio 2010 sp1
> OS: win 7 x64
> Cmake: 3.4.3
>
> Greetings
> Tonka
>
> --
>
> 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] CPack change file extension

2016-08-26 Thread Kristian
Hey,

you're working on Windows, right?

I think you can do that if you create an additional target and call that
target. So let's say, you have this 'hello.cpp', and you generate with
CMake a solution. This is an example of a CMakeLists.txt

> cmake_minimum_required(VERSION 3.4)
> project(cpack_zip_test)

> set(SOURCES hello.cpp)

> add_executable(${PROJECT_NAME} ${SOURCES})

> set(CPACK_GENERATOR "ZIP")
> set(CPACK_PACKAGE_EXECUTABLE ${PROJECT_NAME})
> set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-package)

> add_custom_target(rename_zip
> COMMAND rename ${CPACK_PACKAGE_FILE_NAME}.zip
${CPACK_PACKAGE_FILE_NAME}.docx
> WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})

> include(CPack)

When I call now something like this on the command line (Visual Studio 12
2013)

> devenv cpack_zip_test.sln /Rebuild Debug /project PACKAGE.vcxproj

and afterwards some like this

> devenv cpack_zip_test.sln /Rebuild Debug /project rename_zip.vcxproj

then this is some way of renaming your zip into a docx file. But I do not
know, if there is a more automatic way to do this. I tried it with an
additional parameter in the 'add_custom_target'-command (see at the DEPENDS
part):

> add_custom_target(rename_zip
> COMMAND rename ${CPACK_PACKAGE_FILE_NAME}.zip
${CPACK_PACKAGE_FILE_NAME}.docx
> DEPENDS PACKAGE
> WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})

But when I call 'devenv cpack_zip_test.sln /Rebuild Debug /project
rename_zip.vcxproj', I would assume, that first the PACKAGE target is
called, and afterwards the 'rename_zip' target is called. But that's not
the case. Maybe some other person can tell me, if this is a bug or this is
intention...

2016-08-24 21:53 GMT+02:00 tonka3...@gmail.com :

> Hey everybody,
>
> I try to rename the fileextension of my cpack zip file. So i use cpack -G
> ZIP to create the package and get my zip file. Now i need to rename these
> fileextension to another name, like microsoft did it with with docx word
> format, where the file is a zip file, but has the docx extension.
>
> Does anybody know how i can do that?
>
> Greetings
> Tonka
> --
>
> 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] CPack change file extension

2016-08-26 Thread Kristian
> Do you have any special reason why your rename target depends on PACKAGE,
is this the target which cpack is using?

I think so ...

2016-08-26 20:01 GMT+02:00 tonka3...@gmail.com :

> Hey Kristian,
>
> Thx for your answer. Iv've already done this like in your solution. I have
> a seperated target which depends on my create zip target and use
> ${CMAKE_COMMAND} -e copy to copy the file to my target directory (so the
> solution is platform independent), and leaf the original zip in the binary
> directory.
>
> Do you have any special reason why your rename target depends on PACKAGE,
> is this the target which cpack is using?
>
> Am 26.08.2016 um 19:05 schrieb Kristian :
>
> Hey,
>
> you're working on Windows, right?
>
> I think you can do that if you create an additional target and call that
> target. So let's say, you have this 'hello.cpp', and you generate with
> CMake a solution. This is an example of a CMakeLists.txt
>
> > cmake_minimum_required(VERSION 3.4)
> > project(cpack_zip_test)
>
> > set(SOURCES hello.cpp)
>
> > add_executable(${PROJECT_NAME} ${SOURCES})
>
> > set(CPACK_GENERATOR "ZIP")
> > set(CPACK_PACKAGE_EXECUTABLE ${PROJECT_NAME})
> > set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-package)
>
> > add_custom_target(rename_zip
> > COMMAND rename ${CPACK_PACKAGE_FILE_NAME}.zip
> ${CPACK_PACKAGE_FILE_NAME}.docx
> > WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
>
> > include(CPack)
>
> When I call now something like this on the command line (Visual Studio 12
> 2013)
>
> > devenv cpack_zip_test.sln /Rebuild Debug /project PACKAGE.vcxproj
>
> and afterwards some like this
>
> > devenv cpack_zip_test.sln /Rebuild Debug /project rename_zip.vcxproj
>
> then this is some way of renaming your zip into a docx file. But I do not
> know, if there is a more automatic way to do this. I tried it with an
> additional parameter in the 'add_custom_target'-command (see at the DEPENDS
> part):
>
> > add_custom_target(rename_zip
> > COMMAND rename ${CPACK_PACKAGE_FILE_NAME}.zip
> ${CPACK_PACKAGE_FILE_NAME}.docx
> > DEPENDS PACKAGE
> > WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
>
> But when I call 'devenv cpack_zip_test.sln /Rebuild Debug /project
> rename_zip.vcxproj', I would assume, that first the PACKAGE target is
> called, and afterwards the 'rename_zip' target is called. But that's not
> the case. Maybe some other person can tell me, if this is a bug or this is
> intention...
>
> 2016-08-24 21:53 GMT+02:00 tonka3...@gmail.com :
>
>> Hey everybody,
>>
>> I try to rename the fileextension of my cpack zip file. So i use cpack -G
>> ZIP to create the package and get my zip file. Now i need to rename these
>> fileextension to another name, like microsoft did it with with docx word
>> format, where the file is a zip file, but has the docx extension.
>>
>> Does anybody know how i can do that?
>>
>> Greetings
>> Tonka
>> --
>>
>> 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

[CMake] CPack - Transaction error

2017-05-09 Thread Kristian
Hi,

I want to generate a RPM package. My CMakeLists.txt looks loke this:

##

cmake_minimum_required(VERSION 3.5)

set(INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/ssp/)

install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/ssp-suite/" DESTINATION
${INSTALL_DIR})
install(PROGRAMS "${CMAKE_CURRENT_SOURCE_DIR}/ssp_script" DESTINATION bin)

set(CPACK_RPM_PACKAGE_REQUIRES "java-1.8.0-openjdk >= 1.8.0")

# ...

INCLUDE(CPack)



The idea is to install needed files for the software under /opt/ssp.
Now I generate a package with command

> cmake -DCMAKE_INSTALL_PREFIX=/opt -V --debug .

When I want to install that in a docker container, I get the error message



Transaction check error:
  file /opt from install of ssp-suite-7.1-1.x86_64 conflicts with file
from package filesystem-3.2-21.el7.x86_64

Error Summary



What is the problem?
-- 

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] CPack - Transaction error

2017-05-09 Thread Kristian
Thank you, that helped!

2017-05-09 15:24 GMT+02:00 Domen Vrankar :
>> Transaction check error:
>>   file /opt from install of ssp-suite-7.1-1.x86_64 conflicts with file
>> from package filesystem-3.2-21.el7.x86_64
>>
>> Error Summary
>
>
> Directory /opt is already owned by filesystem package but is not listed in
> CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST variable.
> Add /opt (and possibly other directories owned by other packages) to
> CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION [1] which is appended to paths
> listed in
> CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST.
>
>
> [1]
> https://cmake.org/cmake/help/v3.5/module/CPackRPM.html?highlight=cpack_rpm_exclude_from_auto_filelist#variable:CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION
>
> Regards,
> Domen
-- 

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] RPM package and relocation

2017-05-10 Thread Kristian
Hi,

I am creating an RPM package, which on a standard installation should
install the file into /opt/ssp-suite directory. But I want to give the
user the opportunity, to install the package into another directory.

I am doing this with these lines:

> set(INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/ssp-suite)
> install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/ssp/" DESTINATION 
> ${INSTALL_DIR})

and by running cmake with

> cmake -DCMAKE_INSTALL_PREFIX=/opt -V --debug .

But I also need to execute a post script, which runs after installation. I added

> set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE 
> "${CMAKE_CURRENT_SOURCE_DIR}/postinstall")

to my CMakeLists.txt and in that script, I am using the RPM variable
$RPM_INSTALL_PREFIX. But during installation, I get this error message

> chmod: cannot access '/usr/usr/bin/startssp': No such file or directory
> warning: %post(ssp-suite-7.1-1.x86_64) scriptlet failed, exit status 1
> Non-fatal POSTIN scriptlet failure in rpm package ssp-suite-7.1-1.x86_64

Can someone give me some hints, how to change / add lines to
CMakeListst.txt and my postinstall script, so that script can be fully
relocatable?
-- 

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] Create user and group with CPack

2017-07-20 Thread Kristian
Hi,

I create a RPM package with CPack. When installing this package on a
target system, it should create an additional user and group.

My current solution is a postinstall script, wich runs at the end of
the installation. There, I added commands to create a user and a group
(groupadd, useradd). But somehow, they aren't created when installing
this RPM package. For testing, I install this RPM package in a docker
container.

I also tried, if these commands (groupadd, useradd) are working on the
docker container and they are, so this shouldn't be a problem.

So, how can I create a user and a group with CPack / 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] Create user and group with CPack

2017-07-20 Thread Kristian
Hi,

thank you for your reply. Yes, I add the script with
> set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE 
> "${CMAKE_CURRENT_SOURCE_DIR}/postinstall")

and it basically works, because this file is changing a settings file
without any problems. Only the add of the group and the user does not
work, somehow.

This is the part in the postinstall script, which should add group and user:

=
WEB_USER=web1
WEB_GROUP=web1

# create group
groupadd "${WEB_GROUP}" --force --system
# retrieve group id
WEB_GROUP_ID="$(getent group '$WEB_GROUP' | cut -d: -f3)"
echo "Group '${WEB_GROUP}' added with id '${WEB_GROUP_ID}'"
# create user
useradd "$WEB_USER" -g "${WEB_GROUP_ID}" -M -r -s /sbin/nologin -c
"Web user - created during the installation."
echo "User '${WEB_USER}' added."
=

And this is, what is being printed during installation:
=
Group 'web1' added with id ''
useradd: group '' does not exist
User 'web1' added.
=


2017-07-20 11:17 GMT+02:00 Eric Noulard :
>
>
>
> 2017-07-20 10:39 GMT+02:00 Kristian :
>>
>> Hi,
>>
>> I create a RPM package with CPack. When installing this package on a
>> target system, it should create an additional user and group.
>>
>> My current solution is a postinstall script, wich runs at the end of
>> the installation. There, I added commands to create a user and a group
>> (groupadd, useradd). But somehow, they aren't created when installing
>> this RPM package.
>
>
> Did you specify this post install script to CPackRPM?
> https://cmake.org/cmake/help/v3.7/module/CPackRPM.html#variable:CPACK_RPM_POST_INSTALL_SCRIPT_FILE
>
> You can check that the generated RPM does include the script with:
>
>  rpm -qp --scripts  .rpm
>
>>
>> For testing, I install this RPM package in a docker
>> container.
>>
>> I also tried, if these commands (groupadd, useradd) are working on the
>> docker container and they are, so this shouldn't be a problem.
>>
>> So, how can I create a user and a group with CPack / 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
>
>
>
>
> --
> Eric
-- 

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] Create user and group with CPack

2017-07-20 Thread Kristian
Ok, I changed the postinstall script based on your suggestions:

i.e. I changed these two lines:
> WEB_GROUP_ID="$(getent group "${WEB_GROUP}" | cut -d: -f3)"
and
> useradd "$WEB_USER" -g "${WEB_GROUP}" -M -r -s /sbin/nologin -c

And it worked now. Thank you for your help. :)



2017-07-20 12:35 GMT+02:00 Eric Noulard :
>
>
> 2017-07-20 12:01 GMT+02:00 Kristian :
>>
>> Hi,
>>
>> thank you for your reply. Yes, I add the script with
>> > set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE
>> > "${CMAKE_CURRENT_SOURCE_DIR}/postinstall")
>>
>> and it basically works, because this file is changing a settings file
>> without any problems. Only the add of the group and the user does not
>> work, somehow.
>>
>> This is the part in the postinstall script, which should add group and
>> user:
>>
>> =
>> WEB_USER=web1
>> WEB_GROUP=web1
>>
>> # create group
>> groupadd "${WEB_GROUP}" --force --system
>> # retrieve group id
>> WEB_GROUP_ID="$(getent group '$WEB_GROUP' | cut -d: -f3)"
>> echo "Group '${WEB_GROUP}' added with id '${WEB_GROUP_ID}'"
>> # create user
>> useradd "$WEB_USER" -g "${WEB_GROUP_ID}" -M -r -s /sbin/nologin -c
>> "Web user - created during the installation."
>> echo "User '${WEB_USER}' added."
>> =
>>
>> And this is, what is being printed during installation:
>> =
>> Group 'web1' added with id ''
>> useradd: group '' does not exist
>> User 'web1' added.
>> =
>
>
> What is the shebang your ar using at the top of this script?
>
> this syntax:
> WEB_GROUP_ID="$(getent group '$WEB_GROUP' | cut -d: -f3)"
>
> may be bash only.
>
> not sure it makes a difference but you could try:
>
> WEB_GROUP_ID="$(getent group '${WEB_GROUP}' | cut -d: -f3)"
>
> note that getting the numeric group id seems unecessary.
>
> useradd "$WEB_USER" -g "${WEB_GROUP}" -M -r -s /sbin/nologin -c
>
> should work, useradd should work equally well with numeric or symbolic id of
> a group.
>
>
> --
> Eric
-- 

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] PreprocessToFile

2018-05-05 Thread Kristian
Hi,

I have a Visual Studio 2015 Solution with some C++ projects in it. I
try to generate the same solution and the projects with CMake. Now,
there is a part, where I do not know how to solve this.

In a vcxproj file, there is something like this written:

=


  
false
  

  
false
  

=

So, now my question: Is it possible, to get the same result with CMake here?
-- 

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:
https://cmake.org/mailman/listinfo/cmake


[CMake] CMake and a simple java example

2015-12-07 Thread Kristian
Dear All,

I am learning CMake, and one of my personal lessons is combine Java
and CMake. I made a small example (HelloWorld.java):

==

public class HelloWorld
{
   public static void main(String[] args)
   {
  System.out.println("Hey :)");
   }
}

==

And a CMakeLists.txt file:

==

cmake_minimum_required(VERSION 2.8)
project(HelloWorld)

find_package(Java REQUIRED)
include(UseJava)

set(JAR_NAME HelloWorld)
set(JAVA_SOURCE_DIRECTORY )
set(JAVA_SOURCE_FILES ${JAVA_SOURCE_DIRECTORY}/HelloWorld.java)
add_jar(${JAR_NAME} ${JAVA_SOURCE_FILES})

==

Then I go into that directory where the CMakeLists.txt is and start the command

==
cmake --target=HelloWorld --build .
==

Output is:

==

-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found Java: /usr/bin/java (found version "1.8.0.66")
-- Jar file /home/some/Downloads/HelloWorld/HelloWorld.jar
-- Class compiled to /home/some/Downloads/HelloWorld/CMakeFiles/HelloWorld.dir
-- Configuring done
-- Generating done
-- Build files have been written to: /home/some/Downloads/HelloWorld

==

But when I start the command "make", then I get the following output:

==

Scanning dependencies of target HelloWorld
make[2]: *** No rule to make target `/HelloWorld.java', needed by
`CMakeFiles/HelloWorld.dir/java_compiled_HelloWorld'.  Stop.
make[1]: *** [CMakeFiles/HelloWorld.dir/all] Error 2
make: *** [all] Error 2

==

Can you tell me, what I am doing wrong?
-- 

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] CMake and BZip2

2016-02-11 Thread Kristian
Hey,

I have a small C++ file, which uses some functions of the library
bzip2. On a Debian derivate, I have installed needed packages with

 * sudo apt-get install bzip2 libzip2 libbz2-dev

Here is my CMakeLists.txt:

=

project(bzip2Example)
cmake_minimum_required(VERSION 2.8)

find_package(BZip2)
include_directories(${BZIP2_INCLUDE_DIR})
target_link_libraries(${BZIP2_LIBRARIES})

set(BZIP2_EX_SRC main.cpp)

add_executable(${PROJECT_NAME} ${BZIP2_EX_SRC})

=

Then I type in: cmake . && make

This is the output of the make command:
=
main.cpp: In function ‘int main(int, char**)’:
main.cpp:8:21: warning: deprecated conversion from string constant to
‘char*’ [-Wwrite-strings]
  char *sourceFile = "test.txt";
 ^
main.cpp:9:21: warning: deprecated conversion from string constant to
‘char*’ [-Wwrite-strings]
  char *targetFile = "test.bz2";
 ^
Linking CXX executable bzip2Ex
CMakeFiles/bzip2Ex.dir/main.cpp.o: In Funktion `main':
main.cpp:(.text+0x15c): Nicht definierter Verweis auf `BZ2_bzWriteOpen'
main.cpp:(.text+0x193): Nicht definierter Verweis auf `BZ2_bzWrite'
main.cpp:(.text+0x1db): Nicht definierter Verweis auf `BZ2_bzWriteClose'
main.cpp:(.text+0x267): Nicht definierter Verweis auf `BZ2_bzWriteClose'
collect2: error: ld returned 1 exit status
make[2]: *** [bzip2Ex] Fehler 1
make[1]: *** [CMakeFiles/bzip2Ex.dir/all] Fehler 2
make: *** [all] Fehler 2

=

Why there is the error?
-- 

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] A function and its arguments

2016-02-28 Thread Kristian
Hey,

I have a question. I have read the article about functions:
https://cmake.org/cmake/help/v3.0/command/function.html

I tried to write myself a very simple function (nothing special)



function(test_me add1 add2)
message("test_me")
message(" -> " ${add1})
message(" -> " ${add2})
message(" -> Number of arguments: " ${ARGC})
message(" -> All arguments: " ${ARGV})
message(" -> 0. argument: " ${ARGV0})
message(" -> 1. argument: " ${ARGV1})
message(" -> 2. argument: " ${ARGV2})
message(" -> Unexpected arguments: " ${ARGN})
endfunction(test_me)



But when calling the function with


test_me("1" "2" "3")


or


test_me(1 2 3)


Then I get this output:


test_me
 -> 1
 -> 2
 -> Number of arguments: 3
 -> All arguments: 123
 -> 0. argument: 1
 -> 1. argument: 2
 -> 2. argument: 3
 -> Unexpected arguments: 3



I would expect, that the line "All arguments" would look like "All
arguments: 1 2 3", and not "All arguments: 123".

What is the thought behind this behaviour?
-- 

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] A function and its arguments

2016-02-28 Thread Kristian
You were right. Thank you!

2016-02-28 22:12 GMT+01:00 Nils Gladitz :
> On 28.02.2016 21:57, Kristian wrote:
>>
>> [...]
>>
>> 
>> test_me(1 2 3)
>> 
>>
>> Then I get this output:
>>
>> 
>> test_me
>>   -> 1
>>   -> 2
>>   -> Number of arguments: 3
>>   -> All arguments: 123
>>   -> 0. argument: 1
>>   -> 1. argument: 2
>>   -> 2. argument: 3
>>   -> Unexpected arguments: 3
>>
>> 
>>
>> I would expect, that the line "All arguments" would look like "All
>> arguments: 1 2 3", and not "All arguments: 123".
>>
>> What is the thought behind this behaviour?
>
>
> This is due to how you call message() which concatenates its arguments.
>
> Instead try e.g.
> message(" -> All arguments: ${ARGV}")
>
> Which should output " -> All arguments: 1;2;3" (CMake's internal list
> separator is semicolon).
>
> Nils
>
-- 

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] VERSION and SOVERSION in a module

2016-04-04 Thread Kristian
Hey,

I have a question. I have a project, which is compiled on two
different build machines with ninja (trunk and branch). The
CMakeLists.txt is the same when it comes to a part, where the VERSION
and SOVERSION part is set through the function
'set_target_properties'.

But on the first build machines, setting the VERSION and SOVERSION
works, on the other machine it does not work. On the second machine
(where the build fails), I recently upgraded CMake to 3.5 (I compiled
and installed it on my own). The first build machine has CMake with
version 2.8.11 (installed from local package manager yum).

I've tried some things till I got a minimum example, where I could
reproduce the error. The problem is calling add_library with MODULE.

So, first the CMakeLists.txt
=
cmake_minimum_required(VERSION 2.8)
project(test1)

set(SOURCES func.cpp)

set(VER1 "1")
set(VER2 "2")
set(VER3 "3")

add_library(${PROJECT_NAME} MODULE ${SOURCES})
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS
-Wl,-Bsymbolic VERSION ${VER1}.${VER2}.${VER3} SOVERSION 0)
=

When running this script with the commands on the first build machine
(CMake 2.8.11 / this is also reproducable with Unix Makefiles
generator)
> cmake . && make && ls
then I get this

> CMakeCache.txt
> cmake_install.cmake
> func.cpp
> libtest1.so.0
> Makefile
> CMakeFiles
> CMakeLists.txt
> libtest1.so
> libtest1.so.1.2.3

(which seems ok to me)

But running the same CMakeLists.txt on the second build machine (CMake
3.5), then I get this:

> CMakeCache.txt
> CMakeFiles
> cmake_install.cmake
> CMakeLists.txt
> func.cpp
> libtest1.so
> Makefile

Is this an error? Or what should I add to the CMakeLists.txt on the
second build machine, to get the same output (i.e. libtest1.so.0
libtest1.so.1.2.3)?
-- 

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] VERSION and SOVERSION in a module

2016-04-04 Thread Kristian
Thank you for your answer. It helped me a lot.

2016-04-04 12:07 GMT+02:00 Nils Gladitz :
> On 04/04/2016 10:33 AM, Kristian wrote:
>>
>> Hey,
>>
>> I have a question. I have a project, which is compiled on two
>> different build machines with ninja (trunk and branch). The
>> CMakeLists.txt is the same when it comes to a part, where the VERSION
>> and SOVERSION part is set through the function
>> 'set_target_properties'.
>>
>> But on the first build machines, setting the VERSION and SOVERSION
>> works, on the other machine it does not work. On the second machine
>> (where the build fails), I recently upgraded CMake to 3.5 (I compiled
>> and installed it on my own). The first build machine has CMake with
>> version 2.8.11 (installed from local package manager yum).
>>
>> I've tried some things till I got a minimum example, where I could
>> reproduce the error. The problem is calling add_library with MODULE.
>>
>
> This behavior was deliberately changed by:
> https://cmake.org/gitweb?p=cmake.git;a=commit;h=f799ffb5cb895855ac2aba54765622b81db5be38
>
> Which is in CMake since ~3.4.0.
>
> The change is related to this issue:
> https://cmake.org/Bug/view.php?id=15705
>
> Nils
-- 

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] CPack does not generate a RPM

2016-04-06 Thread Kristian
Hi,

I have an error and I do not know, how to solve this error.

I have an archive, where are some files. I want to generate a rpm
package with the files, which are in that archive. So first, I extract
that archive with a bash script. After that, the script calls "cpack
-G RPM -V ." for this CMakeLists.txt:

cmake_minimum_required(VERSION 3.5)
project(project1)

install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/usr/bin/calculator DESTINATION bin)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/usr/lib64/* DESTINATION lib)

set(CPACK_GENERATOR "RPM")
set(CPACK_PACKAGE_VERSION_MAJOR 1)
set(CPACK_PACKAGE_VERSION_MINOR 2)
set(CPACK_PACKAGE_NAME "project1")
set(CPACK_RPM_PACKAGE_NAME "project1")
set(CPACK_RPM_PACKAGE_SUMMARY "Some random calculator")
set(CPACK_RPM_PACKAGE_ARCHITECTURE x86_64)
set(CPACK_PACKAGE_VENDOR "Vendor Coorp.")
set(CPACK_RPM_PACKAGE_MAINTAINER "Vendor Coorp.")

INCLUDE(CPack)

But calling the cpack command, I always getting the error "CPack
project name not specified". Why is that? What I am missing?
-- 

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] Fwd: CPack does not generate a RPM

2016-04-06 Thread Kristian
Ok, one part of the problem, I could solve. I could solve the problem
with running the following commands:

cmake . && make package

After that, I get a rpm package. But now, I have another problem and I
do not know, if I am doing something wrong or if this is a bug.

Let's assume, I have a library, e.g. liblibrary.so.5.6.7 and I have
two symbolic links, so the result of "ls -l" would look like this

liblibrary.so -> liblibrary.so.0
liblibrary.so.0 -> liblibrary.so.5.6.7
liblibrary.so.5.6.7

And let's assume, I have these lines in my CMakeLists.txt:

***
set(LIBRARIES
${LIB}/liblibrary.so
${LIB}/liblibrary.so.0
${LIB}/liblibrary.so.5.6.7)
#...
install(FILES ${LIBRARIES} DESTINATION lib)
***

Now, I call the commands "cmake . && make package" and I get a package
"project1.1-Linux.rpm". After that, I try to install that package with
"yum install project1.1-Linux.rpm", I get some strange dependency
resolution errors, which would look like this

--> Finished Dependency Resolution
Error: Package: project1.1-1.x86_64 (/project1.1-Linux)
   Requires: liblibrary.so.0()(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest


But when I have only these lines in CMakeLists.txt

**
set(LIBRARIES
${LIB}/liblibrary.so.0
${LIB}/liblibrary.so.5.6.7)
#...
install(FILES ${LIBRARIES} DESTINATION lib)
**

then installation of my very simple project works and I am not getting
any dependency resolution errors.





-- Forwarded message --
From: Kristian 
Date: 2016-04-07 0:50 GMT+02:00
Subject: CPack does not generate a RPM
To: cmake@cmake.org


Hi,

I have an error and I do not know, how to solve this error.

I have an archive, where are some files. I want to generate a rpm
package with the files, which are in that archive. So first, I extract
that archive with a bash script. After that, the script calls "cpack
-G RPM -V ." for this CMakeLists.txt:

cmake_minimum_required(VERSION 3.5)
project(project1)

install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/usr/bin/calculator DESTINATION bin)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/usr/lib64/* DESTINATION lib)

set(CPACK_GENERATOR "RPM")
set(CPACK_PACKAGE_VERSION_MAJOR 1)
set(CPACK_PACKAGE_VERSION_MINOR 2)
set(CPACK_PACKAGE_NAME "project1")
set(CPACK_RPM_PACKAGE_NAME "project1")
set(CPACK_RPM_PACKAGE_SUMMARY "Some random calculator")
set(CPACK_RPM_PACKAGE_ARCHITECTURE x86_64)
set(CPACK_PACKAGE_VENDOR "Vendor Coorp.")
set(CPACK_RPM_PACKAGE_MAINTAINER "Vendor Coorp.")

INCLUDE(CPack)

But calling the cpack command, I always getting the error "CPack
project name not specified". Why is that? What I am missing?
-- 

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] Fwd: CPack does not generate a RPM

2016-04-07 Thread Kristian
Thank you for your answer. Setting the variable
CPACK_RPM_PACKAGE_AUTOREQ to "NO" worked.

I also tried to produce a minimal example, which produces such error
as the behaviour I described. But I couldn't generate such an example.
I do not know currently, under which circumstances this happens :(.

My assumptions are the same, that this seems to be a rpm issue.

2016-04-07 19:39 GMT+02:00 Domen Vrankar :
>> Let's assume, I have a library, e.g. liblibrary.so.5.6.7 and I have
>> two symbolic links, so the result of "ls -l" would look like this
>>
>> liblibrary.so -> liblibrary.so.0
>> liblibrary.so.0 -> liblibrary.so.5.6.7
>> liblibrary.so.5.6.7
>>
>> And let's assume, I have these lines in my CMakeLists.txt:
>>
>> ***
>> set(LIBRARIES
>> ${LIB}/liblibrary.so
>> ${LIB}/liblibrary.so.0
>> ${LIB}/liblibrary.so.5.6.7)
>> #...
>> install(FILES ${LIBRARIES} DESTINATION lib)
>> ***
>>
>> Now, I call the commands "cmake . && make package" and I get a package
>> "project1.1-Linux.rpm". After that, I try to install that package with
>> "yum install project1.1-Linux.rpm", I get some strange dependency
>> resolution errors, which would look like this
>>
>> --> Finished Dependency Resolution
>> Error: Package: project1.1-1.x86_64 (/project1.1-Linux)
>>Requires: liblibrary.so.0()(64bit)
>>  You could try using --skip-broken to work around the problem
>>  You could try running: rpm -Va --nofiles --nodigest
>
> Hi,
>
> Not certain why that dependency problem occurs - will have to look
> into it a bit further but it seems to be rpm issue (somehow it gets
> the file dependencies wrong with symlinks to symlinks).
>
> As a workaround you could disable auto requirements generation by setting:
> set(CPACK_RPM_PACKAGE_AUTOREQ "NO")
>
> Regards,
> Domen
-- 

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] Fwd: CPack does not generate a RPM

2016-04-08 Thread Kristian
I think others also may be interested in this. Please send a copy of
your example ...

2016-04-08 8:31 GMT+02:00 Wang, Peng 1. (Nokia - CN/Hangzhou)
:
> Hi,
>
> Sorry guys, I am busy on some prioritized tasks.
> I've made a simple example, can I send in attachment? Or maybe I shall send 
> the attachment only to you two?
>
> Wang Peng (Rex)
> Seat: 21F
> HZ SE Team
> +86018605811125
>
> -Original Message-
> From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of EXT Kristian
> Sent: Friday, April 08, 2016 5:16 AM
> To: Domen Vrankar 
> Cc: cmake@cmake.org
> Subject: Re: [CMake] Fwd: CPack does not generate a RPM
>
> Thank you for your answer. Setting the variable
> CPACK_RPM_PACKAGE_AUTOREQ to "NO" worked.
>
> I also tried to produce a minimal example, which produces such error
> as the behaviour I described. But I couldn't generate such an example.
> I do not know currently, under which circumstances this happens :(.
>
> My assumptions are the same, that this seems to be a rpm issue.
>
> 2016-04-07 19:39 GMT+02:00 Domen Vrankar :
>>> Let's assume, I have a library, e.g. liblibrary.so.5.6.7 and I have
>>> two symbolic links, so the result of "ls -l" would look like this
>>>
>>> liblibrary.so -> liblibrary.so.0
>>> liblibrary.so.0 -> liblibrary.so.5.6.7
>>> liblibrary.so.5.6.7
>>>
>>> And let's assume, I have these lines in my CMakeLists.txt:
>>>
>>> ***
>>> set(LIBRARIES
>>> ${LIB}/liblibrary.so
>>> ${LIB}/liblibrary.so.0
>>> ${LIB}/liblibrary.so.5.6.7)
>>> #...
>>> install(FILES ${LIBRARIES} DESTINATION lib)
>>> ***
>>>
>>> Now, I call the commands "cmake . && make package" and I get a package
>>> "project1.1-Linux.rpm". After that, I try to install that package with
>>> "yum install project1.1-Linux.rpm", I get some strange dependency
>>> resolution errors, which would look like this
>>>
>>> --> Finished Dependency Resolution
>>> Error: Package: project1.1-1.x86_64 (/project1.1-Linux)
>>>Requires: liblibrary.so.0()(64bit)
>>>  You could try using --skip-broken to work around the problem
>>>  You could try running: rpm -Va --nofiles --nodigest
>>
>> Hi,
>>
>> Not certain why that dependency problem occurs - will have to look
>> into it a bit further but it seems to be rpm issue (somehow it gets
>> the file dependencies wrong with symlinks to symlinks).
>>
>> As a workaround you could disable auto requirements generation by setting:
>> set(CPACK_RPM_PACKAGE_AUTOREQ "NO")
>>
>> Regards,
>> Domen
> --
>
> 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] issue with target_link_libraries and MSVC

2016-04-12 Thread Kristian
I'm not sure, but I think, you should consider 'set_target_properties'
(https://cmake.org/cmake/help/v3.0/command/set_target_properties.html).

E.g.

target_link_libraries(my_target source1.cpp source2.cpp)
set_target_properties(my_target PROPERTIES LINK_FLAGS "\openmp")



2016-04-12 17:29 GMT+02:00 Benjamin Ballet via CMake :
> I'm trying to add the openmp flag to a target with target_link_libraries.
> \openmp is interpreted as a file name and visual try to link to \openmp.obj
>
> The documentation state that target_link_libraries see an item as a flag if
> it start with - but MSVC flags start with \
>
> Is there a way to add a link flags to a target with target_link_libraries
> and MSVC ?
>
> Thank you all
>
> --
> Benjamin BALLET
> Ingénieur R&D
>
> ACTIVISU
> 19, rue Klock - 92110 Clichy
>> Standard Tél :  01 44 69 37 37
>> www.activisu.com
>
> --
>
> 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] Problem building CMake with system OPENSSL

2016-06-05 Thread Kristian
Maybe you should add something like

> include_directories(${OPENSSL_INCLUDE_DIR})

to your CMakeLists.txt ?

2016-06-03 10:27 GMT-04:00 Lowekamp, Bradley (NIH/NLM/LHC) [C]
:
> Hello,
>
> I am trying to build CMake on an old system with a new version of openssl.
> My build script was working with CMake 3.4 but is not working with 3.5.2 or
> current master. Here is how I am building cmake:
>
>
> cd /tmp/cmake-build &&
> ../${CMAKE_ROOT}/bootstrap &&
> make -j ${NPROC} &&
> ./bin/cmake -DCMAKE_BUILD_TYPE:STRING=Release
> -DCMAKE_USE_OPENSSL:BOOL=ON -DOPENSSL_ROOT_DIR:PATH=/usr/local/ssl
> -DCMAKE_USE_SYSTEM_CURL:BOOL=OFF  . &&
> make -j${NPROC}
>
> ERROR MESSAGE:
>  41%] Building C object
> Utilities/cmlibarchive/libarchive/CMakeFiles/cmlibarchive.dir/archive_cryptor.c.o
> cd /tmp/cmake-build/Utilities/cmlibarchive/libarchive &&
> /opt/rh/devtoolset-2/root/usr/bin/gcc  -DCURL_STATICLIB -DHAVE_CONFIG_H
> -DLIBARCHIVE_STATIC -DLZMA_API_STATIC
> -I/tmp/cmake/Utilities/cmlibarchive/libarchive
> -I/tmp/cmake-build/Utilities/cmlibarchive -I/tmp/cmake-build/Utilities
> -I/tmp/cmake/Utilities -I/tmp/cmake/Utilities/cmbzip2
> -I/tmp/cmake/Utilities/cmliblzma/liblzma/api  -w -O3 -DNDEBUG   -std=gnu99
> -o CMakeFiles/cmlibarchive.dir/archive_cryptor.c.o   -c
> /tmp/cmake/Utilities/cmlibarchive/libarchive/archive_cryptor.c
> In file included from
> /tmp/cmake/Utilities/cmlibarchive/libarchive/archive_cryptor.c:32:0:
> /tmp/cmake/Utilities/cmlibarchive/libarchive/archive_cryptor_private.h:102:25:
> fatal error: openssl/evp.h: No such file or directory
>  #include 
>
> My work around it just to add "-I/usr/local/ssl/include/“ to the
> CMAKE_C_FLAGS.
>
>
> Thanks!
> Brad
>
> --
>
> 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] Problem building CMake with system OPENSSL

2016-06-07 Thread Kristian
What's the meaning of the bootstrap executable? I thought, when compiling
CMake, it is sufficient to call ./configure and then make...



2016-06-07 15:13 GMT-04:00 Brad King :

> On 06/07/2016 10:58 AM, Lowekamp, Bradley (NIH/NLM/LHC) [C] wrote:
> > I tried out the 3.6.0-rc1 and my problem building CMake still exists.
>
> Thanks for testing it.
>
> > (cd /tmp/cmake-build && \
> > ../cmake-3.6.0-rc1/bootstrap && \
> > make -j 10 && \
> > ./bin/cmake -DCMAKE_BUILD_TYPE:STRING=Release
> -DCMAKE_USE_OPENSSL:BOOL=ON -DOPENSSL_ROOT_DIR:PATH=/usr/local/ssl  . && \
> > make -j${NPROC} && \
> > make install)
>
> That script causes CMake to be configured with itself the second time
> instead of the bootstrap script.  You should be able to pass the config
> options directly to bootstrap:
>
>   ../cmake-3.6.0-rc1/bootstrap --parallel=${NPROC} -- \
> -DCMAKE_BUILD_TYPE:STRING=Release \
> -DCMAKE_USE_OPENSSL:BOOL=ON \
> -DOPENSSL_ROOT_DIR:PATH=/usr/local/ssl &&
>   make -j ${NPROC} &&
>   make install
>
> > In file included from
> /tmp/cmake-3.6.0-rc1/Utilities/cmlibarchive/libarchive/archive_read_support_format_zip.c:58:0:
> >
> /tmp/cmake-3.6.0-rc1/Utilities/cmlibarchive/libarchive/archive_cryptor_private.h:102:25:
> fatal error: openssl/evp.h: No such file or directory
>
> This should fix it:
>
>  libarchive: Restore OpenSSL include directory from upstream
>  https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dbc9f73d
>
> I've queued this for merge to 'release' for 3.6.0-rc2.
>
> -Brad K
>
> --
>
> 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

[CMake] Freetype on linux systems in non-standard directories

2016-06-07 Thread Kristian
Hey guys,

I wanted to try something out with CMake and latest version of freetype
(2.6.3). So I downloaded freetype, compiled it with the commands

> ./configure --prefix=/home/kristian/Documents/freetype/freetype
> make
> make install

After that, I created a small C++-file and a CMakeLists.txt. The C++-file
depends on freetype, so my CMakeLists.txt looks like this:

=

> cmake_minimum_required(VERSION 3.5)
> project(freetype_ex)
>
> set(FREETYPE_DIR "/home/kristian/Documents/freetype/freetype")
> find_package(Freetype)
>
> set(SOURCES main.cpp)
>
> include_directories(${FREETYPE_INCLUDE_DIRS})
>
> add_executable(${PROJECT_NAME} ${SOURCES})
> target_link_libraries(${PROJECT_NAME} ${FREETYPE_LIBRARIES})

=

But when calling cmake, I am getting this error:
=

> -- Could NOT find Freetype (missing:  FREETYPE_LIBRARY
FREETYPE_INCLUDE_DIRS)
> CMake Error: The following variables are used in this project, but they
are set to NOTFOUND.
> Please set them or make sure they are set and tested correctly in the
CMake files:
> FREETYPE_LIBRARY (ADVANCED)
> linked by target "freetype_ex" in directory
/home/kristian/Documents/freetype/cmake
>
> -- Configuring incomplete, errors occurred!
> See also
"/home/kristian/Documents/freetype/cmake/CMakeFiles/CMakeOutput.log".

=

This sort of error seems for me to be a bug, because I would assume, that
when I set the variable FREETYPE_DIR, then CMake would also look at this
dir.

I looked at the FindFreetype.cmake file (
https://github.com/Kitware/CMake/blob/master/Modules/FindFreetype.cmake)
and my first assumption is, that it would help, to add something like
${FREETYPE_DIR} the the find_path calls.

What do you think of this? Another idea is, to add another variable instead
of FREETYPE_DIR, e.g. FREETYPE_ROOT_DIR...
-- 

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] Visual Studio problem with many/long additional library paths

2006-04-18 Thread Kristian Nielsen
A cmakelists.txt file of mine contains the following:

ADD_EXECUTABLE(mysqld ../sql-common/client.c ...)
TARGET_LINK_LIBRARIES(mysqld heap myisam myisammrg mysys yassl zlib dbug yassl 
  taocrypt strings vio regex wsock32)
TARGET_LINK_LIBRARIES(mysqld archive)
TARGET_LINK_LIBRARIES(mysqld example)
TARGET_LINK_LIBRARIES(mysqld innobase)
TARGET_LINK_LIBRARIES(mysqld bdb)

This generates the following long line in mysqld.vcproj:

AdditionalLibraryDirectories="e:[EMAIL 
PROTECTED](OutDir),e:[EMAIL PROTECTED],e:[EMAIL PROTECTED](OutDir),e:[EMAIL 
PROTECTED],e:[EMAIL PROTECTED](OutDir),e:[EMAIL PROTECTED],e:[EMAIL 
PROTECTED](OutDir),e:[EMAIL PROTECTED],e:[EMAIL PROTECTED]
 -5.1.10-beta-standard\extra\yassl\$(OutDir),e:[EMAIL PROTECTED],e:[EMAIL 
PROTECTED](OutDir),e:[EMAIL PROTECTED],e:[EMAIL PROTECTED](OutDir),e:[EMAIL 
PROTECTED],e:[EMAIL PROTECTED](OutDir),e:[EMAIL PROTECTED],e:[EMAIL 
PROTECTED](OutDir),e:[EMAIL PROTECTED],e:\pb\my!
 [EMAIL PROTECTED]
a-standard\vio\$(OutDir),e:[EMAIL PROTECTED],e:[EMAIL 
PROTECTED](OutDir),e:[EMAIL PROTECTED],e:[EMAIL PROTECTED](OutDir),e:[EMAIL 
PROTECTED],e:[EMAIL PROTECTED](OutDir),e:[EMAIL PROTECTED],e:[EMAIL 
PROTECTED](OutDir),e:[EMAIL PROTECTED],e:\p!
 [EMAIL PROTECTED](OutDir),e:[EMAIL PROTECTED]"

This is generated by

cmake -G "Visual Studio 7 .NET 2003"

This looks fine, but unfortunately it seems to break some limit in Visual
Studio version 7.1. There is no error message when loading the project file,
but the paths do not work and libraries can not be found.

The limit seems to be a bit more than 2000 characters. If I shorten the path
to less than that, the build work.

Googling turned up nothing. While this does seem to be a bug / misfeature in
Visual Studio, I wondered if anyone has experienced this problem, and perhaps
know of a workaround? Since CMake uses hardcoded paths, this problem is all
the more likely to hit in CMake-generated projects. I wonder if there is
another way to write the .vcproj files that avoid this limitation...

 - Kristian.

-- 
Kristian Nielsen, Software Developer
MySQL AB, Hvidovre, Denmark, www.mysql.com
Are you MySQL certified?  www.mysql.com/certification

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Visual Studio problem with many/long additional library paths

2006-04-20 Thread Kristian Nielsen
Brad King <[EMAIL PROTECTED]> writes:

> libraries are found by the linker.  I've just modified the VS7
> generator to use for each link directory either a relative path or a
> full path, whichever is shorter.  This should minimize the string
> length.  These changes will be included in the upcoming 2.4 release.

That's great, thanks.

When manually creating a Visual Studio solution, the limitation on
AdditionalLibraryDirectories can be avoided entirely by instead using
dependencies in the .sln file. It seems that if exe A has a dependency on
library B (both projects in the .sln), there is an implicit link of B into a
implied. I wonder if there is a way to generage that with CMake, I tried just
replacing TARGET_LINK_LIBRARIES with ADD_DEPENDENCIES, but that did not seem
to work? I'll play a bit more with it and see if I can find something that
works.

 - Kristian.

-- 
Kristian Nielsen, Software Developer
MySQL AB, Hvidovre, Denmark, www.mysql.com
Office: +46 18 174 400 ext. 4525
Are you MySQL certified?  www.mysql.com/certification

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake