Re: [CMake] Problems with EnternalProjectAdd

2019-02-18 Thread Romain LEGUAY
Hi,

I think you need to set the variable CONFIGURE_COMMAND to empty like this:

> ExternalProject_Add(
> freetype
> PREFIX "${BUILD_ENV}/freetype"
> GIT_REPOSITORY "https://github.com/brooklynpacket/freetype2.git;
> GIT_TAG 64bit
 CONFIGURE_COMMAND ""
> BUILD_COMMAND "cd ${CMAKE_BUILD_DIR}/freetype/src/freetype && 
> ./autgen.sh && ./configure && make"
> LOG_DOWNLOAD ON
> LOG_INSTALL ON
> LOG_CONFIGURE ON
> LOG_BUILD ON
> LOG_TEST ON
> LOG_INSTALL ON
> )

Envoyé de mon iPad

> Le 19 févr. 2019 à 06:51, workbe...@gmx.at  a écrit :
> 
> I played around a bit a now have the following:
> 
> set(BUILD_ENV "${CMAKE_BINARY_DIR}/build_env" CACHE STRING INTERNAL)
> set(LIBRARY_DIR "${CMAKE_BINARY_DIR}/lib" CACHE STRING INTERNAL)
> 
> ExternalProject_Add(
> freetype
> PREFIX "${BUILD_ENV}/freetype"
> GIT_REPOSITORY "https://github.com/brooklynpacket/freetype2.git;
> GIT_TAG 64bit
> BUILD_COMMAND "cd ${CMAKE_BUILD_DIR}/freetype/src/freetype && 
> ./autgen.sh && ./configure && make"
> LOG_DOWNLOAD ON
> LOG_INSTALL ON
> LOG_CONFIGURE ON
> LOG_BUILD ON
> LOG_TEST ON
> LOG_INSTALL ON
> )
> 
> The logs are telling me: CMake Error: The source directory 
> "/home/stuv/data/projects/programming/bsUltimate/build/build_env/freetype/src/freetype"
>  does not appear to contain CMakeLists.txt.
> 
> Isn't the BUILD_COMMAND there if there is no CMakeLists.txt file available 
> for building ? not many project provide cmake build files
> 
> 
> best regards!
> 
> 
> 
> 
> 
> 
>> On 19.02.19 06:43, Michael Ellery wrote:
>> CMAKE_BUILD_DIR is not a standard variable (did you mean CMAKE_BINARY_DIR ?) 
>> - and the error seems to indicate that the variable is indeed empty so it 
>> tries to create the project directory at the root level.
>> 
>> -Mike
>> 
>>> On Feb 18, 2019, at 8:58 PM, workbe...@gmx.at  wrote:
>>> 
>>> Hi again,
>>> 
>>> i try to install my dependencies with ExternalProjectAdd but it gives me 
>>> troubles... what's wrong with
>>> 
>>> 
>>> ExternalProject_Add(
>>> freetype
>>> PREFIX "${CMAKE_BUILD_DIR}/freetype"
>>> GIT_REPOSITORY "https://github.com/brooklynpacket/freetype2.git;
>>> GIT_TAG 64bit
>>> BUILD_COMMAND "cd ${CMAKE_BUILD_DIR}/freetype/src/freetype && 
>>> ./autgen.sh && ./configure && make"
>>> LOG_DOWNLOAD ON
>>> LOG_INSTALL ON
>>> LOG_CONFIGURE ON
>>> LOG_BUILD ON
>>> LOG_TEST ON
>>> LOG_INSTALL ON
>>> )
>>> 
>>> best regards!
>>> 
>>> -- 
>>> 
>>> 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
>> 
> -- 
> 
> 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
-- 

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


Re: [CMake] Check Build Type/Config Changed

2019-01-06 Thread Romain LEGUAY
Thank you for your answer!

What I found strange is that CMAKE_CONFIGURATION_TYPES and CMAKE_BUILD_TYPE
are empty at the begining of the cmake script.

When do those variables instanciated?

The purpose to know if the build type changed is to reactivate a superbuild
variable to build my external dependencies in the good build type.

Le sam. 5 janv. 2019 à 17:35, frodak17  a écrit :

>
>
> On Sat, Jan 5, 2019 at 11:08 AM Romain LEGUAY 
> wrote:
>
>> Hi everyone,
>>
>>
>>
>> Is there a way to test if the build type changed?
>>
>>
>> I try to create a cache variable with CMAKE_BUILD_TYPE as value but I
>> found an unexpected result: CMAKE_BUILD_TYPE or CMAKE_CONFIGURATION_TYPES
>> are not defined (I'm working on Windows with Visual Studio 2017, Visual
>> Studio Code and Qt Creator).
>>
>>
>> Thank you,
>>
>>
>>
> CMAKE_CONFIGURATION_TYPES is used by multi-config generators and
> CMAKE_BUILD_TYPE isn't used.
> CMAKE_CONFIGURATION_TYPES should default to
> "Debug;Release;MinSizeRel;RelWithDebInfo" for Visual Studio generators
> unless it was explicitly set to something else.
>
> If you aren't using a multi-config generator then CMAKE_BUILD_TYPE will be
> empty unless it was set by the user or the CMakeLists.txt sets a default
> value if empty.
>
> When building with Visual Studio the build type probably could be written
> to a file using a post-build rule or something like that.
>
-- 

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] Check Build Type/Config Changed

2019-01-05 Thread Romain LEGUAY
Hi everyone,



Is there a way to test if the build type changed?


I try to create a cache variable with CMAKE_BUILD_TYPE as value but I found
an unexpected result: CMAKE_BUILD_TYPE or CMAKE_CONFIGURATION_TYPES are not
defined (I'm working on Windows with Visual Studio 2017, Visual Studio Code
and Qt Creator).


Thank you,


Romain
-- 

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


Re: [CMake] ExternalProject, Superbuild and rebuild on Windows

2018-12-20 Thread Romain LEGUAY
Thank you for your answer, I didn't know the  CMAKE_CFG_INTDIR variable. It
was this variable I needed.

Best regards,

Romain

Le jeu. 20 déc. 2018 à 12:44, Kai Wolf  a écrit :

> The CMAKE_BUILD_TYPE variable only makes sense for single-configuration
> generators (such as Makefile or Ninja) and is not used for IDE type
> generators.
> You should rather look for CMAKE_CONFIGURATION_TYPES as well as
> CMAKE_CFG_INTDIR.
>
> Greetings,
>
> Kai
>
> http://kai-wolf.me
> http://effective-cmake.com
>
>
> > Am 20.12.2018 um 12:09 schrieb Romain LEGUAY :
> >
> > Hello everyone,
> >
> > I'm trying to build VTK and ITK along my project.
> >
> > For now, I use the trick to add an option to build VTK and ITK only once
> using ExternalProject_Add for all my dependencies and also for my project.
> >
> > This works great on Unix system but with a VS solution, the dependencies
> are not rebuilt when I change CMAKE_BUILD_TYPE.
> >
> > Is it possible to know if CMAKE_BUILD_TYPE is changed? It will permit me
> to switch on the option to rebuild the dependencies.
> >
> > Anyone as other better ideas?
> >
> > Thank you
> > --
> >
> > 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
>
>
-- 

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] ExternalProject, Superbuild and rebuild on Windows

2018-12-20 Thread Romain LEGUAY
Hello everyone,

I'm trying to build VTK and ITK along my project.

For now, I use the trick to add an option to build VTK and ITK only once
using ExternalProject_Add for all my dependencies and also for my project.

This works great on Unix system but with a VS solution, the dependencies
are not rebuilt when I change CMAKE_BUILD_TYPE.

Is it possible to know if CMAKE_BUILD_TYPE is changed? It will permit me to
switch on the option to rebuild the dependencies.

Anyone as other better ideas?

Thank you
-- 

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


Re: [CMake] Qt 5, macOS, bundle install

2018-10-09 Thread Romain LEGUAY
I found the solution!!

I just add the plugins attached to the Qt Component (in my case Qt5Widgets) and 
install it:

set(qtplugins)
foreach(plugin ${Qt5Widgets_PLUGINS})
get_target_property(_loc ${plugin} LOCATION)
list(APPEND qtplugins ${_loc})
endforeach()

install_qt5_executable("${exe}" "${qtplugins}" "" "${dirs}" "")

I found a part of the solution in the Qt documentation 
(http://doc.qt.io/qt-5/cmake-manual.html#imported-targets 
).

How can I add this simple example inside the CMake example/tutorial?

Romain-- 

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] Qt 5, macOS, bundle install

2018-10-09 Thread Romain LEGUAY
Hello everyone,

I try to install a bundle application on macOS.

I successfully create the bundle and add all dependencies to Qt event the
plugin platform libqcocoa.dylib.

Unfortunately, when I launch the installed app, the window style is not the
same as the build app style (macOS) as you can see on the joined
screenshots.

The CMakeLists.txt script is (too?) simple:

cmake_minimum_required(VERSION 3.2 FATAL_ERROR)

project(testProj)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR})

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC_SEARCH_PATHS ${CMAKE_CURRENT_SOURCE_DIR}/ui)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)

find_package(Qt5Core REQUIRED)
find_package(Qt5Widgets REQUIRED)

get_target_property(QtCore_location Qt5::Core LOCATION)
get_target_property(QtWidgets_location Qt5::Widgets LOCATION)

include_directories(${QtCore_location} ${QtWidgets_location})

add_executable(${PROJECT_NAME} MACOSX_BUNDLE main.cpp MainWindow.cpp
MainWindow.hpp MainWindow.ui)
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD 14
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS NO)

install(TARGETS ${PROJECT_NAME} DESTINATION ".")

target_link_libraries(${PROJECT_NAME} Qt5::Widgets)

set_target_properties(${PROJECT_NAME}
PROPERTIES
MACOSX_BUNDLE_BUNDLE_NAME "${PROJECT_NAME}"
)

include(InstallRequiredSystemLibraries)
include(DeployQt5)

get_target_property(build_dir ${PROJECT_NAME} BINARY_DIR)
get_target_property(target_name ${PROJECT_NAME} NAME)
get_target_property(isbundle ${PROJECT_NAME} MACOSX_BUNDLE)

get_filename_component(qt_dlls_dir "${QtWidgets_location}" PATH)
get_filename_component(qt_dlls_dir "${qt_dlls_dir}" PATH)
set(dirs "${qt_dlls_dir}")

if(WIN32)
set(suffix ".exe")
endif()

if (${isbundle})
set(exe ${target_name}.app)
else()
set(exe ${target_name}${suffix})
endif()

install_qt5_executable(${exe} "" "" "${dirs}" "" "")

I don't understand why the plugin libqcocoa.dylib is not used for the
installed app.

I try to read the CMake script available (such as Paraview or Slicer3D),
but it's a little too much time consuming.

Is there some simple example available?

Thank you,

Romain
<>
-- 

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] How to append a string on list inside a function

2018-09-27 Thread Romain LEGUAY
Hello everyone,

I try to append a string (target name) on a list inside a function called in 
other CMakeLists.

I have the following project’s tree:

├── CMakeLists.txt
├── test
├── CMakeLists.txt
└── app
├── CMakeLists.txt
├── appA
│   ├── CMakeLists.txt
│   └── main.cpp
└── appB
├── CMakeLists.txt
└── main.cpp

Inside the test/CMakeLists.txt, I defined an internal variable like this:
set(allTestsList "" CACHE INTERNAL "All executable tests.'')
And my function:
function(addTest targetName)
# create the executable with all the souces
add_executable(${targetName} ${ARGN})
list(APPEND allTestsList ${targetName})
message("inside addTestFunction. allTestsList: " 
${allTestsList})
endfunction()

I call this function inside the test/app/appA and test/app/appB CMakeLists.txt 
like this:
addTest(appA main.cpp)
addTest(appB main.cpp)

I expected to have as final result:
inside addTestFunction. allTestsList: appA;appB

But I only have:
inside addTestFunction. allTestsList: appB

I suspect that a new variable is created at each call of the function.

Is it possible to use a global variable? (I tried to use PARENT_SCOPE with no 
success).

Thank you,

Romain


-- 

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


Re: [CMake] find_library doesn't find .dll on windows

2018-06-01 Thread Romain LEGUAY
Thank you for your answer.

I just want to find the file libmysql.dll because it's needed to be used
with Qt (unless I did not understand how to use Qt's MySQL driver).
For now, I just do a simple copy of this file in my build folder, but it's
not a good method.

Romain


Le ven. 1 juin 2018 à 17:58, Juan E. Sanchez  a
écrit :

> My understanding is that you are supposed to link against the .lib file,
> and the .dll is used at runtime.
>
> From:
> https://dev.mysql.com/doc/refman/5.7/en/c-api-building-clients.html
>
> You link your code with either the dynamic or static C client library.
> On Windows, the static library is named mysqlclient.lib and the dynamic
> library is named libmysql.dll. In addition, the libmysql.lib static
> import library is needed for using the dynamic library. If the static C
> client library is used, the client application must be compiled with the
> same version of Visual Studio used to compile the C client library
> (which is Visual Studio 2013 for the static C client library built by
> Oracle).
>
>
> Regards,
>
> Juan
>
>
> On 6/1/18 9:53 AM, Romain LEGUAY wrote:
> > Hi everyone,
> >
> > I try to find MYSQL dynamic library on windows.
> > For this, I use the following command:
> >
> > set(_PF86 "ProgramFiles(x86)")
> > find_library( MYSQL_LIBRARY
> > NAME "libmysql.dll"
> > PATHS "$ENV{PROGRAMFILES}/MySQL/*/lib"
> >"$ENV{${_PF86}}/MySQL/*/lib"
> >"$ENV{SYSTEMDRIVE}/MySQL/*/lib"
> >NO_DEFAULT_PATH)
> >
> > This command doesn't work on my computer (Windows 10 Pro x64, CMake
> 3.11.3).
> > If I remove the .dll extension, find_library find libmysql.lib which is
> > in the same folder as libmysql.dll.
> >
> > How to say to CMake to use the name I chosen?
> >
> > Thank you!
> > Romain
> >
> >
>
> --
>
> 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
>
-- 

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] find_library doesn't find .dll on windows

2018-06-01 Thread Romain LEGUAY
Hi everyone,

I try to find MYSQL dynamic library on windows.
For this, I use the following command:

set(_PF86 "ProgramFiles(x86)")
find_library( MYSQL_LIBRARY
NAME "libmysql.dll"
PATHS "$ENV{PROGRAMFILES}/MySQL/*/lib"
  "$ENV{${_PF86}}/MySQL/*/lib"
  "$ENV{SYSTEMDRIVE}/MySQL/*/lib"
  NO_DEFAULT_PATH)

This command doesn't work on my computer (Windows 10 Pro x64, CMake 3.11.3).
If I remove the .dll extension, find_library find libmysql.lib which is in
the same folder as libmysql.dll.

How to say to CMake to use the name I chosen?

Thank you!
Romain
-- 

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


Re: [CMake] Create Mac OS Bundle with VTK and Qt

2017-09-12 Thread Romain LEGUAY
Hello,

Sorry for this late answer!

After using DeployQt5.cmake script I succeed to resolve my problem. 

The icon problem was due to some mistake during the creation of my icns file.

Thanks again.

Romain

> Le 8 sept. 2017 à 21:42, Oleksii Vilchanskyi via CMake <cmake@cmake.org> a 
> écrit :
> 
> Hello,
> 
>> 1) I try to add an icon without success
>> When I launch my app, the default icon is used and not my icon.
> 
> Can you elaborate on this? You say that the .icns file is under
> Resources and the final Info.plist contains the proper key with the
> proper value and that a non-default icon is used when the application is
> launched. If you do actually see the icon on the application [for
> example] in Launchpad, then the bundle is correctly built and macOS can
> recognize the icon. If instead you see something like this[0], then the
> bundle is built incorrectly.
> 
> However, you also say "when I launch my app", which, if you mean
> application's runtime in particular, is unrelated to CMake or bundling.
> If the tray icon is broken etc. it's something your application is not
> doing (for example, we use RCC and /image for the icon).
> 
> So, if this is the former, then the bundling part is incorrect, if it's
> the latter, the program's behaviour is incorrect.
> 
> As a side note, I don't rely on MACOSX_PACKAGE_LOCATION property and
> install() the icon where it belongs.
> 
>> 2) For the libraries of VTK I tried to use macdeployqt (found using
> find_program) but it doesn’t found the libraries (installed in a custom
> directories)
>> Is there a simple way to copy all found libraries/framework?
> 
> I would recommend using DeployQt5.cmake module[1] instead of
> macdeployqt. Initially found on this list and later edited by Marcus D.
> Hanwell, the module (I believe) is distributed under BSD 3-clause.
> 
> Usage example[2], also under BSD 3-clause (I believe).
> 
> [0]: <https://doc.qt.io/archives/qq/qq09-demo-icon.png 
> <https://doc.qt.io/archives/qq/qq09-demo-icon.png>>
> [1]:
> <https://github.com/OpenChemistry/avogadroapp/blob/master/cmake/DeployQt5.cmake
>  
> <https://github.com/OpenChemistry/avogadroapp/blob/master/cmake/DeployQt5.cmake>>
> [2]:
> <https://github.com/OpenChemistry/avogadroapp/blob/master/avogadro/lastinstall/CMakeLists.txt
>  
> <https://github.com/OpenChemistry/avogadroapp/blob/master/avogadro/lastinstall/CMakeLists.txt>>
> 
> Regards,
> Oleksii Vilchanskyi
> 
> On 8.9.2017 18:11, Romain LEGUAY wrote:
>> Hello everyone,
>> 
>> Since this morning, I try to create a Bundle Application using CMake (3.9.1).
>> 
>> My application use VTK (8.x) and Qt (5.x). The find_package of those two 
>> libraries works greats (no problem to build and run the application).
>> 
>> I have many problems:
>> 
>> 1) I try to add an icon without success.
>> 2) I don’t know how (and where) to copy VTK dynamic libraries.
>> ( Optional / not really related ) 3) When I try to use only some components 
>> of VTK, my application is linking to all VTK modules
>> 
>> I’m going to details each points:
>> 
>> 1) For the icon issue, I proceed this way:
>> 
>> 
>> set(ICON_NAME "appIcon.icns") # I try without the icns extension without 
>> success.
>> set(ICON_PATH "${CMAKE_CURRENT_SOURCE_DIR}/resources/icons/${ICON_NAME}")
>> set_source_files_properties("${ICON_PATH}" PROPERTIES 
>> MACOSX_PACKAGE_LOCATION Resources)
>> 
>> add_executable(MYAPP MACOSX_BUNDLE ${ICON_PATH} ${other_sources})
>> 
>> set_target_properties(CRAFPACK_GUI PROPERTIES
>>  MACOSX_BUNDLE_ICON_FILE ${ICON_NAME})
>> 
>> 
>> The icon is copied inside the Resources folder of my bundle and the 
>> Info.plist is well updated (the CFBundleIconFile key is set to 
>> "appIcon.icns").
>> 
>> When I launch my app, the default icon is used and not my icon.
>> 
>> 
>> 2) For the libraries of VTK I tried to use macdeployqt (found using 
>> find_program) but it doesn’t found the libraries (installed in a custom 
>> directories)
>> 
>> I tried to use BundleUtilities without any success (except to tell me that 
>> cmake doesn’t found the libraries).
>> 
>> I attach you my CMakeLists.
>> 
>> Is there a simple way to copy all found libraries/framework?
>> 
>> Thank you!
>> 
>> 
>> 
> -- 
> 
> Powered by www.kitware.com <http://www.kitware.com/>
> 
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cma

[CMake] Create Mac OS Bundle with VTK and Qt

2017-09-08 Thread Romain LEGUAY
Hello everyone,

Since this morning, I try to create a Bundle Application using CMake (3.9.1).

My application use VTK (8.x) and Qt (5.x). The find_package of those two 
libraries works greats (no problem to build and run the application).

I have many problems:

1) I try to add an icon without success.
2) I don’t know how (and where) to copy VTK dynamic libraries.
( Optional / not really related ) 3) When I try to use only some components of 
VTK, my application is linking to all VTK modules

I’m going to details each points:

1) For the icon issue, I proceed this way:

 
set(ICON_NAME "appIcon.icns") # I try without the icns extension without 
success.
set(ICON_PATH "${CMAKE_CURRENT_SOURCE_DIR}/resources/icons/${ICON_NAME}")
set_source_files_properties("${ICON_PATH}" PROPERTIES MACOSX_PACKAGE_LOCATION 
Resources)

add_executable(MYAPP MACOSX_BUNDLE ${ICON_PATH} ${other_sources})

set_target_properties(CRAFPACK_GUI PROPERTIES
MACOSX_BUNDLE_ICON_FILE ${ICON_NAME})


The icon is copied inside the Resources folder of my bundle and the Info.plist 
is well updated (the CFBundleIconFile key is set to "appIcon.icns").

When I launch my app, the default icon is used and not my icon.


2) For the libraries of VTK I tried to use macdeployqt (found using 
find_program) but it doesn’t found the libraries (installed in a custom 
directories)

I tried to use BundleUtilities without any success (except to tell me that 
cmake doesn’t found the libraries).

I attach you my CMakeLists.

Is there a simple way to copy all found libraries/framework?

Thank you!

cmake_minimum_required(VERSION 3.1)

project (GUI CXX)

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)

find_package(VTK COMPONENTS vtkGUISupportQt NO_MODULE)

find_package(Qt5 COMPONENTS Core Widgets Network WebSockets REQUIRED)

if(${ENABLE_MPI})
find_package(MPI REQUIRED)
endif(${ENABLE_MPI})

include(${VTK_USE_FILE})

get_target_property(QtCore_location Qt5::Core LOCATION)
get_target_property(QtWidgets_location Qt5::Widgets LOCATION)
get_target_property(QtNetwork_location Qt5::Network LOCATION)
get_target_property(QtWebSockets_location Qt5::WebSockets LOCATION)
get_target_property(QT5_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION)
get_filename_component(QT5_WINDEPLOYQT_PATH ${QT5_QMAKE_EXECUTABLE} PATH)
set(QT5_WINDEPLOYQT_EXECUTABLE "${QT5_WINDEPLOYQT_PATH}/windeployqt.exe")
set(QT5_MACDEPLOYQT_EXECUTABLE "${QT5_WINDEPLOYQT_PATH}/macdeployqt")

include_directories("${COMMON_INCLUDE_DIR}"
services/include
include
resources
${QtCore_location}
${QtWidgets_location}
${QtNetwork_location}
${QtWebSockets_location})

include_directories(${VKT_INCLUDE_DIR} ${MPI_INCLUDE_PATH})

file(GLOB_RECURSE headers
include/*.hpp
include/*.tpp)

file(GLOB_RECURSE sources
src/*.cpp)

file(GLOB_RECURSE services_headers
services/include/*.h*
services/include/*.tpp)

file(GLOB_RECURSE services_sources
services/src/*.c*)


file(GLOB_RECURSE ui_files
resources/ui/*.ui)

file(GLOB_RECURSE qrc_files
resources/*.qrc)

if (APPLE)
set(ICON_NAME "appIcon")
set(ICON_PATH 
"${CMAKE_CURRENT_SOURCE_DIR}/resources/icons/${ICON_NAME}.icns")
endif()

qt5_wrap_ui(ui_sources "${ui_files}")
qt5_add_resources(qrc_resources "${qrc_files}")

if (APPLE)
set_source_files_properties("${ICON_PATH}" PROPERTIES 
MACOSX_PACKAGE_LOCATION Resources)
set_source_files_properties("${VTK_LIBRARIES}" PROPERTIES 
MACOSX_PACKAGE_LOCATION Resources/vtk)
endif()

add_executable(GUI MACOSX_BUNDLE ${headers} ${sources} ${services_headers}
${services_sources} 
${ui_sources} ${qrc_resources} ${ICON_PATH})

set_target_properties(GUI PROPERTIES
CXX_STANDARD 14
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS NO
MACOSX_BUNDLE_ICON_FILE ${ICON_NAME}
MACOSX_BUNDLE_GUI_IDENTIFIER "crafpack.TISSU"
MACOSX_BUNDLE_BUNDLE_NAME "TISSU"
BUILD_WITH_INSTALL_RPATH 1)

target_link_libraries(GUI
Qt5::Widgets Qt5::Network Qt5::WebSockets
${VTK_LIBRARIES} ${MPI_LIBRARIES})

if(${ENABLE_MPI})
target_compile_definitions(GUI PRIVATE "-DENABLE_MPI")
endif()

add_custom_command(TARGET GUI
POST_BUILD
COMMAND ${QT5_MACDEPLOYQT_EXECUTABLE} ARGS ${CMAKE_CURRENT_BINARY_DIR}/GUI.app
)-- 

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] CMake 3.0, Qt 5, plugins and multiple executables inside OS X Bundle

2014-08-06 Thread Romain Leguay

Hello everyone,

I have a Qt application that search for another Qt applications and some 
plugins too. On Windows, I just create the executables in the same 
folder but on Mac OS X, I can't do that: I must create a bundle like this:

MyApplication.app/
Contents/
Frameworks/
**all qt library**
**all application dependencies**
libPluginInterface.dylib
Resources/
   **application icon**
MacOS/
MyApplication
subApplication1
subApplication2
PlugIns/
 **all my plugins** (.dylib)

When I'll open MyApplication.app, I'd like to launch MyApplication 
executable.


For now, my applications and plugins are store like this:
Project/
CMakeLists.txt
MyApplication/
CMakeLists.txt
 **source_files**
PluginInterface/
CMakeLists.txt
 **source_files**
subApplication1/
CMakeLists.txt
**source_files**
subApplication2/
CMakeLists.txt
**source_files**
 plugins/
CMakeLists.txt
plugin1/
CMakeLists.txt
**source_files**

MyApplication and all the plugins depends on PluginInterface (a shared 
library).


For now, I have many difficulties about the link path. I don't 
understand very well how to use @rpath for my libraries.


So, my first question: is-it possible to do something like this?
Second, can you show me some examples about this please?

Thank you.

Romain
--

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] Problems to use fixup_bundle on Mac OS X

2014-05-13 Thread Romain LEGUAY
Hello everyone,
I try to build a small Qt application (helloGUI) with a shared library (hello).
Here is my application and library tree:
├── CMakeLists.txt
├── gui
│   ├── CMakeLists.txt
│   ├── bundle.cmake
│   ├── include
│   │   └── MainWindow.hpp
│   ├── src
│   │   ├── MainWindow.cpp
│   │   └── main.cpp
│   └── ui
│   └── mainwindow.ui
└── lib
├── CMakeLists.txt
├── Hello.cpp
└── Hello.h

My root CMakeLists.txt add the two sub directory: lib then gui.
The lib CMakeLists.txt build a shared library (.dylib) and installed it inside 
${CMAKE_INSTALL_PREFIX}/helloGUI.app/Contents/Libraries.
The gui CMakeLists.txt build my Qt bundle (helloGUI.app) and installed it 
inside ${CMAKE_INSTALL_PREFIX} then launch the script bundle.cmake.
bundle.cmake contains:
include(BundleUtilities)
fixup_bundle(${CMAKE_INSTALL_PREFIX}/helloGUI.app 
${CMAKE_INSTALL_PREFIX}/helloGUI.app/Contents/Libraries/libHello.dylib lib)

If I don’t install it, my application works just fine. But after installation, 
I have some errors:

Install the project...
-- Install configuration: 
-- Installing: 
/MYPATH/TestQtCMake/build/install/helloGUI.app/Contents/Libraries/libHello.dylib
-- Installing: /MYPATH/TestQtCMake/build/install/./helloGUI.app
-- Installing: /MYPATH/TestQtCMake/build/install/./helloGUI.app/Contents
-- Installing: 
/MYPATH/TestQtCMake/build/install/./helloGUI.app/Contents/Info.plist
-- Installing: /MYPATH/TestQtCMake/build/install/./helloGUI.app/Contents/MacOS
-- Installing: 
/MYPATH/TestQtCMake/build/install/./helloGUI.app/Contents/MacOS/helloGUI
-- fixup_bundle
--   app='/MYPATH/TestQtCMake/build/install/helloGUI.app'
--   
libs='/MYPATH/TestQtCMake/build/install/helloGUI.app/Contents/Libraries/libHello.dylib'
--   dirs='lib'
-- fixup_bundle: preparing...
-- fixup_bundle: copying...
-- 1/10: *NOT* copying 
'/MYPATH/TestQtCMake/build/install/helloGUI.app/Contents/Libraries/libHello.dylib'
-- 2/10: *NOT* copying 
'/MYPATH/TestQtCMake/build/install/helloGUI.app/Contents/MacOS/helloGUI'
-- 3/10: copying 
'/Users/rleguay/Qt5.2.1/5.2.1/clang_64/lib/QtCore.framework/Versions/5/QtCore'
-- 4/10: copying 
'/Users/rleguay/Qt5.2.1/5.2.1/clang_64/lib/QtGui.framework/Versions/5/QtGui'
-- 5/10: copying 
'/Users/rleguay/Qt5.2.1/5.2.1/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets'
-- fixup_bundle: fixing...
-- 6/10: fixing up 
'/MYPATH/TestQtCMake/build/install/helloGUI.app/Contents/Libraries/libHello.dylib'
-- 7/10: fixing up 
'/MYPATH/TestQtCMake/build/install/helloGUI.app/Contents/MacOS/helloGUI'
-- 8/10: fixing up 
'/MYPATH/TestQtCMake/build/install/helloGUI.app/Contents/Frameworks/QtCore.framework/Versions/5/QtCore'
-- 9/10: fixing up 
'/MYPATH/TestQtCMake/build/install/helloGUI.app/Contents/Frameworks/QtGui.framework/Versions/5/QtGui'
-- 10/10: fixing up 
'/MYPATH/TestQtCMake/build/install/helloGUI.app/Contents/Frameworks/QtWidgets.framework/Versions/5/QtWidgets'
-- fixup_bundle: cleaning up...
-- fixup_bundle: verifying...
-- ===
-- Analyzing app='/MYPATH/TestQtCMake/build/install/helloGUI.app'
-- bundle='/MYPATH/TestQtCMake/build/install/helloGUI.app'
-- 
executable='/MYPATH/TestQtCMake/build/install/helloGUI.app/Contents/MacOS/helloGUI'
-- valid='1'
-- executable file 1: 
/MYPATH/TestQtCMake/build/install/helloGUI.app/Contents/MacOS/helloGUI
-- warning: embedded item does not exist 
'/MYPATH/TestQtCMake/build/install/helloGUI.app/Contents/MacOS/libHello.dylib'
-- 
warning: cannot resolve item '@executable_path/../MacOS/libHello.dylib'

  possible problems:
need more directories?
need to use InstallRequiredSystemLibraries?
run in install tree instead of build tree?

warning: target '@executable_path/../MacOS/libHello.dylib' is not absolute...
warning: target '@executable_path/../MacOS/libHello.dylib' does not exist...
error: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool:
 can't open file: @executable_path/../MacOS/libHello.dylib (No such file or 
directory)
error: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool:
 can't open file: @executable_path/../MacOS/libHello.dylib (No such file or 
directory)
-- verified='1'
-- info='Verified 1 executable files in 
'/MYPATH/TestQtCMake/build/install/helloGUI.app''
-- 
-- verified='1'
-- info=''
-- 
-- fixup_bundle: done

I see that the script search libHello.dylib inside Contents/MacOS but I don’t 
understand why. 
Can we set this path please?

Thank you.

Best regards,
Romain-- 

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: 

[CMake] Linking Error with Visual Studio 2013 x64

2014-04-17 Thread Romain Leguay

Hello everyone,

I think I found a bug with CMake 2.8.12.2: I have on project with two 
sub-folders: a SHARED library and an executable that use the library.
When I generate the Visual Studio solution, my application want to link 
with a static version of my library.


I join you a very small project to illustrate this bug.

May I open an issue in bugzilla?

Best Regards,

Romain


SmallCMakeProject.tar
Description: Binary data
-- 

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

Re: [CMake] Linking Error with Visual Studio 2013 x64

2014-04-17 Thread Romain Leguay
Visual Studio doesn't work like a good gcc? Because, I try this code 
with mingw (32 and 64) and it's working perfectly.
Is there some option to export automatically some methods without using 
__declspec(dllexport)?


Romain

Le 17/04/2014 12:03, Nils Gladitz a écrit :

On 17.04.2014 11:46, Romain Leguay wrote:


I think I found a bug with CMake 2.8.12.2: I have on project with two 
sub-folders: a SHARED library and an executable that use the library.
When I generate the Visual Studio solution, my application want to 
link with a static version of my library.


I join you a very small project to illustrate this bug.



I haven't tried to build the project but I am guessing that the 
static version of the library is actually the import library:

http://en.wikipedia.org/wiki/Dynamic-link_library#Import_libraries

And that you are missing DLL exports e.g.:
http://msdn.microsoft.com/en-us//library/a90k134d.aspx

Without any exports the linker does not create an import library for 
your DLL.


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


Re: [CMake] Linking Error with Visual Studio 2013 x64

2014-04-17 Thread Romain Leguay

Thanks for your answers!

Le 17/04/2014 14:38, Jakub Zakrzewski a écrit :

Visual Studio doesn't work like a good gcc?

Good joke. ;)


The only thing I prefer in VS is his debugger...


Is there some option to export automatically some methods without using 
__declspec(dllexport)?

No. There are workarounds like in 
http://stackoverflow.com/questions/225432/export-all-symbols-when-creating-a-dll
 but it's too much work.
Basically you want to define a macro that resolves to __declspec(dllexport) 
when building the DLL and to nothing when only using libraries headers.


I did this. It's not too much of pain and this way, we can tell which 
methods / class is exported. Hopefully, it's a new project ;)


Regards,

Romain


--
Gruesse,
Jakub


-Original Message-
From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of Romain Leguay
Sent: Donnerstag, 17. April 2014 14:27
To: Nils Gladitz; cmake@cmake.org
Subject: Re: [CMake] Linking Error with Visual Studio 2013 x64

Visual Studio doesn't work like a good gcc? Because, I try this code with mingw 
(32 and 64) and it's working perfectly.
Is there some option to export automatically some methods without using 
__declspec(dllexport)?

Romain

Le 17/04/2014 12:03, Nils Gladitz a écrit :

On 17.04.2014 11:46, Romain Leguay wrote:

I think I found a bug with CMake 2.8.12.2: I have on project with two
sub-folders: a SHARED library and an executable that use the library.
When I generate the Visual Studio solution, my application want to
link with a static version of my library.

I join you a very small project to illustrate this bug.


I haven't tried to build the project but I am guessing that the
static version of the library is actually the import library:
http://en.wikipedia.org/wiki/Dynamic-link_library#Import_libraries

And that you are missing DLL exports e.g.:
 http://msdn.microsoft.com/en-us//library/a90k134d.aspx

Without any exports the linker does not create an import library for
your DLL.

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

[CMake] add_custom_command, TARGET_LINKER_FILE and CMAKE_BUILD_TYPE

2013-09-30 Thread Romain LEGUAY

Hello everyonne,

I try to build my lybrary in debug and release mode in only one command. 
The purpose is to create a package with the minimum files (library in 
debug and release mode and headers) inside it.


Actually, I do something like this:

add_custom_command(OUTPUT build_release_debug_lib
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E 
copy $TARGET_LINKER_FILE:myLib ${CMAKE_CURRENT_BINARY_DIR}/lib)


I don't know how to add a new command to specify the CMAKE_BUILD_TYPE.

Is it possible?

Thank you!

Regards,
Romain
--

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


Re: [CMake] Superbuild subprojects and find_package()

2013-04-18 Thread Romain LEGUAY

Hello John,

I made some generic scripts to answer has those kind of problem. There 
is an example in the folder Examples/FrameworkTest.


You can find the scripts on GitHub: 
https://github.com/Athius/FrameworkCMakeToolkit


I hope this is helpful.

Best regards,

Romain

Le 18/04/13 05:38, John Gallagher a écrit :

Hello all,

Some Googling has led me to questions that have been asked that are 
similar to this one but I haven't seen a definitive answer. I'm trying 
to set up a CMake superbuild where there are dependencies between 
the subprojects, and some of the subprojects use find_package() to 
import targets from their dependencies (other subprojects, from the 
superbuild's point of view). For a stripped down example, suppose I 
have proj1 and proj2. proj1 can be built and installed on its own, and 
it writes out a Proj1Config.cmake file (with targets and such). proj2 uses


find_package(Proj1 REQUIRED)

to import those targets. So independent of a CMake superbuild, things 
work just fine if I configure, build, and install proj1, *then* 
configure, build, and install proj2. Is there a way to do this using a 
CMake superbuild? Some ideas (mostly gleaned from the aforementioned 
googling):


1. Use add_subdirectory() from the superproject. I think the REQUIRED 
on find_package() would fail though? In my case I can modify the 
subprojects, but I would like for them to continue to build correctly 
standalone (not inside the superbuild), as they really are separate 
projects. Is there a way to make add_subdirectory() work without 
exploding on find_package?


2. Don't use CMake for the superbuild - a shell script or plain 
Makefile could accomplish this pretty easily, but that seems a little 
hokey.


3. (This one is unclear.) Somehow build proj1 before configuring 
proj2, and point proj2 at proj1's build directory so it can find 
Proj1Config.cmake. This seems fragile at best (prefix, RPATH, etc issues).


Appreciate any advice!

John


--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

[CMake] CPack - NSIS - Add multiple directory paths inside PATH environment variable

2012-11-08 Thread Romain LEGUAY

Hello everyone,

I make a library and when I install it, I want to put inside the PATH 
environment variable the include directory path and the library path.


I write this:

set(CPACK_NSIS_MODIFY_PATH ON)
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS \${EnvVarUpdate} \$0\ \PATH\ 
\A\ \HKCU\ \${MY_INCLUDE_DIR};${MY_LIB_DIR}\)


where MY_INCLUDE_DIR and MY_LIB_DIR are just some relative path.

Unfortunately, my PATH variable doesn't change.

Where can I found some example to modify the PATH whit NSIS and CPack?

Thank you.

Romain
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] FrameworkCMakeToolkit

2012-10-28 Thread Romain LEGUAY
Thank you Ken !

 

I just create an account on the cmake wiki so in few days the world’s going
to know the greatness of FrameCMakeToolkit :-p!

 

Romain

 

 

De : Moreland, Kenneth [mailto:kmo...@sandia.gov] 
Envoyé : dimanche 28 octobre 2012 15:01
À : Romain LEGUAY
Cc : cmake@cmake.org
Objet : Re: [CMake] FrameworkCMakeToolkit

 

This sounds interesting. You might consider adding a page to the cmake wiki
to make it easier to find.  You could make a link off this page listing
contributions from users.

 

http://www.cmake.org/Wiki/CMake_User_Contributed_Macros

-Ken

 

Sent from my iPad so blame autocorrect.


On Oct 27, 2012, at 9:46 AM, Romain LEGUAY romain.leg...@gmail.com
wrote:

Hello everyone!

I did some generic CMake scripts to more easier build C/C++ projects.

Those scripts permits to build static library, build executable, build
cxxtest, generate Doxygen Documentation in html, latex and pdf formats,
create source, binary and documentation (just the pdf file) packages, to
profile the code with GProf (only on Unix system).

You can use those scripts on multiple projects in different tree.

I put some examples to show how we can build projects.



You can download it on Github:
git://github.com/Athius/FrameworkCMakeToolkit.git



As you can see, my english is not very good so if the documentation is not
understandable, please feel free to tell me what I need to fix ;)

If you have some questions/suggestions, don't hesitate to contact me!

I hope those scripts can help some people ^^!

Regards,
Romain.
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

[CMake] FrameworkCMakeToolkit

2012-10-27 Thread Romain LEGUAY

Hello everyone!

I did some generic CMake scripts to more easier build C/C++ projects.

Those scripts permits to build static library, build executable, build 
cxxtest, generate Doxygen Documentation in html, latex and pdf formats, 
create source, binary and documentation (just the pdf file) packages, to 
profile the code with GProf (only on Unix system).


You can use those scripts on multiple projects in different tree.

I put some examples to show how we can build projects.



You can download it on Github: 
git://github.com/Athius/FrameworkCMakeToolkit.git




As you can see, my english is not very good so if the documentation is 
not understandable, please feel free to tell me what I need to fix ;)


If you have some questions/suggestions, don't hesitate to contact me!

I hope those scripts can help some people ^^!

Regards,
Romain.
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CPack: Project and independent subproject

2012-10-23 Thread Romain LEGUAY

Thank you Eric,

I succeed to create the package by using CPACK_INSTALL_CMAKE_PROJECTS 
variable.


I have some problem now to put my package in a specific folder. I try to 
set CPACK_TOPLEVEL_TAG variable but there is no change...


Le 22/10/12 20:59, Eric Noulard a écrit :
If you want to have control over what is installed the better to do 
that is to create COMPONENT.

This is a part of my CMakeLists.txt:

install(TARGETS ${PROJECT_NAME}
   DESTINATION Demos
   COMPONENT ${PROJECT_NAME})

like this but I doubt that you can name a COMPONENT with the same
name as the name of your project.

then you must either define:
set(CPACK_INSTALL_CMAKE_PROJECTS
${CMAKE_CURRENT_BINARY_DIR};${PROJECT_NAME};${PROJECT_NAME}:/)

see documentation
cpack --help-variable CPACK_INSTALL_CMAKE_PROJECTS

I searched some methods to put the wanted files inside a package but I only
found how to ignore some files.

Does anyone have those kind of problem?

By the does your Demo/ directory have a project(...) command in its
CMakeLists.txt?


No I didn't put any project(...) in Demo/ or Application/ directories.

Thanks again for your help,
Romain
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] [SOLVED] CPack: Project and independent subproject

2012-10-23 Thread Romain LEGUAY

Le 23/10/12 10:45, Romain LEGUAY a écrit :

Thank you Eric,

I succeed to create the package by using CPACK_INSTALL_CMAKE_PROJECTS 
variable.


I have some problem now to put my package in a specific folder. I try 
to set CPACK_TOPLEVEL_TAG variable but there is no change...


I just resolve this problem: I use CPACK_PACKAGE_DIRECTORY variable.

So all it solved ;)

Romain


Le 22/10/12 20:59, Eric Noulard a écrit :
If you want to have control over what is installed the better to do 
that is to create COMPONENT.

This is a part of my CMakeLists.txt:

install(TARGETS ${PROJECT_NAME}
   DESTINATION Demos
   COMPONENT ${PROJECT_NAME})

like this but I doubt that you can name a COMPONENT with the same
name as the name of your project.

then you must either define:
set(CPACK_INSTALL_CMAKE_PROJECTS
${CMAKE_CURRENT_BINARY_DIR};${PROJECT_NAME};${PROJECT_NAME}:/)

see documentation
cpack --help-variable CPACK_INSTALL_CMAKE_PROJECTS
I searched some methods to put the wanted files inside a package but 
I only

found how to ignore some files.

Does anyone have those kind of problem?

By the does your Demo/ directory have a project(...) command in its
CMakeLists.txt?


No I didn't put any project(...) in Demo/ or Application/ directories.

Thanks again for your help,
Romain


--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] CPack: Project and independent subproject

2012-10-22 Thread Romain LEGUAY

Hello everyone,

My c++ project contains a Library folder, an Applications folder and a 
Demos folder like this:


Project/
 |- Library/
 |- include/
 |- src/
 |- Applications/
 |- appliA/
|- include/
|- src/
 ...
 |- Demos/
 |- demoA/
|- include/
|- src/
 ...

The applications and demos use the Library (which is a static library).

I can build all the application correctly in different level (directly 
inside demoA/ for example or in Project/).
I create custom target to build my package: demoA-package, 
demoA-package_source 


My problem is when I want to create a package (tar.gz, dmg, nsis or 
others...), I can't figure how to put just the executable of demosA 
inside the package: I have all the executable and the library.


This is a part of my CMakeLists.txt:

   install(TARGETS ${PROJECT_NAME}
  DESTINATION Demos
  COMPONENT ${PROJECT_NAME})

   set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
   set(CPACK_PACKAGE_VENDOR Me)
   set(CPACK_PACKAGE_DESCRIPTION_SUMMARY Example test framework: demos
   ${PROJECT_NAME})
   set(CPACK_PACKAGE_VERSION_MAJOR 1)
   set(CPACK_PACKAGE_VERSION_MINOR 0)
   set(CPACK_PACKAGE_VERSION_PATCH 0)
   set(CPACK_PACKAGE_VERSION
   
${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
   set(CPACK_SOURCE_IGNORE_FILES
   /bin/;/.svn/;/.git/;${CPACK_SOURCE_IGNORE_FILES})

   set(CPACK_OUTPUT_CONFIG_FILE
   ${CMAKE_CURRENT_BINARY_DIR}/CPackConfig.cmake)
   set(CPACK_SOURCE_OUTPUT_CONFIG_FILE
   ${CMAKE_CURRENT_BINARY_DIR}/CPackSourceConfig.cmake)

   add_custom_target(${PROJECT_NAME}-package cpack --config
   ${CPACK_OUTPUT_CONFIG_FILE})
   add_custom_target(${PROJECT_NAME}-package_source cpack --config
   ${CPACK_SOURCE_OUTPUT_CONFIG_FILE})

   include(CPack)

   cpack_add_component(${PROJECT_NAME}
DISPLAY_NAME ${PROJECT_NAME})

I searched some methods to put the wanted files inside a package but I 
only found how to ignore some files.


Does anyone have those kind of problem?

Thanks,
Romain





--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

[CMake] CMake 2.8.8-2.8.9 - Generate Xcode 4.4.1 project

2012-08-10 Thread Romain LEGUAY
: unrecognized command line option -Wno-sign-conversion

  cc1plus: error: unrecognized command line option 
-fserialize-diagnostics


  Command /Applications/Xcode.app/Contents/Developer/usr/bin/llvm-gcc-4.2
  failed with exit code 1

  ** BUILD FAILED **

  The following build commands failed:

  CompileC
CMAKE_TRY_COMPILE.build/Debug/cmTryCompileExec2932044491.build/Objects-normal/x86_64/testCXXCompiler.o
  testCXXCompiler.cxx normal x86_64 c++
  com.apple.compilers.llvm.clang.1_0.compiler

  (1 failure)

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)

-- Configuring incomplete, errors occurred!

I think there is some problem to generate the cmTryCompileExec file 
because when I do:

*sudo cmake -GXcode .*

I have no problem.
Of course I have write access to my project folder so I don't really 
understand the problem here...


If anyone has some clues ;).

Regards,
Romain LEGUAY

Le 09/08/12 23:06, Bill Hoffman a écrit :

On 8/9/2012 4:58 PM, Etuka Onono wrote:

ichael and David, thanks for responding. Rest assured that I always
truncate my build directory when I come to a sticky halt with Cmake.

Michael, I set a symmlink to /Developer/Applications/Xcode.app as you
suggested, but this does not solve my problem (I know David had his
doubts, I wanted to try anyway).  I do think you are right about it
having something to do with information on older issues of Xcode,
though, as I have a clean install of Xcode 4.4.1 and Cmake 2.8.8 that
works (neither have been upgraded) and I have been as rigorous as I
feel I can be in deleting all Cmake artefacts when installing Cmake
2.8.8 (removed anything vaguely related to Cmake in /Library and
~/Library, removed all the symmlinks in /usr/bin, etc).



See this bug report:

http://www.cmake.org/Bug/view.php?id=13353

Trouble is here:
xcodebuild: error: option '-buildstyle' is no longer supported

Answer is : Looks like it's no longer an issue with the final release 
of Xcode 4.4 and OS X 10.8. This issue can be closed. 


-Bill


--

Powered by www.kitware.com

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


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


Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] CMake 2.8.8-2.8.9 - Generate Xcode 4.4.1 project

2012-08-10 Thread Romain LEGUAY

Hi again!

I succeed to generate a Xcode project (with a normal user) with cmake-gui.
I hope this new information can lead you to the solution.

Regards,
Romain

Le 10/08/12 11:34, Romain LEGUAY a écrit :

Hi everyone!

I have a problem to generate a Xcode project.

I completely remove Xcode 4.4.1 (and command line tools) and CMake 2.8.9.

I reinstall Xcode 4.4.1 and command line tools and CMake 2.8.9.

I had this error when I try to generate a XCode project ('cmake 
-GXcode .'):

xcodebuild: error: developer tools not installed; download from

Thanks to Yu You, I apply this command:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

And now I have the same error as previously:
cmake -GXcode .
-- The CXX compiler identification is GNU 4.2.1
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler using: Xcode
-- Check for working CXX compiler using: Xcode -- broken
CMake Error at /Applications/CMake 
2.8-9.app/Contents/share/cmake-2.8/Modules/CMakeTestCXXCompiler.cmake:45 
(MESSAGE):
  The C++ compiler /usr/bin/llvm-g++ is not able to compile a simple 
test

  program.

  It fails with the following output:

   Change Dir: /Users/rleguay/temp/test/DummyProject/CMakeFiles/CMakeTmp

  Run Build Command:/Applications/CMake\ 
2.8-9.app/Contents/bin/cmakexbuild

  -project CMAKE_TRY_COMPILE.xcodeproj build -target
  cmTryCompileExec2932044491 -configuration Debug

  === BUILD NATIVE TARGET cmTryCompileExec2932044491 OF PROJECT
  CMAKE_TRY_COMPILE WITH CONFIGURATION Debug ===

  Check dependencies

  CompileC
CMAKE_TRY_COMPILE.build/Debug/cmTryCompileExec2932044491.build/Objects-normal/x86_64/testCXXCompiler.o
  testCXXCompiler.cxx normal x86_64 c++
  com.apple.compilers.llvm.clang.1_0.compiler

  cd /Users/rleguay/temp/test/DummyProject/CMakeFiles/CMakeTmp
/Applications/Xcode.app/Contents/Developer/usr/bin/llvm-gcc-4.2 -x c++ 
-arch x86_64 -fmessage-length=0 -Wno-trigraphs -fpascal-strings -O0 
-Wno-missing-field-initializers -Wno-missing-prototypes 
-Wno-return-type -Wno-non-virtual-dtor -Wno-overloaded-virtual 
-Wno-exit-time-destructors -Wformat -Wno-missing-braces -Wparentheses 
-Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter 
-Wno-unused-variable -Wunused-value -Wno-uninitialized 
-Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants 
-Wno-conversion -Wno-sign-compare -Wno-shorten-64-to-32 
-Wno-newline-eof -Wc++11-extensions -DCMAKE_INTDIR=\Debug\ 
-i2012-08-10 11:13:51.477 xcodebuild[1087:3603]  DVTAssertions: 
Warning in 
/SourceCache/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-1559/Xcode3Sources/XcodeIDE/Frameworks/DevToolsBase/pbxcore/SpecificationTypes/XCCommandLineToolSpecification.m:810


  Details: Unable to get message category info for tool
'/Applications/Xcode.app/Contents/Developer/usr/bin/llvm-gcc-4.2'.

  Reason: i686-apple-darwin11-llvm-gcc-4.2: no input files

  Object: XCCompilerSpecificationClang: 0x400afa520

  Method: -messageCategoryInfoForExecutablePath:

  Thread: NSThread: 0x40078a860{name = (null), num = 4}

  Please file a bug at http://bugreport.apple.com with this warning 
message

  and any useful information you can provide.

  sysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk
  -fasm-blocks -Wdeprecated-declarations -Winvalid-offsetof
  -mmacosx-version-min=10.7 -Wno-sign-conversion
-I/Users/rleguay/temp/test/DummyProject/CMakeFiles/CMakeTmp/Debug/include
-I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
-I/Users/rleguay/temp/test/DummyProject/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/cmTryCompileExec2932044491.build/DerivedSources/x86_64
-I/Users/rleguay/temp/test/DummyProject/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/cmTryCompileExec2932044491.build/DerivedSources
  -Wmost -Wno-four-char-constants -Wno-unknown-pragmas
-F/Users/rleguay/temp/test/DummyProject/CMakeFiles/CMakeTmp/Debug -g -MMD
  -MT dependencies -MF
/Users/rleguay/temp/test/DummyProject/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/cmTryCompileExec2932044491.build/Objects-normal/x86_64/testCXXCompiler.d
  --serialize-diagnostics
/Users/rleguay/temp/test/DummyProject/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/cmTryCompileExec2932044491.build/Objects-normal/x86_64/testCXXCompiler.dia
  -c
/Users/rleguay/temp/test/DummyProject/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
  -o
/Users/rleguay/temp/test/DummyProject/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/cmTryCompileExec2932044491.build/Objects-normal/x86_64/testCXXCompiler.o

  i686-apple-darwin11-llvm-gcc-4.2:
/Users/rleguay/temp/test/DummyProject/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/cmTryCompileExec2932044491.build/Objects-normal/x86_64

Re: [CMake] CMake 2.8.8 Upgrade problem with Xcode on OS X 10.8

2012-08-09 Thread Romain LEGUAY

Hello,

I have practically the same problem with OS X 10.7.4 and the last 
version of XCode (4.4.1).


$ cmake -GXcode .

-- The C compiler identification is GNU 4.2.1
-- The CXX compiler identification is GNU 4.2.1
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler using: Xcode
-- Check for working C compiler using: Xcode -- broken
CMake Error at /Applications/CMake 
2.8-8.app/Contents/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 
(MESSAGE):
  The C compiler /usr/bin/llvm-gcc-4.2 is not able to compile a 
simple test

  program.

  It fails with the following output:

   Change Dir: /path_to_my_project/CMakeFiles/CMakeTmp



  Run Build Command:/Applications/CMake\ 2.8-8.app/Contents/bin/cmakexbuild
  -project CMAKE_TRY_COMPILE.xcodeproj build -target
  cmTryCompileExec404778880 -configuration Debug

Thanks,

Romain

Le 09/08/12 02:34, Etuka Onono a écrit :
After I upgraded to OS X 10.8, I recently upgraded my CMake version to 
2.8.8.


I can build CMake projects if I use Unix Makefiles as a generator, 
but if I use the Xcode generator, I get the following error:


The C compiler identification is GNU 4.2.1
The CXX compiler identification is GNU 4.2.1
Checking whether C compiler has -isysroot
Checking whether C compiler has -isysroot - yes
Checking whether C compiler supports OSX deployment target flag
Checking whether C compiler supports OSX deployment target flag - yes
Check for working C compiler using: Xcode
Check for working C compiler using: Xcode -- broken

CMake Error at /Developer/CMake 
2.8-8.app/Contents/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 
(MESSAGE):
The C compiler /usr/bin/gcc is not able to compile a simple test 
program.


It fails with the following output:

Change Dir: 
/Users/etuka/projects/baml/onethousand/build/CMakeFiles/CMakeTmp



Run Build Command:/Developer/CMake\ 2.8-8.app/Contents/bin/cmakexbuild
-project CMAKE_TRY_COMPILE.xcode build -target cmTryCompileExec3395723889
-buildstyle Development

xcodebuild: error: option '-buildstyle' is no longer supported

I understand that this error is associated with earlier versions of 
Cmake that are incompatible with Xcode 4.4.  I have tried removing all 
traces of CMake 2.8.8 that I can from my system and re-installing, but 
I cannot get rid of this error.  I would be grateful for suggestions 
of what to try next.


Thanks,

Etuka Onono


--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

[CMake] Easier way to override variables

2012-07-18 Thread Romain LEGUAY

Hello everyone,

I don't find in any example to override a variable.

I proceed this way:

unset(MY_VAR CACHE)
set(MY_VAR MY_NEW_VALUE)

I have many variables so I would like to have just one line to change 
just the value of the variable (not its documentation) in one line like 
this:


set(MY_VAR MY_NEW_VALUE FORCED)

Is it possible?

Thank you,

Romain












--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] [Resolved] Easier way to override variables

2012-07-18 Thread Romain LEGUAY

Hi!

Thank you for your answer! It's worked just fine!

Romain

Le 18/07/12 17:58, Yngve Inntjore Levinsen a écrit :

Hi Romain,

Have a look at the help for the function set:
$ cmake --help-command set

If I understand the documentation, this should be what you are looking for:
set(MY_VAR NEW_VALUE FORCE)

Cheers,
Yngve

On Wednesday 18. July 2012 15.49.31, Romain LEGUAY wrote:

Hello everyone,

I don't find in any example to override a variable.

I proceed this way:

unset(MY_VAR CACHE)
set(MY_VAR MY_NEW_VALUE)

I have many variables so I would like to have just one line to change
just the value of the variable (not its documentation) in one line like
this:

set(MY_VAR MY_NEW_VALUE FORCED)

Is it possible?

Thank you,

Romain












--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Multiple project

2012-07-09 Thread Romain LEGUAY

Hello everyone,

I have a big project organized like this:
root/
- CMakeLists.txt
CMake/
-- some .cmake scripts
lib/
 -- CMakeLists.txt
include/
src/
CMake/
-- some .cmake scripts
apps/
 -- CMakeLists.txt
A_app/
-- CMakeLists.txt
  src/
  include/

For now I have generic scripts and I must run CMake at the root path. 
This way, when I do some modification in my library and I do a make in 
one of my app, the library is build in first place then the application.


Now I want to have an independent comportment for the library building 
and the applications but I need to keep the former comportment.


I success to build my library with independent way but when I try to 
generate all the makfiles from the root path, it doesn't work: it 
doesn't found different files from my CMAKE_MODULE_PATH I defined in 
root/lib/CMakeLists.txt and in root/CMakeLists.txt.



Is it possible to have this comportment?
Do you have some example or site to help me please?


Thank you.

Regards,
Romain




--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Multiple project

2012-07-09 Thread Romain LEGUAY

Thanks for your answer!

But I think if I do a 'cmake .' in lib dir or a application folder, I am 
going to have some problem no?


Romain

Le 09/07/12 18:14, J Decker a écrit :

${CMAKE_SOURCE_DIR} this is the directory of the root CMakeLists.txt
that is processing, you can base your other paths off of that.

On Mon, Jul 9, 2012 at 6:58 AM, Romain LEGUAY romain.leg...@gmail.com wrote:

Hello everyone,

I have a big project organized like this:
root/
 - CMakeLists.txt
 CMake/
 -- some .cmake scripts
 lib/
  -- CMakeLists.txt
 include/
 src/
 CMake/
 -- some .cmake scripts
 apps/
  -- CMakeLists.txt
 A_app/
 -- CMakeLists.txt
   src/
   include/

For now I have generic scripts and I must run CMake at the root path. This
way, when I do some modification in my library and I do a make in one of my
app, the library is build in first place then the application.

Now I want to have an independent comportment for the library building and
the applications but I need to keep the former comportment.

I success to build my library with independent way but when I try to
generate all the makfiles from the root path, it doesn't work: it doesn't
found different files from my CMAKE_MODULE_PATH I defined in
root/lib/CMakeLists.txt and in root/CMakeLists.txt.


Is it possible to have this comportment?
Do you have some example or site to help me please?


Thank you.

Regards,
Romain




--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake



--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] find_library and static library

2011-11-17 Thread Romain LEGUAY

Hello everyone!
I found in previous message there is none option to specify to 
find_library function to search just static library. It was for CMake 2.6.


Has it got any change with the new version of CMake?


I try to specify the name of the library like this:

find_library(MY_STATIC_LIB NAMES libmylib.a PATHS /path/to/mylib)

but it doesn't work.

I don't understand the reason why it doesn't work.

If anyone have some ideas...

Thanks,

Romain
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Static Library output problem

2011-11-11 Thread Romain LEGUAY

Hello everyone!
First, I need to thank you all the CMake developers for their awesome 
work!!!


I try to build a static and a shared libraries. I set the 
LIBRARY_OUTPUT_DIRECTORY for each library target like this:


set_target_properties(${sharedLib} PROPERTIES
  LIBRARY_OUTPUT_DIRECTORY
  
${PROJECT_BINARY_DIR}/lib/${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}/${CMAKE_BUILD_TYPE})

set_target_properties(${staticLib} PROPERTIES
  LIBRARY_OUTPUT_DIRECTORY
  
${PROJECT_BINARY_DIR}/lib/${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}/${CMAKE_BUILD_TYPE})


The shared library is built in the correct directory but the static is 
built in PROJECT_BINARY_DIR.
I try to switch the order of the set_target_properties method but no 
changes.

I don't why it doesn't work.

Did anyone have any ideas?

I attached my CMakeLists.txt file.

Thanks,
Romain

PS: I'm on Ubuntu 11.10 64bits, with cmake 2.8.5 (installed from the deb 
package).
cmake_minimum_required(VERSION 2.8)

project(XmlParser)

find_package(CxxTest)

IF(CYGWIN)
  unset(WIN32)
ENDIF()

# The version number
set(XmlParser_VERSION_MAJOR 1)
set(XmlParser_VERSION_MINOR 0)
set(XmlParser_VERSION_REVISION b)
set(XmlParser_VERSION 
  
${XmlParser_VERSION_MAJOR}.${XmlParser_VERSION_MINOR}${XmlParser_VERSION_REVISION})

# configure a header file to pass some of the CMake settings
# to the source code
configure_file(
  ${PROJECT_SOURCE_DIR}/include/XmlParserConfig.h.in
  ${PROJECT_BINARY_DIR}/include/XmlParserConfig.h
)

include_directories(include ${PROJECT_BINARY_DIR}/include)

file(GLOB
  SOURCE_FILES
  src/*.cpp
  include/template/*.hpp
)

file(GLOB
  INCLUDE_FILES
  include/*.h
  ${PROJECT_BINARY_DIR}/include/*.h
)

set(xmlParserSharedLib xmlParser)
set(xmlParserStaticLib xmlParserStatic)

add_library(${xmlParserStaticLib}
STATIC
${SOURCE_FILES})
add_library(${xmlParserSharedLib}
SHARED
${SOURCE_FILES})

set_target_properties(${xmlParserStaticLib} PROPERTIES
  LIBRARY_OUTPUT_DIRECTORY 
  
${PROJECT_BINARY_DIR}/lib/${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}/${CMAKE_BUILD_TYPE})
set_target_properties(${xmlParserSharedLib} PROPERTIES
  LIBRARY_OUTPUT_DIRECTORY 
  
${PROJECT_BINARY_DIR}/lib/${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}/${CMAKE_BUILD_TYPE})

#install(TARGETS ${xmlParserSharedLib} ${xmlParserStaticLib} DESTINATION lib)
#install(FILES ${INCLUDE_FILES} DESTINATION include)

if(CXXTEST_FOUND)
  set(xmlParser_test_include ${PROJECT_SOURCE_DIR}/unitary-test/include)
  set(xmlParser_test_src unitary-test/src)
  set(xmlParser_test_build unitary-test/build)
  set(CXXTEST_USE_PYTHON TRUE)
  include_directories(${CXXTEST_INCLUDE_DIR})
  set(XmlElementTest ${xmlParser_test_build}/XmlElementTest)
  CXXTEST_ADD_TEST(${XmlElementTest} ${xmlParser_test_src}/XmlElementTest.cpp 
${xmlParser_test_include}/XmlElementTest.h)
  target_link_libraries(${XmlElementTest} ${xmlParserStaticLib})
endif()
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Static Library output problem

2011-11-11 Thread Romain LEGUAY

Ok thanks for your quick answers! It works perfectly now!

Why don't we have just one variables for the library?

With set_target_properties, we can define for each library the path.

Romain


Le 11/11/2011 15:38, Andreas Pakulat a écrit :

On 11.11.11 15:18:05, Romain LEGUAY wrote:

Hello everyone!
First, I need to thank you all the CMake developers for their
awesome work!!!

I try to build a static and a shared libraries. I set the
LIBRARY_OUTPUT_DIRECTORY for each library target like this:

See the documentation for the LIBRARY_OUTPUT_DIRECTORY, it only applies
to shared libraries on non-dll platforms (*nix usually). For a static
library you need to set ARCHIVE_OUTPUT_DIRECTORY.

Andreas

--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake